PISM, A Parallel Ice Sheet Model  stable v0.5
src/base/energy/tempSystem.hh
Go to the documentation of this file.
00001 // Copyright (C) 2009-2011 Ed Bueler
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 __tempSystem_hh
00020 #define __tempSystem_hh
00021 
00022 #include <petscsys.h>
00023 
00024 #include "columnSystem.hh"
00025 #include "pism_const.hh"
00026 
00027 class IceModelVec3;
00028 
00030 
00050 class tempSystemCtx : public columnSystemCtx {
00051 
00052 public:
00053   tempSystemCtx(PetscInt my_Mz, string my_prefix);
00054   PetscErrorCode initAllColumns();
00055   PetscErrorCode setSchemeParamsThisColumn(
00056                      PismMask my_mask, bool my_isMarginal, PetscScalar my_lambda);  
00057   PetscErrorCode setSurfaceBoundaryValuesThisColumn(PetscScalar my_Ts);
00058   PetscErrorCode setBasalBoundaryValuesThisColumn(
00059                      PetscScalar my_G0, PetscScalar my_Tshelfbase, PetscScalar my_Rb);
00060 
00061   PetscErrorCode solveThisColumn(PetscScalar **x, PetscErrorCode &pivoterrorindex);  
00062 
00063 public:
00064   // constants which should be set before calling initForAllColumns()
00065   PetscScalar  dx,
00066                dy,
00067                dtTemp,
00068                dzEQ,
00069                ice_rho,
00070                ice_c_p,
00071                ice_k;
00072   // pointers which should be set before calling initForAllColumns()
00073   PetscScalar  *T,
00074                *u,
00075                *v,
00076                *w,
00077                *Sigma;
00078   IceModelVec3 *T3;
00079 
00080 protected: // used internally
00081   PetscInt    Mz;
00082   PetscScalar lambda, Ts, G0, Tshelfbase, Rb;
00083   PismMask    mask;
00084   bool        isMarginal;
00085   PetscScalar nuEQ,
00086               rho_c_I,
00087               iceK,
00088               iceR;
00089   bool        initAllDone,
00090               indicesValid,
00091               schemeParamsValid,
00092               surfBCsValid,
00093               basalBCsValid;
00094 };
00095 
00096 #endif  /* __tempSystem_hh */
00097 
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines