tIP_SSAHardavTaoTikhonovProblem.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_SSAHardavTaoTikhonovProblem.cc (1947B)
---
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_SSAHardavTaoTikhonovProblem.hh"
21
22 namespace pism {
23 namespace inverse {
24
25 void IP_SSAHardavTaoTikhonovProblem::connect(Tao tao) {
26 PetscErrorCode ierr;
27
28 IPTaoTikhonovProblem<IP_SSAHardavForwardProblem>::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_SSAHardavTaoTikhonovProblem>::connect(tao,*this);
36 }
37 }
38
39
40 void IP_SSAHardavTaoTikhonovProblem::getVariableBounds(Tao /*tao*/, Vec lo, Vec hi) {
41
42 double zeta_min, zeta_max, hardav_min, hardav_max;
43
44 hardav_min = m_grid->ctx()->config()->get_number("inverse.ssa.hardav_min");
45 hardav_max = m_grid->ctx()->config()->get_number("inverse.ssa.hardav_max");
46
47 IPDesignVariableParameterization &design_param = m_forward.design_param();
48 design_param.fromDesignVariable(hardav_min,&zeta_min);
49 design_param.fromDesignVariable(hardav_max,&zeta_max);
50
51 PetscErrorCode ierr = VecSet(lo,zeta_min);
52 PISM_CHK(ierr, "VecSet");
53
54 ierr = VecSet(hi,zeta_max);
55 PISM_CHK(ierr, "VecSet");
56 }
57
58
59 } // end of namespace inverse
60 } // end of namespace pism