URI: 
       tIP_SSATaucTaoTikhonovProblem.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
       ---
       tIP_SSATaucTaoTikhonovProblem.cc (1936B)
       ---
            1 // Copyright (C) 2013, 2014, 2015, 2016  David Maxwell and Constantine Khroulev
            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 2 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 "IP_SSATaucTaoTikhonovProblem.hh"
           21 
           22 namespace pism {
           23 namespace inverse {
           24 
           25 void IP_SSATaucTaoTikhonovProblem::connect(Tao tao) {
           26   PetscErrorCode ierr;
           27 
           28   IPTaoTikhonovProblem<IP_SSATaucForwardProblem>::connect(tao);
           29 
           30   const char *type;
           31   ierr = TaoGetType(tao,&type);
           32   PISM_CHK(ierr, "TaoGetType");
           33 
           34   if (strcmp(type,"blmvm") == 0) {
           35     taoutil::TaoGetVariableBoundsCallback<IP_SSATaucTaoTikhonovProblem>::connect(tao,*this);
           36   }  
           37 }
           38 
           39 
           40 void IP_SSATaucTaoTikhonovProblem::getVariableBounds(Tao /*tao*/, Vec lo, Vec hi) {
           41   double zeta_min = 0.0, zeta_max = 0.0, tauc_min = 0.0, tauc_max = 0.0;
           42 
           43   tauc_min = m_grid->ctx()->config()->get_number("inverse.ssa.tauc_min");
           44   tauc_max = m_grid->ctx()->config()->get_number("inverse.ssa.tauc_max");
           45 
           46   IPDesignVariableParameterization &tauc_param = m_forward.tauc_param();
           47   tauc_param.fromDesignVariable(tauc_min,&zeta_min);
           48   tauc_param.fromDesignVariable(tauc_max,&zeta_max);
           49 
           50   PetscErrorCode ierr = VecSet(lo,zeta_min);
           51   PISM_CHK(ierr, "VecSet");
           52 
           53   ierr = VecSet(hi,zeta_max);
           54   PISM_CHK(ierr, "VecSet");
           55 }
           56 
           57 
           58 } // end of namespace inverse
           59 } // end of namespace pism