22 #include "pism/util/error_handling.hh"
27 const std::string &my_prefix,
28 double dx,
double dy,
double dt,
36 size_t Mz =
m_z.size();
74 for (
unsigned int k = 0;
k <
m_ks;
k++) {
122 S.solve(
m_ks + 1, x);
125 e.
add_context(
"solving the tri-diagonal system (AgeColumnSystem) at (%d, %d)\n"
126 "saving system to m-file... ",
m_i,
m_j);
133 for (
unsigned int k =
m_ks + 1;
k < x.size();
k++) {
std::vector< double > m_A_s
std::vector< double > m_A_n
std::vector< double > m_A_w
std::vector< double > m_A_e
std::vector< double > m_A
const IceModelVec3 & m_age3
void init(int i, int j, double thickness)
AgeColumnSystem(const std::vector< double > &storage_grid, const std::string &my_prefix, double dx, double dy, double dt, const IceModelVec3 &age, const IceModelVec3 &u3, const IceModelVec3 &v3, const IceModelVec3 &w3)
void solve(std::vector< double > &x)
First-order upwind scheme with implicit in the vertical: one column solve.
A virtual class collecting methods common to ice and bedrock 3D fields.
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.
const IceModelVec3 & m_u3
pointers to 3D velocity components
const IceModelVec3 & m_w3
void reportColumnZeroPivotErrorMFile(unsigned int M)
Write system matrix and right-hand-side into an Python script. The file name contains ZERO_PIVOT_ERRO...
void coarse_to_fine(const IceModelVec3 &coarse, int i, int j, double *fine) const
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
void init_column(int i, int j, double ice_thickness)
const IceModelVec3 & 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.
static double S(unsigned n)