PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
BlatterTestHalfar.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 BLATTERTESTHALFAR_H
21 #define BLATTERTESTHALFAR_H
22 
23 #include "pism/stressbalance/blatter/Blatter.hh"
24 
25 namespace pism {
26 namespace stressbalance {
27 
28 /*!
29  * Implements the analytical source term and BC for the X-Z Halfar dome setup.
30  */
31 class BlatterTestHalfar : public Blatter {
32 public:
33  BlatterTestHalfar(std::shared_ptr<const Grid> grid, int Mz, int coarsening_factor);
34 
35  double H_exact(double x) const;
36 
37  double u_exact(double x, double z) const;
38 private:
39  bool dirichlet_node(const DMDALocalInfo &info, const fem::Element3::GlobalIndex& I);
40 
41  Vector2d u_bc(double x, double y, double z) const;
42 
43  void residual_source_term(const fem::Q1Element3 &element,
44  const double *surface,
45  const double *bed,
46  Vector2d *residual);
47 
48  void residual_lateral(const fem::Q1Element3 &element,
49  const fem::Q1Element3Face &face,
50  const double *surface_nodal,
51  const double *z_nodal,
52  const double *sl_nodal,
53  Vector2d *residual);
54 
55  void residual_surface(const fem::Q1Element3 &element,
56  const fem::Q1Element3Face &face,
57  Vector2d *residual);
58 
59  void residual_basal(const fem::Q1Element3 &element,
60  const fem::Q1Element3Face &face,
61  const double *tauc_nodal,
62  const double *f_nodal,
63  const Vector2d *u_nodal,
64  Vector2d *residual);
65 
66  void jacobian_basal(const fem::Q1Element3Face &face,
67  const double *tauc_nodal,
68  const double *f_nodal,
69  const Vector2d *u_nodal,
70  double K[2 * fem::q13d::n_chi][2 * fem::q13d::n_chi]);
71 
72  double m_B;
73 
74  double m_H0;
75 
76  double m_R0;
77 
78  double m_rho;
79 
80  double m_g;
81 };
82 
83 } // end of namespace stressbalance
84 } // end of namespace pism
85 
86 #endif /* BLATTERTESTHALFAR_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
void residual_basal(const fem::Q1Element3 &element, const fem::Q1Element3Face &face, const double *tauc_nodal, const double *f_nodal, const Vector2d *u_nodal, Vector2d *residual)
void residual_lateral(const fem::Q1Element3 &element, const fem::Q1Element3Face &face, const double *surface_nodal, const double *z_nodal, const double *sl_nodal, Vector2d *residual)
double u_exact(double x, double z) const
bool dirichlet_node(const DMDALocalInfo &info, const fem::Element3::GlobalIndex &I)
void residual_surface(const fem::Q1Element3 &element, const fem::Q1Element3Face &face, Vector2d *residual)
Vector2d u_bc(double x, double y, double z) const
void residual_source_term(const fem::Q1Element3 &element, const double *surface, const double *bed, Vector2d *residual)
BlatterTestHalfar(std::shared_ptr< const Grid > grid, int Mz, int coarsening_factor)
void jacobian_basal(const fem::Q1Element3Face &face, const double *tauc_nodal, const double *f_nodal, const Vector2d *u_nodal, double K[2 *fem::q13d::n_chi][2 *fem::q13d::n_chi])
const int n_chi
Number of shape functions on a Q1 element.
Definition: FEM.hh:213
static double K(double psi_x, double psi_y, double speed, double epsilon)
const int I[]
Definition: ssafd_code.cc:24