|
PISM, A Parallel Ice Sheet Model stable 0.4.1779
|
#include <SSATestCase.hh>
Public Member Functions | |
| SSATestCase (MPI_Comm com, PetscMPIInt rank, PetscMPIInt size, NCConfigVariable &c) | |
| virtual | ~SSATestCase () |
| virtual PetscErrorCode | init (PetscInt Mx, PetscInt My, SSAFactory ssafactory) |
| Initialize the test case at the start of a run. | |
| virtual PetscErrorCode | run () |
| Solve the SSA. | |
| virtual PetscErrorCode | report () |
| Report on the generated solution. | |
| virtual PetscErrorCode | write (const string &filename) |
| Save the computation and data to a file. | |
Protected Member Functions | |
| virtual PetscErrorCode | buildSSACoefficients () |
| virtual PetscErrorCode | initializeGrid (PetscInt Mx, PetscInt My)=0 |
| Initialize the member variable grid as appropriate for the test case. | |
| virtual PetscErrorCode | initializeSSAModel ()=0 |
| virtual PetscErrorCode | initializeSSACoefficients ()=0 |
| Set up the coefficient variables as appropriate for the test case. | |
| virtual PetscErrorCode | exactSolution (PetscInt i, PetscInt j, PetscReal x, PetscReal y, PetscReal *u, PetscReal *v) |
Protected Attributes | |
| NCConfigVariable & | config |
| IceGrid | grid |
| IceBasalResistancePlasticLaw * | basal |
| IceFlowLaw * | ice |
| EnthalpyConverter * | enthalpyconverter |
| PISMVars | vars |
| IceModelVec2S | surface |
| IceModelVec2S | thickness |
| IceModelVec2S | bed |
| IceModelVec2S | tauc |
| IceModelVec3 | enthalpy |
| IceModelVec2V | vel_bc |
| IceModelVec2Int | ice_mask |
| IceModelVec2Int | bc_mask |
| SSA * | ssa |
| PetscScalar | report_velocity_scale |
An SSATestCase manages running an SSA instance against a particular test. Subclasses must implement the following abstract methods to define the input to an SSA for a test case:
1) initializeGrid (to build a grid of the specified size appropriate for the test) 2) initializeSSAModel (to specify the laws used by the model, e.g. ice flow and basal sliding laws) 3) initializeSSACoefficients (to initialize the ssa coefficients, e.g. ice thickness)
The SSA itself is constructed between steps 2) and 3).
Additionally, a subclass can implement report to handle printing statistics after a run. The default report method relies on subclasses implementing the exactSolution method for comparision.
A driver uses an SSATestCase by calling 1-3 below and 4,5 as desired:
1) its constructor 2) init (to specify the grid size and choice of SSA algorithm) 3) run (to actually solve the ssa) 4) report 5) write (to save the results of the computation to a file)
Definition at line 57 of file SSATestCase.hh.
| SSATestCase | ( | MPI_Comm | com, |
| PetscMPIInt | rank, | ||
| PetscMPIInt | size, | ||
| NCConfigVariable & | c | ||
| ) | [inline] |
Definition at line 60 of file SSATestCase.hh.
| virtual ~SSATestCase | ( | ) | [inline, virtual] |
Definition at line 67 of file SSATestCase.hh.
References basal, enthalpyconverter, ice, and ssa.
| PetscErrorCode buildSSACoefficients | ( | ) | [protected, virtual] |
| PetscErrorCode exactSolution | ( | PetscInt | i, |
| PetscInt | j, | ||
| PetscReal | x, | ||
| PetscReal | y, | ||
| PetscReal * | u, | ||
| PetscReal * | v | ||
| ) | [protected, virtual] |
Return the value of the exact solution at grid index (i,j) or equivalently at coordinates (x,y).
Definition at line 241 of file SSATestCase.cc.
| PetscErrorCode init | ( | PetscInt | Mx, |
| PetscInt | My, | ||
| SSAFactory | ssafactory | ||
| ) | [virtual] |
Initialize the test case at the start of a run.
Definition at line 122 of file SSATestCase.cc.
References basal, buildSSACoefficients(), config, enthalpyconverter, grid, ice, SSA::init(), initializeGrid(), initializeSSACoefficients(), initializeSSAModel(), ssa, and vars.
| virtual PetscErrorCode initializeGrid | ( | PetscInt | Mx, |
| PetscInt | My | ||
| ) | [protected, pure virtual] |
Initialize the member variable grid as appropriate for the test case.
Referenced by init().
| virtual PetscErrorCode initializeSSACoefficients | ( | ) | [protected, pure virtual] |
Set up the coefficient variables as appropriate for the test case.
Referenced by init().
| virtual PetscErrorCode initializeSSAModel | ( | ) | [protected, pure virtual] |
Allocate the member variables basal, ice, and enthalpyconverter as appropriate for the test case.
Referenced by init().
| PetscErrorCode report | ( | ) | [virtual] |
Report on the generated solution.
Definition at line 165 of file SSATestCase.cc.
References config, exactSolution(), ShallowStressBalance::get_advective_2d_velocity(), grid, report_velocity_scale, ssa, SSA::stdout_report(), and exactV::v().
| PetscErrorCode run | ( | ) | [virtual] |
Solve the SSA.
Definition at line 152 of file SSATestCase.cc.
References grid, ssa, and SSA::update().
| PetscErrorCode write | ( | const string & | filename | ) | [virtual] |
Save the computation and data to a file.
Definition at line 250 of file SSATestCase.cc.
References bc_mask, bed, enthalpy, exactSolution(), ShallowStressBalance::get_advective_2d_velocity(), grid, ssa, surface, tauc, thickness, exactV::v(), and vel_bc.
IceBasalResistancePlasticLaw* basal [protected] |
Definition at line 106 of file SSATestCase.hh.
Referenced by init(), and ~SSATestCase().
IceModelVec2Int bc_mask [protected] |
Definition at line 115 of file SSATestCase.hh.
Referenced by buildSSACoefficients(), and write().
IceModelVec2S bed [protected] |
Definition at line 112 of file SSATestCase.hh.
Referenced by buildSSACoefficients(), and write().
NCConfigVariable& config [protected] |
Definition at line 102 of file SSATestCase.hh.
IceModelVec3 enthalpy [protected] |
Definition at line 113 of file SSATestCase.hh.
Referenced by buildSSACoefficients(), and write().
EnthalpyConverter* enthalpyconverter [protected] |
Definition at line 108 of file SSATestCase.hh.
Referenced by init(), and ~SSATestCase().
IceGrid grid [protected] |
Definition at line 103 of file SSATestCase.hh.
Referenced by buildSSACoefficients(), init(), report(), run(), and write().
IceFlowLaw* ice [protected] |
Definition at line 107 of file SSATestCase.hh.
Referenced by init(), and ~SSATestCase().
IceModelVec2Int ice_mask [protected] |
Definition at line 115 of file SSATestCase.hh.
Referenced by buildSSACoefficients().
PetscScalar report_velocity_scale [protected] |
Definition at line 121 of file SSATestCase.hh.
Referenced by report().
Definition at line 117 of file SSATestCase.hh.
Referenced by init(), report(), run(), write(), and ~SSATestCase().
IceModelVec2S surface [protected] |
Definition at line 112 of file SSATestCase.hh.
Referenced by buildSSACoefficients(), and write().
IceModelVec2S tauc [protected] |
Definition at line 112 of file SSATestCase.hh.
Referenced by buildSSACoefficients(), and write().
IceModelVec2S thickness [protected] |
Definition at line 112 of file SSATestCase.hh.
Referenced by buildSSACoefficients(), and write().
PISMVars vars [protected] |
Definition at line 111 of file SSATestCase.hh.
Referenced by buildSSACoefficients(), and init().
IceModelVec2V vel_bc [protected] |
Definition at line 114 of file SSATestCase.hh.
Referenced by buildSSACoefficients(), and write().
1.7.3