PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
SteadyState.hh
Go to the documentation of this file.
1/* Copyright (C) 2019, 2025 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> spatial_diagnostics_impl() const;
53
54 MaxTimestep max_timestep_impl(double t) const;
55
56 std::set<VariableMetadata> state_impl() const;
57 void write_state_impl(const OutputFile &output) const;
58
59 std::shared_ptr<EmptyingProblem> m_emptying_problem;
60
61 //! time of the last water flux update
62 double m_t_last;
63 //! Update interval in seconds
65 //! Temporal resolution to use when checking whether it's time to update
66 double m_t_eps;
67
68 //! Name of the variable used to store the last update time
69 std::string m_time_name;
70
71 //! Times corresponding to records in the input file
72 std::vector<double> m_time;
73 //! Time bounds corresponding to records in the input file
74 std::vector<double> m_time_bounds;
75
76 //! Set to true in bootstrap_impl() if update_impl() has to bootstrap m_Q.
78};
79
80} // end of namespace hydrology
81} // end of namespace pism
82
83#endif /* STEADY_STATE_H */
High-level PISM I/O class.
Definition File.hh:57
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 write_state_impl(const OutputFile &output) const
The default (empty implementation).
void init_time(const std::string &input_file)
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::shared_ptr< EmptyingProblem > m_emptying_problem
std::map< std::string, Diagnostic::Ptr > spatial_diagnostics_impl() const
std::set< VariableMetadata > state_impl() const
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