19#ifndef PISM_SSATESTCASE_H
20#define PISM_SSATESTCASE_H
22#include "pism/stressbalance/ssa/SSA.hh"
23#include "pism/geometry/Geometry.hh"
24#include "pism/util/array/Array3D.hh"
25#include "pism/util/array/Scalar.hh"
26#include "pism/util/array/Vector.hh"
34namespace stressbalance {
65 virtual void report(
const std::string &testname);
67 virtual void write(
const std::string &filename);
69 static std::shared_ptr<Grid>
grid(std::shared_ptr<Context> ctx,
int Mx,
int My,
double Lx,
double Ly,
71 return Grid::Shallow(ctx, Lx, Ly, 0.0, 0.0, Mx, My, registration, periodicity);
69 static std::shared_ptr<Grid>
grid(std::shared_ptr<Context> ctx,
int Mx,
int My,
double Lx,
double Ly, {
…}
74 static std::shared_ptr<SSA>
solver(std::shared_ptr<Grid> grid,
const std::string &method);
84 double x,
double y,
double *u,
double *v);
94 std::shared_ptr<const pism::Grid>
m_grid;
96 const std::shared_ptr<const Context>
m_ctx;
std::shared_ptr< const Config > ConstPtr
static std::shared_ptr< Grid > Shallow(std::shared_ptr< const Context > ctx, double Lx, double Ly, double x0, double y0, unsigned int Mx, unsigned int My, grid::Registration r, grid::Periodicity p)
Initialize a uniform, shallow (3 z-levels) grid with half-widths (Lx,Ly) and Mx by My nodes.
A virtual class collecting methods common to ice and bedrock 3D fields.
std::shared_ptr< const pism::Grid > m_grid
virtual void init()
Initialize the test case at the start of a run.
const units::System::Ptr m_sys
array::Array3D m_ice_enthalpy
virtual ~SSATestCase()=default
virtual void initializeSSACoefficients()=0
Set up the coefficient variables as appropriate for the test case.
void report_netcdf(const std::string &testname, double max_vector, double rel_vector, double max_u, double max_v, double avg_u, double avg_v)
static std::shared_ptr< Grid > grid(std::shared_ptr< Context > ctx, int Mx, int My, double Lx, double Ly, grid::Registration registration, grid::Periodicity periodicity)
array::Vector2 m_bc_values
virtual void exactSolution(int i, int j, double x, double y, double *u, double *v)
static std::shared_ptr< SSA > solver(std::shared_ptr< Grid > grid, const std::string &method)
virtual void report(const std::string &testname)
Report on the generated solution.
virtual void run()
Solve the SSA.
const Config::ConstPtr m_config
std::shared_ptr< SSA > m_ssa
virtual void write(const std::string &filename)
Save the computation and data to a file.
const std::shared_ptr< const Context > m_ctx
std::shared_ptr< System > Ptr