PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
IP_SSAHardavTaoTikhonovProblem.cc
Go to the documentation of this file.
1 // Copyright (C) 2013, 2014, 2015, 2016, 2023 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 "pism/inverse/IP_SSAHardavTaoTikhonovProblem.hh"
21 
22 namespace pism {
23 namespace inverse {
24 
26  PetscErrorCode ierr;
27 
29 
30  const char *type;
31  ierr = TaoGetType(tao,&type);
32  PISM_CHK(ierr, "TaoGetType");
33 
34  if (strcmp(type,"blmvm") == 0) {
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 
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
virtual void fromDesignVariable(double d, double *OUTPUT)=0
Converts from to a parameterization value such that .
virtual void connect(Tao tao)
Callback from TaoBasicSolver, used to wire the connections between a Tao and.
virtual IPDesignVariableParameterization & design_param()
Exposes the design variable parameterization being used.
virtual void connect(Tao tao)
Callback from TaoBasicSolver, used to wire the connections between a Tao and.
virtual void getVariableBounds(Tao tao, Vec lo, Vec hi)
Callback to TAO to set bounds on for constrained minimization algorithms.
static void connect(Tao tao, Problem &p)
Definition: TaoUtil.hh:275
#define PISM_CHK(errcode, name)