22 #include "pism/stressbalance/ssa/SSA.hh"
24 #include "pism/util/error_handling.hh"
25 #include "pism/util/petscwrappers/Viewer.hh"
26 #include "pism/util/petscwrappers/KSP.hh"
27 #include "pism/util/petscwrappers/Mat.hh"
28 #include "pism/util/array/Staggered.hh"
31 namespace stressbalance {
37 SSAFD(std::shared_ptr<const Grid>
g);
53 double nuH_regularization,
54 double nuH_iter_failure_underrelax);
57 double nuH_regularization,
58 double nuH_iter_failure_underrelax);
67 double nuH_regularization,
74 double nuH_regularization,
81 bool include_basal_shear, Mat A);
89 virtual bool is_marginal(
int i,
int j,
bool ssa_dirichlet_bc);
A storage vector combining related fields in a struct.
A class for storing and accessing internal staggered-grid 2D fields. Uses dof=2 storage....
KSPFailure(const char *reason)
PicardFailure(const std::string &message)
virtual void compute_nuH_norm(double &norm, double &norm_change)
Compute the norm of nu H and the change in nu H.
SSAFD(std::shared_ptr< const Grid > g)
const array::Staggered & integrated_viscosity() const
virtual void init_impl()
Initialize a generic regular-grid SSA solver.
virtual void picard_strategy_regularization(const Inputs &inputs)
Old SSAFD recovery strategy: increase the SSA regularization parameter.
array::Array2D< Work > m_work
virtual void fracture_induced_softening(const array::Scalar *fracture_density)
Correct vertically-averaged hardness using a parameterization of the fracture-induced softening.
std::shared_ptr< petsc::Viewer > m_nuh_viewer
array::Staggered m_hardness
array::Vector1 m_velocity_old
virtual void update_nuH_viewers()
Update the nuH viewer, which shows log10(nu H).
virtual void compute_nuH_staggered_cfbc(const array::Scalar1 &ice_thickness, const array::CellType2 &mask, const array::Vector1 &velocity, const array::Staggered &hardness, double nuH_regularization, array::Staggered &result)
Compute the product of ice viscosity and thickness on the staggered grid. Used when CFBC is enabled.
virtual void compute_nuH_staggered(const array::Scalar1 &ice_thickness, const array::Vector1 &velocity, const array::Staggered &hardness, double nuH_regularization, array::Staggered &result)
Compute the product of ice thickness and effective viscosity (on the staggered grid).
virtual void solve(const Inputs &inputs)
Compute the vertically-averaged horizontal velocity from the shallow shelf approximation.
virtual void write_system_petsc(const std::string &namepart)
virtual DiagnosticList diagnostics_impl() const
unsigned int m_default_pc_failure_max_count
virtual void assemble_matrix(const Inputs &inputs, bool include_basal_shear, Mat A)
Assemble the left-hand side matrix for the KSP-based, Picard iteration, and finite difference impleme...
virtual void pc_setup_asm()
virtual bool is_marginal(int i, int j, bool ssa_dirichlet_bc)
Checks if a cell is near or at the ice front.
virtual void compute_hardav_staggered(const Inputs &inputs)
Computes vertically-averaged ice hardness on the staggered grid.
virtual void picard_iteration(const Inputs &inputs, double nuH_regularization, double nuH_iter_failure_underrelax)
virtual void picard_manager(const Inputs &inputs, double nuH_regularization, double nuH_iter_failure_underrelax)
Manages the Picard iteration loop.
virtual void pc_setup_bjacobi()
unsigned int m_default_pc_failure_count
array::Staggered1 m_nuH_old
virtual void assemble_rhs(const Inputs &inputs)
Computes the right-hand side ("rhs") of the linear problem for the Picard iteration and finite-differ...
PISM's SSA solver: the finite difference implementation.
const array::Vector1 & velocity() const
Get the thickness-advective 2D velocity.
SSA * SSAFDFactory(std::shared_ptr< const Grid > g)
Constructs a new SSAFD.
std::map< std::string, Diagnostic::Ptr > DiagnosticList