PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
Isochrones.hh
Go to the documentation of this file.
1 /* Copyright (C) 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/util/Component.hh"
21 #include <memory>
22 #include <vector>
23 
24 namespace pism {
25 
26 namespace array {
27 class Array3D;
28 class Scalar;
29 } // namespace array
30 
31 namespace stressbalance {
32 class StressBalance;
33 }
34 
35 /*!
36  * The isochrone tracing scheme of [@ref Born2016] and [@ref Born2021].
37  */
38 class Isochrones : public Component {
39 public:
40  Isochrones(std::shared_ptr<const Grid> grid,
41  std::shared_ptr<const stressbalance::StressBalance> stress_balance);
42  virtual ~Isochrones() = default;
43 
44  void bootstrap(const array::Scalar &ice_thickness);
45 
46  void restart(const File &input_file, int record);
47 
48  void update(double t, double dt,
49  const array::Array3D &u,
50  const array::Array3D &v,
51  const array::Scalar &ice_thickness,
52  const array::Scalar &top_surface_mass_balance,
53  const array::Scalar &bottom_surface_mass_balance);
54 
55  const array::Array3D& layer_thicknesses() const;
56 
57 private:
58  MaxTimestep max_timestep_impl(double t) const;
59 
62 
63  void define_model_state_impl(const File &output) const;
64  void write_model_state_impl(const File &output) const;
65 
66  double top_layer_deposition_time() const;
67 
69 
70  void initialize(const File &input_file, int record, bool use_interpolation);
71 
72  //! isochronal layer thicknesses
73  std::shared_ptr<array::Array3D> m_layer_thickness;
74 
75  //! temporary storage needed for time stepping
76  std::shared_ptr<array::Array3D> m_tmp;
77 
78  //! The index of the topmost isochronal layer.
80 
81  std::shared_ptr<const stressbalance::StressBalance> m_stress_balance;
82 };
83 
84 } // end of namespace pism
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
std::shared_ptr< array::Array3D > m_layer_thickness
isochronal layer thicknesses
Definition: Isochrones.hh:73
void bootstrap(const array::Scalar &ice_thickness)
Definition: Isochrones.cc:382
MaxTimestep max_timestep_deposition_times(double t) const
Definition: Isochrones.cc:751
void update(double t, double dt, const array::Array3D &u, const array::Array3D &v, const array::Scalar &ice_thickness, const array::Scalar &top_surface_mass_balance, const array::Scalar &bottom_surface_mass_balance)
Definition: Isochrones.cc:557
MaxTimestep max_timestep_impl(double t) const
Definition: Isochrones.cc:731
std::shared_ptr< array::Array3D > m_tmp
temporary storage needed for time stepping
Definition: Isochrones.hh:76
void write_model_state_impl(const File &output) const
Definition: Isochrones.cc:788
std::shared_ptr< const stressbalance::StressBalance > m_stress_balance
Definition: Isochrones.hh:81
Isochrones(std::shared_ptr< const Grid > grid, std::shared_ptr< const stressbalance::StressBalance > stress_balance)
Definition: Isochrones.cc:357
DiagnosticList diagnostics_impl() const
Definition: Isochrones.cc:852
size_t m_top_layer_index
The index of the topmost isochronal layer.
Definition: Isochrones.hh:79
double top_layer_deposition_time() const
void define_model_state_impl(const File &output) const
Definition: Isochrones.cc:781
void restart(const File &input_file, int record)
Definition: Isochrones.cc:531
virtual ~Isochrones()=default
const array::Array3D & layer_thicknesses() const
Definition: Isochrones.cc:792
void initialize(const File &input_file, int record, bool use_interpolation)
Definition: Isochrones.cc:482
MaxTimestep max_timestep_cfl() const
Definition: Isochrones.cc:735
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
The class defining PISM's interface to the shallow stress balance code.
std::map< std::string, Diagnostic::Ptr > DiagnosticList
Definition: Diagnostic.hh:125