tLingleClark.hh - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
HTML git clone git://src.adamsgaard.dk/pism
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
tLingleClark.hh (3668B)
---
1 /* Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2019 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 _PBLINGLECLARK_H_
21 #define _PBLINGLECLARK_H_
22
23 #include <memory> // std::unique_ptr
24
25 #include "BedDef.hh"
26
27 namespace pism {
28 namespace bed {
29
30 class LingleClarkSerial;
31
32 //! A wrapper class around LingleClarkSerial.
33 class LingleClark : public BedDef {
34 public:
35 LingleClark(IceGrid::ConstPtr g);
36 virtual ~LingleClark();
37
38 const IceModelVec2S& total_displacement() const;
39
40 const IceModelVec2S& viscous_displacement() const;
41
42 const IceModelVec2S& elastic_displacement() const;
43
44 const IceModelVec2S& relief() const;
45
46 void step(const IceModelVec2S &ice_thickness,
47 const IceModelVec2S &sea_level_elevation,
48 double dt);
49
50 IceModelVec2S::Ptr elastic_load_response_matrix() const;
51 protected:
52 virtual void define_model_state_impl(const File &output) const;
53 virtual void write_model_state_impl(const File &output) const;
54
55 DiagnosticList diagnostics_impl() const;
56
57 MaxTimestep max_timestep_impl(double t) const;
58 void init_impl(const InputOptions &opts, const IceModelVec2S &ice_thickness,
59 const IceModelVec2S &sea_level_elevation);
60 void bootstrap_impl(const IceModelVec2S &bed_elevation,
61 const IceModelVec2S &bed_uplift,
62 const IceModelVec2S &ice_thickness,
63 const IceModelVec2S &sea_level_elevation);
64 void update_impl(const IceModelVec2S &ice_thickness,
65 const IceModelVec2S &sea_level_elevation,
66 double t, double dt);
67
68 //! Total (viscous and elastic) bed displacement.
69 IceModelVec2S m_total_displacement;
70
71 //! Storage on rank zero. Used to pass the load to the serial deformation model and get
72 //! bed displacement back.
73 petsc::Vec::Ptr m_work0;
74
75 //! Bed relief relative to the bed displacement.
76 IceModelVec2S m_relief;
77
78 //! Ice-equivalent load thickness.
79 IceModelVec2S m_load_thickness;
80
81 //! Serial viscoelastic bed deformation model.
82 std::unique_ptr<LingleClarkSerial> m_serial_model;
83
84 //! extended grid for the viscous plate displacement
85 IceGrid::Ptr m_extended_grid;
86
87 //! Viscous displacement on the extended grid (part of the model state).
88 IceModelVec2S m_viscous_displacement;
89 //! rank 0 storage using the extended grid
90 petsc::Vec::Ptr m_viscous_displacement0;
91
92 //! Elastic bed displacement (part of the model state)
93 IceModelVec2S m_elastic_displacement;
94 //! rank 0 storage for the elastic displacement
95 petsc::Vec::Ptr m_elastic_displacement0;
96
97 //! time of the last bed deformation update
98 double m_t_last;
99 //! Update interval in seconds
100 double m_update_interval;
101 //! Temporal resolution to use when checking whether it's time to update
102 double m_t_eps;
103 //! Name of the variable used to store the last update time.
104 std::string m_time_name;
105 };
106
107 } // end of namespace bed
108 } // end of namespace pism
109
110 #endif /* _PBLINGLECLARK_H_ */