PISM, A Parallel Ice Sheet Model 2.2.1-cd005eec8 committed by Constantine Khrulev on 2025-03-07
Loading...
Searching...
No Matches
SteadyState.hh
Go to the documentation of this file.
1/* Copyright (C) 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 STEADY_STATE_H
21#define STEADY_STATE_H
22
23#include "pism/hydrology/NullTransport.hh"
24
25namespace pism {
26namespace hydrology {
27
28class EmptyingProblem;
29
30/*!
31 * A version of the "null-transport" hydrology model that adds the steady state water
32 * flux.
33 */
34class SteadyState : public NullTransport {
35public:
36 SteadyState(std::shared_ptr<const Grid> g);
37 virtual ~SteadyState() = default;
38
39protected:
40 void initialization_message() const;
41
42 void init_time(const std::string &input_file);
43
44 void init_impl(const array::Scalar &W_till, const array::Scalar &W, const array::Scalar &P);
45
46 void bootstrap_impl(const File &input_file,
47 const array::Scalar &ice_thickness);
48 void restart_impl(const File &input_file, int record);
49
50 void update_impl(double t, double dt, const Inputs& inputs);
51
52 std::map<std::string, Diagnostic::Ptr> diagnostics_impl() const;
53
54 MaxTimestep max_timestep_impl(double t) const;
55 void define_model_state_impl(const File &output) const;
56 void write_model_state_impl(const File &output) const;
57
58 std::shared_ptr<EmptyingProblem> m_emptying_problem;
59
60 //! time of the last water flux update
61 double m_t_last;
62 //! Update interval in seconds
64 //! Temporal resolution to use when checking whether it's time to update
65 double m_t_eps;
66 //! Name of the variable used to store the last update time.
67 std::string m_time_name;
68
69 //! Times corresponding to records in the input file
70 std::vector<double> m_time;
71 //! Time bounds corresponding to records in the input file
72 std::vector<double> m_time_bounds;
73
74 //! Set to true in bootstrap_impl() if update_impl() has to bootstrap m_Q.
76};
77
78} // end of namespace hydrology
79} // end of namespace pism
80
81#endif /* STEADY_STATE_H */
High-level PISM I/O class.
Definition File.hh:55
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
double m_update_interval
Update interval in seconds.
virtual ~SteadyState()=default
void init_time(const std::string &input_file)
void write_model_state_impl(const File &output) const
The default (empty implementation).
double m_t_last
time of the last water flux update
void update_impl(double t, double dt, const Inputs &inputs)
Solves an implicit step of a highly-simplified ODE.
std::vector< double > m_time_bounds
Time bounds corresponding to records in the input file.
MaxTimestep max_timestep_impl(double t) const
std::string m_time_name
Name of the variable used to store the last update time.
void restart_impl(const File &input_file, int record)
bool m_bootstrap
Set to true in bootstrap_impl() if update_impl() has to bootstrap m_Q.
std::map< std::string, Diagnostic::Ptr > diagnostics_impl() const
std::shared_ptr< EmptyingProblem > m_emptying_problem
void define_model_state_impl(const File &output) const
The default (empty implementation).
std::vector< double > m_time
Times corresponding to records in the input file.
void initialization_message() const
void bootstrap_impl(const File &input_file, const array::Scalar &ice_thickness)
void init_impl(const array::Scalar &W_till, const array::Scalar &W, const array::Scalar &P)
double m_t_eps
Temporal resolution to use when checking whether it's time to update.
static const double g
Definition exactTestP.cc:36