|
PISM, A Parallel Ice Sheet Model stable 0.4.1779
|
00001 // Copyright (C) 2010, 2011 Constantine Khroulev 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 __PISMBedDef_hh 00020 #define __PISMBedDef_hh 00021 00022 #include "PISMComponent.hh" 00023 #include "iceModelVec.hh" 00024 #include "deformation.hh" 00025 00027 00030 class PISMBedDef : public PISMComponent_TS { 00031 public: 00032 PISMBedDef(IceGrid &g, const NCConfigVariable &conf); 00033 virtual ~PISMBedDef() {} 00034 virtual PetscErrorCode init(PISMVars &vars); 00035 virtual PetscErrorCode update(PetscReal t_years, PetscReal dt_years) = 0; 00036 virtual void add_vars_to_output(string /*keyword*/, set<string> &/*result*/); 00037 virtual PetscErrorCode define_variables(set<string> /*vars*/, const NCTool &/*nc*/, 00038 nc_type /*nctype*/); 00039 virtual PetscErrorCode write_variables(set<string> /*vars*/, string /*filename*/); 00040 protected: 00041 PetscErrorCode pismbeddef_allocate(); // packaged to simplify error checking 00042 PetscErrorCode compute_uplift(PetscScalar dt_beddef); 00043 PetscReal t_beddef_last; 00044 00045 IceModelVec2S topg_initial; 00046 IceModelVec2S topg_last; 00047 IceModelVec2S *thk, 00048 *topg, 00049 *uplift; 00050 }; 00051 00053 class PBPointwiseIsostasy : public PISMBedDef { 00054 public: 00055 PBPointwiseIsostasy(IceGrid &g, const NCConfigVariable &conf); 00056 virtual ~PBPointwiseIsostasy() {} 00057 virtual PetscErrorCode init(PISMVars &vars); 00058 virtual PetscErrorCode update(PetscReal t_years, PetscReal dt_years); 00059 protected: 00060 PetscErrorCode allocate(); 00061 IceModelVec2S thk_last; 00062 }; 00063 00064 #if (PISM_HAVE_FFTW==1) 00065 #include <fftw3.h> 00066 00068 class PBLingleClark : public PISMBedDef { 00069 public: 00070 PBLingleClark(IceGrid &g, const NCConfigVariable &conf); 00071 virtual ~PBLingleClark(); 00072 00073 PetscErrorCode init(PISMVars &vars); 00074 PetscErrorCode update(PetscReal t_years, PetscReal dt_years); 00075 protected: 00076 PetscErrorCode correct_topg(); 00077 PetscErrorCode allocate(); 00078 PetscErrorCode deallocate(); 00079 PetscErrorCode transfer_to_proc0(IceModelVec2S *source, Vec result); 00080 PetscErrorCode transfer_from_proc0(Vec source, IceModelVec2S *result); 00081 Vec g2, g2natural; 00082 VecScatter scatter; 00083 // Vecs on processor 0: 00084 Vec Hp0, 00085 bedp0, 00086 Hstartp0, 00087 bedstartp0, 00088 upliftp0; 00089 BedDeformLC bdLC; 00090 }; 00091 #endif // PISM_HAVE_FFTW 00092 00093 #endif // __PISMBedDef_hh
1.7.3