20 #include "pism/age/AgeColumnSystem.hh"
21 #include "pism/util/error_handling.hh"
26 const std::string &my_prefix,
27 double dx,
double dy,
double dt,
35 size_t Mz =
m_z.size();
73 for (
unsigned int k = 0;
k <
m_ks;
k++) {
121 S.solve(
m_ks + 1, x);
124 e.
add_context(
"solving the tri-diagonal system (AgeColumnSystem) at (%d, %d)\n"
125 "saving system to m-file... ",
m_i,
m_j);
132 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
AgeColumnSystem(const std::vector< double > &storage_grid, const std::string &my_prefix, double dx, double dy, double dt, const array::Array3D &age, const array::Array3D &u3, const array::Array3D &v3, const array::Array3D &w3)
std::vector< double > m_A_e
std::vector< double > m_A
void init(int i, int j, double thickness)
const array::Array3D & m_age3
void solve(std::vector< double > &x)
First-order upwind scheme with implicit in the vertical: one column solve.
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.
static double S(unsigned n)