19#include "pism/stressbalance/ssa/SSA.hh"
20#include "pism/util/EnthalpyConverter.hh"
21#include "pism/rheology/FlowLawFactory.hh"
22#include "pism/util/Mask.hh"
23#include "pism/util/error_handling.hh"
24#include "pism/util/io/File.hh"
25#include "pism/util/array/CellType.hh"
26#include "pism/stressbalance/StressBalance.hh"
27#include "pism/geometry/Geometry.hh"
30namespace stressbalance {
49 if (my_min_thickness <= 0.0) {
71 m_velocity_global(m_grid,
"bar")
105 m_log->message(2,
"* Initializing the SSA stress balance...\n");
107 " [using the %s flow law]\n",
m_flow_law->name().c_str());
114 if (
m_config->get_flag(
"stress_balance.ssa.read_initial_guess")) {
118 unsigned int start = input_file.
nrecords() - 1;
120 if (u_ssa_found and v_ssa_found) {
121 m_log->message(3,
"Reading u_ssa and v_ssa...\n");
160 for (
auto p =
m_grid->points(); p; p.next()) {
161 const int i = p.i(), j = p.j();
176 velocity(i, j) = sum / std::max(N, 1);
#define ICE_GOLDSBY_KOHLSTEDT
const Config::ConstPtr m_config
configuration database used by this component
const Logger::ConstPtr m_log
logger (for easy access)
const std::shared_ptr< const Grid > m_grid
grid used by this component
double get_number(const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
A class for storing and accessing PISM configuration flags and parameters.
unsigned int nrecords() const
Get the number of records. Uses the length of an unlimited dimension.
bool variable_exists(const std::string &short_name) const
Checks if a variable exists.
High-level PISM I/O class.
array::CellType2 cell_type
static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf
build a RuntimeError with a formatted message
This class represents a 2D vector field (such as ice velocity) at a certain grid point.
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
stencils::Star< T > star(int i, int j) const
void read(const std::string &filename, unsigned int time)
void define(const File &file, io::Type default_type) const
Define variables corresponding to an Array in a file opened using file.
void write(const std::string &filename) const
void set(double c)
Result: v[j] <- c for all j.
void update_ghosts()
Updates ghost points.
SpatialVariableMetadata & metadata(unsigned int N=0)
Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.
bool next_to_ice(int i, int j) const
Ice-free margin (at least one of four neighbors has ice).
stencils::Star< int > star_int(int i, int j) const
bool ice_free(int i, int j) const
std::shared_ptr< FlowLaw > create()
void remove(const std::string &name)
double get_notional_strength() const
Returns strength = (viscosity times thickness).
void set_min_thickness(double my_min_thickness)
Set minimum thickness to trigger use of extension.
SSAStrengthExtension(const Config &c)
double get_min_thickness() const
Returns minimum thickness to trigger use of extension.
void set_notional_strength(double my_nuH)
Set strength = (viscosity times thickness).
Gives an extension coefficient to maintain ellipticity of SSA where ice is thin.
virtual void update(const Inputs &inputs, bool full_update)
Update the SSA solution.
virtual void solve(const Inputs &inputs)=0
SSA(std::shared_ptr< const Grid > g)
void extrapolate_velocity(const array::CellType1 &cell_type, array::Vector1 &velocity) const
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
SSAStrengthExtension * strength_extension
virtual std::string stdout_report() const
Produce a report string for the standard output.
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
virtual void init_impl()
Initialize a generic regular-grid SSA solver.
const array::Vector1 & velocity() const
Get the thickness-advective 2D velocity.
void compute_basal_frictional_heating(const array::Vector &velocity, const array::Scalar &tauc, const array::CellType &mask, array::Scalar &result) const
Compute the basal frictional heating.
array::Scalar m_basal_frictional_heating
double m_e_factor
flow enhancement factor
std::shared_ptr< rheology::FlowLaw > m_flow_law
EnthalpyConverter::Ptr m_EC
array::Vector2 m_velocity
Shallow stress balance (such as the SSA).
#define PISM_ERROR_LOCATION
@ PISM_READONLY
open an existing file for reading only
bool icy(int M)
Ice-filled cell (grounded or floating).
InputOptions process_input_options(MPI_Comm com, Config::ConstPtr config)