URI:
       tEmptyingProblem.hh - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
  HTML git clone git://src.adamsgaard.dk/pism
   DIR Log
   DIR Files
   DIR Refs
   DIR LICENSE
       ---
       tEmptyingProblem.hh (2959B)
       ---
            1 /* Copyright (C) 2019 PISM Authors
            2  *
            3  * This file is part of PISM.
            4  *
            5  * PISM is free software; you can redistribute it and/or modify it under the
            6  * terms of the GNU General Public License as published by the Free Software
            7  * Foundation; either version 3 of the License, or (at your option) any later
            8  * version.
            9  *
           10  * PISM is distributed in the hope that it will be useful, but WITHOUT ANY
           11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
           12  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
           13  * details.
           14  *
           15  * You should have received a copy of the GNU General Public License
           16  * along with PISM; if not, write to the Free Software
           17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
           18  */
           19 
           20 #ifndef EMPTYINGPROBLEM_H
           21 #define EMPTYINGPROBLEM_H
           22 
           23 #include "pism/util/Component.hh"
           24 #include "pism/util/petscwrappers/KSP.hh"
           25 #include "pism/util/petscwrappers/Mat.hh"
           26 
           27 namespace pism {
           28 
           29 class Geometry;
           30 
           31 namespace hydrology {
           32 
           33 class EmptyingProblem : public Component {
           34 public:
           35   EmptyingProblem(IceGrid::ConstPtr g);
           36   virtual ~EmptyingProblem();
           37 
           38   void update(const Geometry &geometry,
           39               const IceModelVec2Int *no_model_mask,
           40               const IceModelVec2S &water_input_rate,
           41               bool recompute_potential = true);
           42 
           43   // output
           44   const IceModelVec2V& flux() const;
           45 
           46   // diagnostics
           47   const IceModelVec2S& remaining_water_thickness() const;
           48   const IceModelVec2V& effective_water_velocity() const;
           49   const IceModelVec2S& potential() const;
           50   const IceModelVec2S& adjustment() const;
           51   const IceModelVec2Int& sinks() const;
           52 
           53   DiagnosticList diagnostics() const;
           54 
           55 protected:
           56 
           57   virtual void compute_raw_potential(const IceModelVec2S &ice_thickness,
           58                                      const IceModelVec2S &ice_bottom_surface,
           59                                      IceModelVec2S &result) const;
           60 
           61   void compute_potential(const IceModelVec2S &ice_thickness,
           62                          const IceModelVec2S &ice_bottom_surface,
           63                          const IceModelVec2Int &domain_mask,
           64                          IceModelVec2S &result);
           65 
           66   void compute_velocity(const IceModelVec2S &hydraulic_potential,
           67                         const IceModelVec2Int &mask,
           68                         IceModelVec2Stag &result) const;
           69 
           70   void compute_mask(const IceModelVec2CellType &cell_type,
           71                     const IceModelVec2Int *no_model_mask,
           72                     IceModelVec2Int &result) const;
           73 
           74   IceModelVec2S m_potential;
           75   IceModelVec2S m_tmp;
           76   IceModelVec2S m_bottom_surface;
           77   IceModelVec2S m_W;
           78   IceModelVec2Stag m_Vstag;
           79   IceModelVec2Stag m_Qsum;
           80   IceModelVec2Int m_domain_mask;
           81 
           82   IceModelVec2V m_Q;
           83   IceModelVec2V m_q_sg;
           84   IceModelVec2S m_adjustment;
           85   IceModelVec2Int m_sinks;
           86 
           87   double m_dx;
           88   double m_dy;
           89 
           90   double m_eps_gradient;
           91   double m_speed;
           92   double m_tau;
           93 };
           94 
           95 } // end of namespace hydrology
           96 } // end of namespace pism
           97 
           98 #endif /* EMPTYINGPROBLEM_H */