tIPTotalVariationFunctional.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
---
tIPTotalVariationFunctional.hh (2102B)
---
1 // Copyright (C) 2013, 2014, 2015 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 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 #ifndef TOTALVARIATIONFUNCTIONAL_HH_HKBL1T7I
20 #define TOTALVARIATIONFUNCTIONAL_HH_HKBL1T7I
21
22 #include "IPFunctional.hh"
23
24 namespace pism {
25 namespace inverse {
26
27 //! Pseduo total variation functional
28 /*! \f[
29 J(u) = c\int_\Omega (\epsilon^2+|\nabla u|^2)^{q/2}
30 \f]
31 The parameters \f$c\f$, \f$q\f$ and \f$\epsilon\f$ are provided at construction. Taking \f$q\f$=1 would
32 yield a total variation functional, save for the regularizing parameter \f$\epsilon\f$.
33 */
34 class IPTotalVariationFunctional2S : public IPFunctional<IceModelVec2S> {
35 public:
36 IPTotalVariationFunctional2S(IceGrid::ConstPtr grid, double c, double q, double eps, IceModelVec2Int *dirichletLocations=NULL);
37
38 virtual void valueAt(IceModelVec2S &x, double *OUTPUT);
39 virtual void gradientAt(IceModelVec2S &x, IceModelVec2S &gradient);
40
41 protected:
42
43 IceModelVec2Int *m_dirichletIndices;
44 double m_c; // scale parameter.
45 double m_lebesgue_exp;
46 double m_epsilon_sq; // Regularization parameter.
47
48 private:
49 // Hide copy/assignment operations
50 IPTotalVariationFunctional2S(IPTotalVariationFunctional2S const &);
51 IPTotalVariationFunctional2S & operator=(IPTotalVariationFunctional2S const &);
52 };
53
54 } // end of namespace inverse
55 } // end of namespace pism
56
57 #endif /* end of include guard: TOTALVARIATIONFUNCTIONAL_HH_HKBL1T7I */