|
PISM, A Parallel Ice Sheet Model stable 0.4.1779
|
00001 // Copyright (C) 2009--2011 Ed Bueler, Constantine Khroulev and David Maxwell 00002 // 00003 // This file is part of PISM. 00004 // 00005 // PISM is free software; you can redistribute it and/or modify it under the 00006 // terms of the GNU General Public License as published by the Free Software 00007 // Foundation; either version 2 of the License, or (at your option) any later 00008 // version. 00009 // 00010 // PISM is distributed in the hope that it will be useful, but WITHOUT ANY 00011 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00013 // details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with PISM; if not, write to the Free Software 00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 #ifndef _SSATESTCASE_H_ 00020 #define _SSATESTCASE_H_ 00021 00022 #include "SSA.hh" 00023 00024 00025 00026 00029 PetscErrorCode init_shallow_grid(IceGrid &grid, 00030 PetscReal Lx, PetscReal Ly, 00031 PetscInt Mx, PetscInt My, Periodicity p); 00032 00033 00034 00057 class SSATestCase 00058 { 00059 public: 00060 SSATestCase( MPI_Comm com, PetscMPIInt rank, 00061 PetscMPIInt size, NCConfigVariable &c ): 00062 config(c), grid(com,rank,size,config), 00063 basal(0), ice(0), enthalpyconverter(0), ssa(0), 00064 report_velocity_scale(secpera) 00065 { }; 00066 00067 virtual ~SSATestCase() 00068 { 00069 delete basal; 00070 delete ice; 00071 delete enthalpyconverter; 00072 delete ssa; 00073 } 00074 00075 virtual PetscErrorCode init(PetscInt Mx, PetscInt My,SSAFactory ssafactory); 00076 00077 virtual PetscErrorCode run(); 00078 00079 virtual PetscErrorCode report(); 00080 00081 virtual PetscErrorCode write(const string &filename); 00082 00083 protected: 00084 00085 virtual PetscErrorCode buildSSACoefficients(); 00086 00088 virtual PetscErrorCode initializeGrid(PetscInt Mx,PetscInt My) = 0; 00089 00092 virtual PetscErrorCode initializeSSAModel() = 0; 00093 00095 virtual PetscErrorCode initializeSSACoefficients() = 0; 00096 00099 virtual PetscErrorCode exactSolution(PetscInt i, PetscInt j, 00100 PetscReal x, PetscReal y, PetscReal *u, PetscReal *v ); 00101 00102 NCConfigVariable &config; 00103 IceGrid grid; 00104 00105 // SSA model variables. 00106 IceBasalResistancePlasticLaw *basal; 00107 IceFlowLaw *ice; 00108 EnthalpyConverter *enthalpyconverter; 00109 00110 // SSA coefficient variables. 00111 PISMVars vars; 00112 IceModelVec2S surface, thickness, bed, tauc; 00113 IceModelVec3 enthalpy; 00114 IceModelVec2V vel_bc; 00115 IceModelVec2Int ice_mask, bc_mask; 00116 00117 SSA *ssa; 00118 00119 // Scale for converting velocities from their units during computation to human friendly units. 00120 00121 PetscScalar report_velocity_scale; 00122 00123 }; 00124 00125 #endif /* _SSATESTCASE_H_ */
1.7.3