22 #include "pism/stressbalance/ssa/SSA.hh"
23 #include "pism/util/fem/FEM.hh"
24 #include "pism/util/petscwrappers/SNES.hh"
25 #include "pism/util/TerminationReason.hh"
26 #include "pism/util/Mask.hh"
30 namespace stressbalance {
42 SSAFEM(std::shared_ptr<const Grid>
g);
83 double *hardness)
const;
100 double *nuH,
double *dnuH,
101 double *beta,
double *dbeta);
152 Vector2d const *
const *
const residual_global);
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.
Manages iterating over element indices.
The mapping from global to local degrees of freedom.
Q1 element with sides parallel to X and Y axes.
void compute_local_function(Vector2d const *const *const velocity, Vector2d **residual)
Implements the callback for computing the residual.
std::shared_ptr< TerminationReason > solve_with_reason(const Inputs &inputs)
void PointwiseNuHAndBeta(double thickness, double hardness, int mask, double tauc, const Vector2d &U, const Vector2d &U_x, const Vector2d &U_y, double *nuH, double *dnuH, double *beta, double *dbeta)
Compute the "(regularized effective viscosity) x (ice thickness)" and effective viscous bed strength ...
void quad_point_values(const fem::Element &Q, const Coefficients *x, int *mask, double *thickness, double *tauc, double *hardness) const
Compute quadrature point values of various coefficients given a quadrature Q and nodal values.
const array::Scalar * m_driving_stress_x
static PetscErrorCode function_callback(DMDALocalInfo *info, Vector2d const *const *const velocity, Vector2d **residual, CallbackData *fe)
SNES callbacks.
void cache_inputs(const Inputs &inputs)
Initialize stored data from the coefficients in the SSA. Called by SSAFEM::solve.
void compute_local_jacobian(Vector2d const *const *const velocity, Mat J)
Implements the callback for computing the Jacobian.
double m_beta_ice_free_bedrock
SSAFEM(std::shared_ptr< const Grid > g)
CallbackData m_callback_data
virtual ~SSAFEM()=default
array::Vector1 m_boundary_integral
Boundary integral (CFBC contribution to the residual).
void monitor_jacobian(Mat Jac)
void explicit_driving_stress(const fem::Element &E, const Coefficients *x, Vector2d *driving_stress) const
static PetscErrorCode jacobian_callback(DMDALocalInfo *info, Vector2d const *const *const xg, Mat A, Mat J, CallbackData *fe)
virtual void solve(const Inputs &inputs)
fem::Q1Element2 m_q1_element
virtual void init_impl()
Initialize a generic regular-grid SSA solver.
std::shared_ptr< TerminationReason > solve_nocache()
void cache_residual_cfbc(const Inputs &inputs)
Compute and cache residual contributions from the integral over the lateral boundary.
fem::ElementIterator m_element_index
const array::Scalar * m_driving_stress_y
void monitor_function(Vector2d const *const *const velocity_global, Vector2d const *const *const residual_global)
array::Scalar1 m_node_type
Storage for node types (interior, boundary, exterior).
array::Vector1 m_bc_values
array::Array2D< Coefficients > m_coefficients
PISM's SSA solver: the finite element method implementation written by Jed and David.
const array::Vector & driving_stress() const
const array::Vector1 & velocity() const
Get the thickness-advective 2D velocity.
SSA * SSAFEMFactory(std::shared_ptr< const Grid > g)
Factory function for constructing a new SSAFEM.
Adaptor for gluing SNESDAFormFunction callbacks to an SSAFEM.
double thickness
ice thickness
double tauc
basal yield stress
double sea_level
sea level
Vector2d driving_stress
prescribed gravitational driving stress
double hardness
ice hardness