PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
tempSystem.hh
Go to the documentation of this file.
1 // Copyright (C) 2009--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 #ifndef __tempSystem_hh
20 #define __tempSystem_hh
21 
22 #include "pism/util/ColumnSystem.hh"
23 #include "pism/util/Mask.hh"
24 
25 namespace pism {
26 
27 namespace energy {
28 //! Tridiagonal linear system for vertical column of temperature-based conservation of energy problem.
29 /*!
30  Call sequence like this:
31  \code
32  tempSystemCtx foo;
33  foo.dx = ... // set public constants
34  foo.u = ... // set public pointers
35  foo.initAllColumns();
36  for (j in ownership) {
37  for (i in ownership) {
38  ks = ...
39  foo.setIndicesThisColumn(i,j,ks);
40  [COMPUTE OTHER PARAMS]
41  foo.setSchemeParamsThisColumn(mask,isMarginal,lambda);
42  foo.setSurfaceBoundaryValuesThisColumn(Ts);
43  foo.setBasalBoundaryValuesThisColumn(Ghf,Tshelfbase,Rb);
44  foo.solveThisColumn(x);
45  }
46  }
47  \endcode
48 */
50 public:
51  tempSystemCtx(const std::vector<double>& storage_grid,
52  const std::string &prefix,
53  double dx, double dy, double dt,
54  const Config &config,
55  const array::Array3D &T3,
56  const array::Array3D &u3,
57  const array::Array3D &v3,
58  const array::Array3D &w3,
59  const array::Array3D &strain_heating3);
60 
61  void initThisColumn(int i, int j, bool is_marginal, MaskValue new_mask, double ice_thickness);
62 
63  void setSurfaceBoundaryValuesThisColumn(double my_Ts);
64  void setBasalBoundaryValuesThisColumn(double my_G0, double my_Tshelfbase,
65  double my_Rb);
66 
67  void solveThisColumn(std::vector<double> &x);
68 
69  double lambda() const {
70  return m_lambda;
71  }
72 
73  double w(int k) {
74  return m_w[k];
75  }
76 protected:
79 
80  std::vector<double> m_T, m_strain_heating;
81  std::vector<double> m_T_n, m_T_e, m_T_s, m_T_w;
82 
86  double m_nu,
90 private:
91  bool
94 
95  double compute_lambda();
96 };
97 
98 } // end of namespace energy
99 } // end of namespace pism
100 
101 #endif /* __tempSystem_hh */
102 
A class for storing and accessing PISM configuration flags and parameters.
A virtual class collecting methods common to ice and bedrock 3D fields.
Definition: Array3D.hh:33
std::vector< double > m_w
w-component of the ice velocity
Base class for tridiagonal systems in the ice.
const array::Array3D & m_T3
Definition: tempSystem.hh:78
void initThisColumn(int i, int j, bool is_marginal, MaskValue new_mask, double ice_thickness)
Definition: tempSystem.cc:68
void setSurfaceBoundaryValuesThisColumn(double my_Ts)
Definition: tempSystem.cc:94
void solveThisColumn(std::vector< double > &x)
Definition: tempSystem.cc:125
std::vector< double > m_T_n
Definition: tempSystem.hh:81
std::vector< double > m_T_e
Definition: tempSystem.hh:81
const array::Array3D & m_strain_heating3
Definition: tempSystem.hh:78
std::vector< double > m_strain_heating
Definition: tempSystem.hh:80
tempSystemCtx(const std::vector< double > &storage_grid, const std::string &prefix, double dx, double dy, double dt, const Config &config, const array::Array3D &T3, const array::Array3D &u3, const array::Array3D &v3, const array::Array3D &w3, const array::Array3D &strain_heating3)
Definition: tempSystem.cc:30
void setBasalBoundaryValuesThisColumn(double my_G0, double my_Tshelfbase, double my_Rb)
Definition: tempSystem.cc:103
std::vector< double > m_T_s
Definition: tempSystem.hh:81
std::vector< double > m_T
Definition: tempSystem.hh:80
std::vector< double > m_T_w
Definition: tempSystem.hh:81
Tridiagonal linear system for vertical column of temperature-based conservation of energy problem.
Definition: tempSystem.hh:49
static const double k
Definition: exactTestP.cc:42
MaskValue
Definition: Mask.hh:30