PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
ConstantYieldStress.cc
Go to the documentation of this file.
1 // Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021, 2023 Constantine Khroulev
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 #include "pism/basalstrength/ConstantYieldStress.hh"
20 
21 #include "pism/util/ConfigInterface.hh"
22 #include "pism/util/Grid.hh"
23 #include "pism/util/MaxTimestep.hh"
24 
25 namespace pism {
26 
27 ConstantYieldStress::ConstantYieldStress(std::shared_ptr<const Grid> grid)
28  : YieldStress(grid) {
29 
30  m_name = "constant yield stress model";
31 }
32 
33 void ConstantYieldStress::restart_impl(const File &input_file, int record) {
34  m_basal_yield_stress.read(input_file, record);
35 
37 }
38 
40  const YieldStressInputs &inputs) {
41  (void) inputs;
42 
43  double tauc = m_config->get_number("basal_yield_stress.constant.value");
44  m_basal_yield_stress.regrid(input_file, io::Default(tauc));
45 
47 }
48 
50  (void) inputs;
51 
52  double tauc = m_config->get_number("basal_yield_stress.constant.value");
53  // Set the constant value.
55 
57 }
58 
60  (void) t;
61  return MaxTimestep(name());
62 }
63 
65  double t, double dt) {
66  (void) inputs;
67  (void) t;
68  (void) dt;
69  // empty
70 }
71 
72 } // end of namespace pism
const Config::ConstPtr m_config
configuration database used by this component
Definition: Component.hh:158
void regrid(const std::string &module_name, array::Array &variable, RegriddingFlag flag=NO_REGRID_WITHOUT_REGRID_VARS)
Definition: Component.cc:159
void bootstrap_impl(const File &input_file, const YieldStressInputs &inputs)
void restart_impl(const File &input_file, int record)
MaxTimestep max_timestep_impl(double t) const
void init_impl(const YieldStressInputs &inputs)
ConstantYieldStress(std::shared_ptr< const Grid > g)
void update_impl(const YieldStressInputs &inputs, double t, double dt)
High-level PISM I/O class.
Definition: File.hh:56
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Definition: MaxTimestep.hh:31
std::string m_name
Definition: YieldStress.hh:76
std::string name() const
Definition: YieldStress.cc:108
array::Scalar2 m_basal_yield_stress
Definition: YieldStress.hh:74
The PISM basal yield stress model interface (virtual base class)
Definition: YieldStress.hh:43
void read(const std::string &filename, unsigned int time)
Definition: Array.cc:809
void set(double c)
Result: v[j] <- c for all j.
Definition: Array.cc:707
void regrid(const std::string &filename, io::Default default_value)
Definition: Array.cc:814