PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
AgeModel.hh
Go to the documentation of this file.
1 /* Copyright (C) 2016, 2017, 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 #ifndef AGEMODEL_H
21 #define AGEMODEL_H
22 
23 #include "pism/util/Component.hh"
24 #include "pism/stressbalance/StressBalance.hh"
25 #include <memory>
26 
27 namespace pism {
28 
30 public:
33  const array::Array3D *u3,
34  const array::Array3D *v3,
35  const array::Array3D *w3);
36  void check() const;
37 
42 };
43 
44 class AgeModel : public Component {
45 public:
46  AgeModel(std::shared_ptr<const Grid> grid,
47  std::shared_ptr<const stressbalance::StressBalance> stress_balance);
48 
49  void update(double t, double dt, const AgeModelInputs &inputs);
50 
51  void init(const InputOptions &opts);
52 
53  const array::Array3D & age() const;
54 protected:
55  MaxTimestep max_timestep_impl(double t) const;
56  void define_model_state_impl(const File &output) const;
57  void write_model_state_impl(const File &output) const;
58 
61  std::shared_ptr<const stressbalance::StressBalance> m_stress_balance;
62 };
63 
64 } // end of namespace pism
65 
66 
67 #endif /* AGEMODEL_H */
const array::Array3D * w3
Definition: AgeModel.hh:41
void check() const
Definition: AgeModel.cc:50
const array::Array3D * v3
Definition: AgeModel.hh:40
const array::Array3D * u3
Definition: AgeModel.hh:39
const array::Scalar * ice_thickness
Definition: AgeModel.hh:38
void define_model_state_impl(const File &output) const
The default (empty implementation).
Definition: AgeModel.cc:214
array::Array3D m_ice_age
Definition: AgeModel.hh:59
AgeModel(std::shared_ptr< const Grid > grid, std::shared_ptr< const stressbalance::StressBalance > stress_balance)
Definition: AgeModel.cc:57
std::shared_ptr< const stressbalance::StressBalance > m_stress_balance
Definition: AgeModel.hh:61
array::Array3D m_work
Definition: AgeModel.hh:60
MaxTimestep max_timestep_impl(double t) const
Definition: AgeModel.cc:176
const array::Array3D & age() const
Definition: AgeModel.cc:172
void write_model_state_impl(const File &output) const
The default (empty implementation).
Definition: AgeModel.cc:218
void init(const InputOptions &opts)
Definition: AgeModel.cc:187
void update(double t, double dt, const AgeModelInputs &inputs)
Definition: AgeModel.cc:108
std::shared_ptr< const Grid > grid() const
Definition: Component.cc:105
A class defining a common interface for most PISM sub-models.
Definition: Component.hh:118
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
A virtual class collecting methods common to ice and bedrock 3D fields.
Definition: Array3D.hh:33