PISM, A Parallel Ice Sheet Model stable 0.4.1779
Public Member Functions | Protected Member Functions | Protected Attributes

SSATestCase Class Reference

#include <SSATestCase.hh>

List of all members.

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
IceBasalResistancePlasticLawbasal
IceFlowLawice
EnthalpyConverterenthalpyconverter
PISMVars vars
IceModelVec2S surface
IceModelVec2S thickness
IceModelVec2S bed
IceModelVec2S tauc
IceModelVec3 enthalpy
IceModelVec2V vel_bc
IceModelVec2Int ice_mask
IceModelVec2Int bc_mask
SSAssa
PetscScalar report_velocity_scale

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

PetscErrorCode buildSSACoefficients ( ) [protected, virtual]

Initialize the storage for the various coefficients used as input to the SSA (ice elevation, thickness, etc.)

Definition at line 28 of file SSATestCase.cc.

References bc_mask, bed, enthalpy, grid, ice_mask, surface, tauc, thickness, vars, and vel_bc.

Referenced by init().

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.

Referenced by report(), and write().

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]
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.


Member Data Documentation

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.

Referenced by init(), and report().

IceModelVec3 enthalpy [protected]

Definition at line 113 of file SSATestCase.hh.

Referenced by buildSSACoefficients(), and write().

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().

SSA* ssa [protected]

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines