|
PISM, A Parallel Ice Sheet Model stable 0.4.1779
|
00001 // Copyright (C) 2010, 2011 Ed Bueler and 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 __PISMBedSmoother_hh 00020 #define __PISMBedSmoother_hh 00021 00022 #include <petsc.h> 00023 #include "NCVariable.hh" 00024 #include "grid.hh" 00025 #include "iceModelVec.hh" 00026 00028 00072 class PISMBedSmoother { 00073 public: 00074 PISMBedSmoother(IceGrid &g, const NCConfigVariable &conf, PetscInt MAX_GHOSTS); 00075 virtual ~PISMBedSmoother(); 00076 00077 virtual PetscErrorCode preprocess_bed(IceModelVec2S topg, PetscReal n, 00078 PetscReal lambda); 00079 virtual PetscErrorCode preprocess_bed(IceModelVec2S topg, PetscReal n, 00080 PetscInt Nx_in, PetscInt Ny_in); 00081 00082 virtual PetscErrorCode get_smoothing_domain(PetscInt &Nx_out, PetscInt &Ny_out); 00083 virtual PetscInt get_max_ghosts() { return maxGHOSTS; } 00084 00085 virtual PetscErrorCode get_smoothed_thk(IceModelVec2S usurf, IceModelVec2S thk, IceModelVec2Int mask, 00086 PetscInt GHOSTS, IceModelVec2S *thksmooth); 00087 virtual PetscErrorCode get_theta(IceModelVec2S usurf, PetscReal n, 00088 PetscInt GHOSTS, IceModelVec2S *theta); 00089 00090 IceModelVec2S topgsmooth; 00091 00092 protected: 00093 IceGrid &grid; 00094 const NCConfigVariable &config; 00095 IceModelVec2S maxtl,C2,C3,C4; 00096 00097 PetscInt Nx,Ny; 00098 00099 00100 PetscInt maxGHOSTS; 00101 00102 00103 00104 PetscErrorCode allocate(); 00105 PetscErrorCode deallocate(); 00106 00107 Vec g2, g2natural; 00108 VecScatter scatter; 00109 Vec topgp0, 00110 topgsmoothp0, 00111 maxtlp0, 00112 C2p0,C3p0,C4p0; 00113 00114 PetscErrorCode smooth_the_bed_on_proc0(); 00115 PetscErrorCode compute_coefficients_on_proc0(PetscReal n); 00116 }; 00117 00118 #endif // __PISMBedSmoother_hh 00119
1.7.3