22 #include "pism/energy/tempSystem.hh"
23 #include "pism/util/Mask.hh"
25 #include "pism/util/error_handling.hh"
31 const std::string &prefix,
32 double dx,
double dy,
double dt,
41 m_strain_heating3(strain_heating3) {
47 size_t Mz =
m_z.size();
69 double ice_thickness) {
104 double my_Tshelfbase,
double my_Rb) {
116 const double epsilon = 1e-6 / 3.15569259747e7;
118 for (
unsigned int k = 0;
k <=
m_ks;
k++) {
172 S.RHS(0) -=
m_dt * (0.5 * (UpTu + UpTv));
189 for (
unsigned int k = 1;
k <
m_ks;
k++) {
235 S.solve(
m_ks + 1, x);
238 e.
add_context(
"solving the tri-diagonal system (tempSystemCtx) at (%d,%d)\n"
239 "saving system to m-file... ",
m_i,
m_j);
double get_number(const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
A class for storing and accessing PISM configuration flags and parameters.
void add_context(const std::string &message)
Add a message providing some context. This way we can (sort of) get a stack trace even though C++ exc...
Virtual base class. Abstracts a tridiagonal system to solve in a column of ice and/or bedrock.
A virtual class collecting methods common to ice and bedrock 3D fields.
const array::Array3D & m_w3
void coarse_to_fine(const array::Array3D &coarse, int i, int j, double *fine) const
void reportColumnZeroPivotErrorMFile(unsigned int M)
Write system matrix and right-hand-side into an Python script. The file name contains ZERO_PIVOT_ERRO...
std::vector< double > m_z
levels of the fine vertical grid
unsigned int m_ks
current system size; corresponds to the highest vertical level within the ice
std::vector< double > m_u
u-component of the ice velocity
const array::Array3D & m_u3
pointers to 3D velocity components
void init_column(int i, int j, double ice_thickness)
const array::Array3D & m_v3
int m_i
current column indexes
TridiagonalSystem * m_solver
std::vector< double > m_w
w-component of the ice velocity
std::vector< double > m_v
v-component of the ice velocity
Base class for tridiagonal systems in the ice.
const array::Array3D & m_T3
void initThisColumn(int i, int j, bool is_marginal, MaskValue new_mask, double ice_thickness)
void setSurfaceBoundaryValuesThisColumn(double my_Ts)
void solveThisColumn(std::vector< double > &x)
std::vector< double > m_T_n
std::vector< double > m_T_e
const array::Array3D & m_strain_heating3
std::vector< double > m_strain_heating
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)
void setBasalBoundaryValuesThisColumn(double my_G0, double my_Tshelfbase, double my_Rb)
std::vector< double > m_T_s
std::vector< double > m_T
std::vector< double > m_T_w
double min(const array::Scalar &input)
Finds minimum over all the values in an array::Scalar object. Ignores ghosts.
bool ocean(int M)
An ocean cell (floating ice or ice-free).
static double S(unsigned n)