PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
BlatterTestXY.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 BLATTERTESTXY_H
21 #define BLATTERTESTXY_H
22 
23 #include "pism/stressbalance/blatter/Blatter.hh"
24 
25 namespace pism {
26 namespace stressbalance {
27 
28 /*!
29  * Implements Dirichlet BC and the source term for a verification test using the following
30  * exact solution:
31  *
32  * u = exp(x) * sin(2 * pi * y)
33  * v = exp(x) * cos(2 * pi * y)
34  *
35  * Domain: [0, 1] * [0, 1] * [0, 1].
36  *
37  * Ice thickness is equal to 1 everywhere; bed elevation is 0 everywhere.
38  *
39  * Dirichlet BC are imposed at all the nodes along the lateral boundary.
40  *
41  * Natural boundary conditions are used on the top and bottom boundaries.
42  *
43  * Note: KSP iterations seem to stall when the default preconditioner is used. Use
44  * "-pc_type gamg" instead.
45  */
46 class BlatterTestXY : public Blatter {
47 public:
48  BlatterTestXY(std::shared_ptr<const Grid> grid, int Mz, int coarsening_factor);
49 
50 protected:
51  bool marine_boundary(int face,
52  const int *node_type,
53  const double *ice_bottom,
54  const double *sea_level);
55 
56  bool dirichlet_node(const DMDALocalInfo &info, const fem::Element3::GlobalIndex& I);
57 
58  Vector2d u_bc(double x, double y, double z) const;
59 
60  void residual_source_term(const fem::Q1Element3 &element,
61  const double *surface,
62  const double *bed,
63  Vector2d *residual);
64  //! constant ice hardness
65  double m_B;
66 };
67 
68 } // end of namespace stressbalance
69 } // end of namespace pism
70 
71 #endif /* BLATTERTESTXY_H */
std::shared_ptr< const Grid > grid() const
Definition: Component.cc:105
This class represents a 2D vector field (such as ice velocity) at a certain grid point.
Definition: Vector2d.hh:29
3D Q1 element
Definition: Element.hh:351
double m_B
constant ice hardness
void residual_source_term(const fem::Q1Element3 &element, const double *surface, const double *bed, Vector2d *residual)
bool marine_boundary(int face, const int *node_type, const double *ice_bottom, const double *sea_level)
Vector2d u_bc(double x, double y, double z) const
BlatterTestXY(std::shared_ptr< const Grid > grid, int Mz, int coarsening_factor)
bool dirichlet_node(const DMDALocalInfo &info, const fem::Element3::GlobalIndex &I)
const int I[]
Definition: ssafd_code.cc:24