PISM, A Parallel Ice Sheet Model stable 0.4.1779

src/base/stressbalance/SIAFD.hh

Go to the documentation of this file.
00001 // Copyright (C) 2004--2011 Jed Brown, 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 _SIAFD_H_
00020 #define _SIAFD_H_
00021 
00022 #include "SSB_Modifier.hh"
00023 #include "PISMBedSmoother.hh"
00024 #include "PISMDiagnostic.hh"
00025 
00026 class SIAFD : public SSB_Modifier
00027 {
00028   friend class SIAFD_schoofs_theta;
00029   friend class SIAFD_topgsmooth;
00030   friend class SIAFD_thksmooth;
00031   friend class SIAFD_diffusivity;
00032 public:
00033   SIAFD(IceGrid &g, IceFlowLaw &i, EnthalpyConverter &e, const NCConfigVariable &c)
00034     : SSB_Modifier(g, i, e, c), WIDE_STENCIL(2) { allocate(); }
00035 
00036   virtual ~SIAFD() { delete bed_smoother; }
00037 
00038   virtual PetscErrorCode init(PISMVars &vars);
00039 
00040   using PISMComponent_Diag::update;
00041   virtual PetscErrorCode update(IceModelVec2V *vel_input,
00042                                 IceModelVec2S *D2_input,
00043                                 bool fast);
00044 
00046   virtual PetscErrorCode extend_the_grid(PetscInt old_Mz);
00047 
00049   virtual void get_diagnostics(map<string, PISMDiagnostic*> &dict);
00050 
00051 protected:
00052   virtual PetscErrorCode allocate();
00053 
00054   virtual PetscErrorCode compute_surface_gradient(IceModelVec2Stag &h_x, IceModelVec2Stag &h_y);
00055 
00056   virtual PetscErrorCode surface_gradient_eta(IceModelVec2Stag &h_x, IceModelVec2Stag &h_y);
00057   virtual PetscErrorCode surface_gradient_haseloff(IceModelVec2Stag &h_x, IceModelVec2Stag &h_y);
00058   virtual PetscErrorCode surface_gradient_mahaffy(IceModelVec2Stag &h_x, IceModelVec2Stag &h_y);
00059 
00060   virtual PetscErrorCode compute_diffusive_flux(IceModelVec2Stag &h_x, IceModelVec2Stag &h_y,
00061                                                 IceModelVec2Stag &result, bool fast);
00062 
00063   virtual PetscErrorCode compute_3d_horizontal_velocity(IceModelVec2Stag &h_x, IceModelVec2Stag &h_y,
00064                                                         IceModelVec2V *vel_input,
00065                                                         IceModelVec3 &u_out, IceModelVec3 &v_out);
00066 
00067   virtual PetscErrorCode compute_I();
00068   virtual PetscErrorCode compute_sigma(IceModelVec2S *D2_input, IceModelVec2Stag &h_x,
00069                                        IceModelVec2Stag &h_y);
00070 
00071   virtual PetscScalar grainSizeVostok(PetscScalar age) const;
00072 
00073   virtual PetscErrorCode compute_diffusivity(IceModelVec2S &result);
00074 
00075   // pointers to input fields:
00076   IceModelVec2S *bed, *thickness, *surface;
00077   IceModelVec2Int *mask;
00078   IceModelVec3 *age, *enthalpy;
00079 
00080   // temporary storage:
00081   IceModelVec2S work_2d[2];         // for eta, theta and the smoothed thickness
00082   IceModelVec2Stag work_2d_stag[2]; // for the surface gradient
00083   IceModelVec3 delta[2];            // store delta on the staggered grid
00084   IceModelVec3 work_3d[2];      // replaces old Sigmastag3 and Istag3; used to
00085                                 // store I and Sigma on the staggered grid
00086 
00087   PISMBedSmoother *bed_smoother;
00088   const PetscInt WIDE_STENCIL;
00089   int bed_state_counter;
00090 
00091   // profiling
00092   int event_sia;
00093 };
00094 
00097 
00100 class SIAFD_schoofs_theta : public PISMDiag<SIAFD>
00101 {
00102 public:
00103   SIAFD_schoofs_theta(SIAFD *m, IceGrid &g, PISMVars &my_vars);
00104   virtual PetscErrorCode compute(IceModelVec* &result);
00105 };
00106 
00109 
00112 class SIAFD_topgsmooth : public PISMDiag<SIAFD>
00113 {
00114 public:
00115   SIAFD_topgsmooth(SIAFD *m, IceGrid &g, PISMVars &my_vars);
00116   virtual PetscErrorCode compute(IceModelVec* &result);
00117 };
00118 
00121 
00124 class SIAFD_thksmooth : public PISMDiag<SIAFD>
00125 {
00126 public:
00127   SIAFD_thksmooth(SIAFD *m, IceGrid &g, PISMVars &my_vars);
00128   virtual PetscErrorCode compute(IceModelVec* &result);
00129 };
00130 
00132 class SIAFD_diffusivity : public PISMDiag<SIAFD>
00133 {
00134 public:
00135   SIAFD_diffusivity(SIAFD *m, IceGrid &g, PISMVars &my_vars);
00136   virtual PetscErrorCode compute(IceModelVec* &result);
00137 };
00138 
00139 #endif /* _SIAFD_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines