URI: 
       tPatersonBudd.cc - 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
       ---
       tPatersonBudd.cc (2336B)
       ---
            1 /* Copyright (C) 2015 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 #include <cmath>
           21 
           22 #include "PatersonBudd.hh"
           23 
           24 namespace pism {
           25 namespace rheology {
           26 
           27 // PatersonBudd
           28 
           29 PatersonBudd::PatersonBudd(const std::string &prefix,
           30                            const Config &config,
           31                            EnthalpyConverter::Ptr ec)
           32   : FlowLaw(prefix, config, ec) {
           33   m_name = "Paterson-Budd";
           34 }
           35 
           36 PatersonBudd::~PatersonBudd() {
           37   // empty
           38 }
           39 
           40 /*! Converts enthalpy to temperature and uses the Paterson-Budd formula. */
           41 double PatersonBudd::softness_impl(double E, double pressure) const {
           42   double T_pa = m_EC->pressure_adjusted_temperature(E, pressure);
           43   return softness_from_temp(T_pa);
           44 }
           45 
           46 /*! Converts enthalpy to temperature and calls flow_from_temp. */
           47 double PatersonBudd::flow_impl(double stress, double E,
           48                                double pressure, double gs) const {
           49   double temp = m_EC->temperature(E, pressure);
           50   return flow_from_temp(stress, temp, pressure, gs);
           51 }
           52 
           53 //! The flow law (temperature-dependent version).
           54 double PatersonBudd::flow_from_temp(double stress, double temp,
           55                                     double pressure, double /*gs*/) const {
           56   // pressure-adjusted temperature:
           57   const double T_pa = temp + (m_beta_CC_grad / (m_rho * m_standard_gravity)) * pressure;
           58   return softness_from_temp(T_pa) * pow(stress, m_n-1);
           59 }
           60 
           61 double PatersonBudd::softness_from_temp(double T_pa) const {
           62   return softness_paterson_budd(T_pa);
           63 }
           64 
           65 double PatersonBudd::hardness_from_temp(double T_pa) const {
           66   return pow(softness_from_temp(T_pa), m_hardness_power);
           67 }
           68 
           69 } // end of namespace rheology
           70 } // end of namespace pism