20 #include "pism/frontretreat/calving/EigenCalving.hh"
22 #include "pism/util/Grid.hh"
23 #include "pism/util/error_handling.hh"
24 #include "pism/util/array/CellType.hh"
25 #include "pism/stressbalance/StressBalance.hh"
33 m_K =
m_config->get_number(
"calving.eigen_calving.K");
37 .
long_name(
"horizontal calving rate due to eigen-calving")
44 m_log->message(2,
"* Initializing the 'eigen-calving' mechanism...\n");
48 "dx = %f, dy = %f, relative difference = %f",
72 const double eigenCalvOffset = 0.0;
81 for (
auto pt =
m_grid->points(); pt; pt.next()) {
82 const int i = pt.i(), j = pt.j();
95 for (
int p = -1; p < 2; p += 2) {
96 const int I = i + p * offset;
104 for (
int q = -1; q < 2; q += 2) {
105 const int J = j + q * offset;
123 if (eigen2 > eigenCalvOffset and eigen1 > 0.0) {
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
static Ptr wrap(const T &input)
static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf
build a RuntimeError with a formatted message
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
void copy_from(const Array2D< T > &source)
unsigned int stencil_width() const
Get the stencil width of the current Array. Returns 0 if ghosts are not available.
SpatialVariableMetadata & metadata(unsigned int N=0)
Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.
bool ice_margin(int i, int j) const
Ice margin (ice-filled with at least one of four neighbors ice-free).
bool next_to_floating_ice(int i, int j) const
bool floating_ice(int i, int j) const
bool ice_free_ocean(int i, int j) const
"Cell type" mask. Adds convenience methods to array::Scalar.
void update(const array::CellType &cell_type, const array::Vector1 &ice_velocity)
Uses principal strain rates to apply "eigencalving" with constant K.
DiagnosticList diagnostics_impl() const
EigenCalving(std::shared_ptr< const Grid > grid)
const int m_stencil_width
array::Array2D< stressbalance::PrincipalStrainRates > m_strain_rates
array::Scalar m_calving_rate
array::CellType1 m_cell_type
An abstract class containing fields used by all stress-based calving methods.
#define PISM_ERROR_LOCATION
double max(const array::Scalar &input)
Finds maximum over all the values in an array::Scalar object. Ignores ghosts.
double min(const array::Scalar &input)
Finds minimum over all the values in an array::Scalar object. Ignores ghosts.
void compute_2D_principal_strain_rates(const array::Vector1 &V, const array::CellType1 &mask, array::Array2D< PrincipalStrainRates > &result)
Compute eigenvalues of the horizontal, vertically-integrated strain rate tensor.
std::map< std::string, Diagnostic::Ptr > DiagnosticList