PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
IPTotalVariationFunctional.hh
Go to the documentation of this file.
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 "pism/inverse/functional/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<array::Scalar> {
35 public:
36  IPTotalVariationFunctional2S(std::shared_ptr<const Grid> grid, double c, double q, double eps, array::Scalar *dirichletLocations=NULL);
37 
38  virtual void valueAt(array::Scalar &x, double *OUTPUT);
39  virtual void gradientAt(array::Scalar &x, array::Scalar &gradient);
40 
41 protected:
42 
44  double m_c; // scale parameter.
46  double m_epsilon_sq; // Regularization parameter.
47 
48 private:
49  // Hide copy/assignment operations
52 };
53 
54 } // end of namespace inverse
55 } // end of namespace pism
56 
57 #endif /* end of include guard: TOTALVARIATIONFUNCTIONAL_HH_HKBL1T7I */
Abstract base class for functions from ice model vectors to .
Definition: IPFunctional.hh:41
virtual void valueAt(array::Scalar &x, double *OUTPUT)
Computes the value of the functional at the vector x.
virtual void gradientAt(array::Scalar &x, array::Scalar &gradient)
Computes the gradient of the functional at the vector x.
IPTotalVariationFunctional2S(IPTotalVariationFunctional2S const &)
IPTotalVariationFunctional2S(std::shared_ptr< const Grid > grid, double c, double q, double eps, array::Scalar *dirichletLocations=NULL)
IPTotalVariationFunctional2S & operator=(IPTotalVariationFunctional2S const &)