Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
YieldStress.cc
Go to the documentation of this file.
1/* Copyright (C) 2015, 2016, 2017, 2018, 2019, 2021, 2022, 2023 PISM Authors
2 *
3 * This file is part of PISM.
4 *
5 * PISM is free software; you can redistribute it and/or modify it under the
6 * terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * PISM is distributed in the hope that it will be useful, but WITHOUT ANY
11 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with PISM; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include "pism/basalstrength/YieldStress.hh"
21
22#include "pism/util/ConfigInterface.hh"
23#include "pism/util/Logger.hh"
24
25namespace pism {
26
33
34YieldStress::YieldStress(std::shared_ptr<const Grid> g)
35 : Component(g),
36 m_basal_yield_stress(m_grid, "tauc") {
37
38 // PROPOSED standard_name = land_ice_basal_material_yield_stress
40 .long_name("yield stress for basal till (plastic or pseudo-plastic model)")
41 .units("Pa");
42}
43
44/*!
45 * Restart a yield stress model from an input file.
46 */
47void YieldStress::restart(const File &input_file, int record) {
48 m_log->message(2, "* Initializing the %s...\n", name().c_str());
49
50 this->restart_impl(input_file, record);
51}
52
53/*!
54 * Bootstrap a yield stress model using incomplete inputs.
55 */
56void YieldStress::bootstrap(const File &input_file, const YieldStressInputs &inputs) {
57 m_log->message(2, "Initializing the %s...\n", name().c_str());
58
59 this->bootstrap_impl(input_file, inputs);
60}
61
62/*!
63 * Initialize a yield stress model using inputs from other models and configuration
64 * parameters.
65 */
67 m_log->message(2, "Initializing the %s...\n", name().c_str());
68
69 this->init_impl(inputs);
70}
71
72/*!
73 * Update a yield stress model.
74 */
75void YieldStress::update(const YieldStressInputs &inputs, double t, double dt) {
76 this->update_impl(inputs, t, dt);
77}
78
82
83/*!
84 * Define model state variables.
85 *
86 * All yield stress models have to write basal yield stress to output files and read it
87 * from and input file during initialization because yield stress may be used by PISM's
88 * stress balance model. The stress balance code has to be executed early during an update
89 * of the model because its output (ice velocity) is used to compute the maximum allowed
90 * time step.
91 *
92 * Now that PISM's yield stress models are time-dependent YieldStress::update() will be
93 * called *after* the maximum time step is found. This means that during the first time
94 * step basal_material_yield_stress() gets called before update().
95 */
99
100void YieldStress::write_model_state_impl(const File &output) const {
102}
103
107
108std::string YieldStress::name() const {
109 return m_name;
110}
111
112} // end of namespace pism
const Logger::ConstPtr m_log
logger (for easy access)
Definition Component.hh:162
A class defining a common interface for most PISM sub-models.
Definition Component.hh:118
static Ptr wrap(const T &input)
High-level PISM I/O class.
Definition File.hh:55
VariableMetadata & long_name(const std::string &input)
VariableMetadata & units(const std::string &input)
const array::Scalar * till_water_thickness
const array::Scalar * subglacial_water_thickness
const Geometry * geometry
const array::Scalar * no_model_mask
std::string m_name
YieldStress(std::shared_ptr< const Grid > g)
void bootstrap(const File &input_file, const YieldStressInputs &inputs)
virtual void init_impl(const YieldStressInputs &inputs)=0
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
const array::Scalar & basal_material_yield_stress()
void update(const YieldStressInputs &inputs, double t, double dt)
virtual void restart_impl(const File &input_file, int record)=0
std::string name() const
DiagnosticList diagnostics_impl() const
virtual void bootstrap_impl(const File &input_file, const YieldStressInputs &inputs)=0
void init(const YieldStressInputs &inputs)
virtual void define_model_state_impl(const File &output) const
array::Scalar2 m_basal_yield_stress
void restart(const File &input_file, int record)
virtual void update_impl(const YieldStressInputs &inputs, double t, double dt)=0
void define(const File &file, io::Type default_type) const
Define variables corresponding to an Array in a file opened using file.
Definition Array.cc:463
void write(const std::string &filename) const
Definition Array.cc:722
SpatialVariableMetadata & metadata(unsigned int N=0)
Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.
Definition Array.cc:476
@ PISM_DOUBLE
Definition IO_Flags.hh:52
static const double g
Definition exactTestP.cc:36
std::map< std::string, Diagnostic::Ptr > DiagnosticList