19 #ifndef PISM_BLATTER_H
20 #define PISM_BLATTER_H
22 #include "pism/stressbalance/ShallowStressBalance.hh"
23 #include "pism/util/petscwrappers/SNES.hh"
24 #include "pism/util/petscwrappers/DM.hh"
25 #include "pism/util/petscwrappers/Vec.hh"
26 #include "pism/util/fem/FEM.hh"
35 namespace stressbalance {
39 Blatter(std::shared_ptr<const Grid>
grid,
int Mz,
int coarsening_factor);
137 double *sea_level)
const;
140 const int *node_type,
141 const double *ice_bottom,
142 const double *sea_level);
146 virtual Vector2d u_bc(
double x,
double y,
double z)
const;
154 const double *B_nodal,
158 const double *tauc_nodal,
159 const double *f_nodal,
172 const double *B_nodal,
176 const double *surface,
182 const double *tauc_nodal,
183 const double *f_nodal,
193 const double *surface_nodal,
194 const double *z_nodal,
195 const double *sl_nodal,
213 const std::string &prefix);
std::shared_ptr< const Grid > grid() const
High-level PISM I/O class.
This class represents a 2D vector field (such as ice velocity) at a certain grid point.
A storage vector combining related fields in a struct.
A virtual class collecting methods common to ice and bedrock 3D fields.
void jacobian_dirichlet(const DMDALocalInfo &info, Parameters **P, Mat J)
void define_model_state_impl(const File &output) const
The default (empty implementation).
void get_basal_velocity(array::Vector &result)
virtual void residual_f(const fem::Q1Element3 &element, const Vector2d *u_nodal, const double *B_nodal, Vector2d *residual)
virtual Vector2d u_bc(double x, double y, double z) const
static const int m_n_work
virtual void residual_source_term(const fem::Q1Element3 &element, const double *surface, const double *bed, Vector2d *residual)
void compute_node_type(double min_thickness)
virtual 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 write_model_state_impl(const File &output) const
The default (empty implementation).
void compute_residual(DMDALocalInfo *info, const Vector2d ***X, Vector2d ***R)
virtual bool marine_boundary(int face, const int *node_type, const double *ice_bottom, const double *sea_level)
fem::Q1Element3Face m_face4
static bool partially_submerged_face(int face, const double *z, const double *sea_level)
virtual 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)
virtual void init_2d_parameters(const Inputs &inputs)
std::shared_ptr< array::Array3D > m_u_sigma
std::shared_ptr< array::Array3D > velocity_v_sigma() const
SolutionInfo parameter_continuation()
void update(const Inputs &inputs, bool)
PetscErrorCode setup(DM pism_da, grid::Periodicity p, int Mz, int coarsening_factor, const std::string &prefix)
double m_work[m_n_work][m_Nq]
void init_ice_hardness(const Inputs &inputs, const petsc::DM &da)
static PetscErrorCode jacobian_callback(DMDALocalInfo *info, const Vector2d ***x, Mat A, Mat J, Blatter *solver)
void residual_dirichlet(const DMDALocalInfo &info, Parameters **P, const Vector2d ***x, Vector2d ***R)
static PetscErrorCode function_callback(DMDALocalInfo *info, const Vector2d ***x, Vector2d ***f, Blatter *solver)
fem::Q1Element3Face m_face100
void compute_averaged_velocity(array::Vector &result)
std::shared_ptr< array::Array3D > velocity_u_sigma() const
Blatter(std::shared_ptr< const Grid > grid, int Mz, int coarsening_factor)
static bool exterior_element(const int *node_type)
virtual void jacobian_f(const fem::Q1Element3 &element, const Vector2d *u_nodal, const double *B_nodal, double K[2 *fem::q13d::n_chi][2 *fem::q13d::n_chi])
static bool grounding_line(const double *F)
virtual 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])
void compute_jacobian(DMDALocalInfo *info, const Vector2d ***x, Mat A, Mat J)
array::Array2D< Parameters > m_parameters
virtual bool dirichlet_node(const DMDALocalInfo &info, const fem::Element3::GlobalIndex &I)
virtual void residual_surface(const fem::Q1Element3 &element, const fem::Q1Element3Face &face, Vector2d *residual)
std::shared_ptr< array::Array3D > m_v_sigma
virtual ~Blatter()=default
Vector2d m_work2[m_n_work][m_Nq]
virtual void nodal_parameter_values(const fem::Q1Element3 &element, Parameters **P, int i, int j, int *node_type, double *bottom, double *thickness, double *surface, double *sea_level) const
void set_initial_guess(const array::Array3D &u_sigma, const array::Array3D &v_sigma)
Shallow stress balance (such as the SSA).
const int n_chi
Number of shape functions on a Q1 element.
static double K(double psi_x, double psi_y, double speed, double epsilon)
static double F(double SL, double B, double H, double alpha)
PetscInt mg_coarse_ksp_it
SNESConvergedReason snes_reason
KSPConvergedReason ksp_reason