tBedrockColumn.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
---
tBedrockColumn.hh (1997B)
---
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 #ifndef BEDROCK_COLUMN_HH
20 #define BEDROCK_COLUMN_HH
21
22 #include "pism/util/ColumnSystem.hh"
23
24 namespace pism {
25
26 class Config;
27
28 namespace energy {
29
30 /*! Tridiagonal linear system for conservation of energy in vertical columns of the
31 * bedrock thermal layer.
32 *
33 * The top surface uses the Dirichlet boundary condition, the bottom surface a heat flux
34 * (Neumann) BC.
35 *
36 * The implementation uses a second-order discretization in space and the backward-Euler
37 * (first-order, fully implicit) time-discretization.
38 */
39 class BedrockColumn {
40 public:
41 BedrockColumn(const std::string &prefix, const Config &config,
42 double dz, unsigned int M);
43 ~BedrockColumn();
44
45 void solve(double dt, double Q_bottom, double T_top,
46 const double *T_old, double *result);
47
48 void solve(double dt, double Q_bottom, double T_top,
49 const std::vector<double> &T_old,
50 std::vector<double> &result);
51
52 private:
53 // temperature diffusivity coefficient
54 double m_D;
55 // thermal conductivity
56 double m_k;
57 // vertical spacing
58 double m_dz;
59 // system size
60 unsigned int m_M;
61
62 TridiagonalSystem m_system;
63 };
64
65 } // end of namespace energy
66 } // end of namespace pism
67
68 #endif // ifndef BEDROCK_COLUMN_HH