PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
MPDATA2.hh
Go to the documentation of this file.
1 /* Copyright (C) 2020, 2021, 2022 PISM Authors
2  *
3  * This file is part of PISM.
4  *
5  * PISM is free software; you can redistribute it and/or modify it under the
6  * terms of the GNU General Public License as published by the Free Software
7  * Foundation; either version 3 of the License, or (at your option) any later
8  * version.
9  *
10  * PISM is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with PISM; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef PISM_MPDATA_2D_H
21 #define PISM_MPDATA_2D_H
22 
23 #include "pism/util/array/Scalar.hh"
24 #include "pism/util/array/Vector.hh"
25 #include "pism/util/array/Staggered.hh"
26 
27 namespace pism {
28 
29 class Grid;
30 
31 namespace array {
32 class CellType;
33 } // end of namespace array
34 
35 class MPDATA2 {
36 public:
37  MPDATA2(std::shared_ptr<const Grid> grid, int N);
38 
39  void update(double dt,
40  const array::CellType &cell_type,
41  const array::Scalar &x,
42  const array::Vector &velocity,
43  bool nonoscillatory = false);
44 
45  const array::Scalar& x() const;
46 
47 private:
48  // interface velocity (on the staggered grid; ghosted)
50 
52 
53  // temporary storage for the result of the previous iteration
56 
57  // advected quantity
59 
60  // number of iterations
61  int m_N;
62 };
63 
64 } // end of namespace pism
65 
66 #endif /* PISM_MPDATA_2D_H */
array::Scalar2 m_x_input
Definition: MPDATA2.hh:55
array::Vector1 m_v_ghosted
Definition: MPDATA2.hh:51
array::Staggered1 m_v_old
Definition: MPDATA2.hh:49
array::Staggered1 m_v
Definition: MPDATA2.hh:49
const array::Scalar & x() const
Definition: MPDATA2.cc:163
array::Scalar m_x
Definition: MPDATA2.hh:58
MPDATA2(std::shared_ptr< const Grid > grid, int N)
Definition: MPDATA2.cc:167
array::Scalar2 m_x_previous
Definition: MPDATA2.hh:54
void update(double dt, const array::CellType &cell_type, const array::Scalar &x, const array::Vector &velocity, bool nonoscillatory=false)
Definition: MPDATA2.cc:309
"Cell type" mask. Adds convenience methods to array::Scalar.
Definition: CellType.hh:30