From a2f3f8325d62db5744967445edda4134b33bde25 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Tue, 31 Jul 2012 10:59:47 +0200 Subject: [PATCH] Rename: SampleFunctional -> EllipticEnergy --- .../{samplefunctional.hh => ellipticenergy.hh} | 6 +++--- dune/tectonic/myblockproblem.hh | 6 +++--- dune/tectonic/octave/duneoctave.hh | 8 ++++---- src/test-gradient-horrible-logarithmic.cc | 4 ++-- src/test-gradient-horrible.cc | 4 ++-- src/test-gradient-identity.cc | 4 ++-- src/test-gradient-method-helper.hh | 13 ++++++------- src/test-gradient-parabola.cc | 4 ++-- src/test-gradient-sample-3d.cc | 4 ++-- src/test-gradient-sample-nonsmooth.cc | 4 ++-- src/test-gradient-sample-steep.cc | 4 ++-- src/test-gradient-sample-steep2.cc | 4 ++-- src/test-gradient-sample-verysteep.cc | 4 ++-- src/test-gradient-sample.cc | 4 ++-- src/test-gradient-sample2.cc | 4 ++-- src/test-gradient-trivial.cc | 4 ++-- 16 files changed, 40 insertions(+), 41 deletions(-) rename dune/tectonic/{samplefunctional.hh => ellipticenergy.hh} (97%) diff --git a/dune/tectonic/samplefunctional.hh b/dune/tectonic/ellipticenergy.hh similarity index 97% rename from dune/tectonic/samplefunctional.hh rename to dune/tectonic/ellipticenergy.hh index e88dd863..bb6f8749 100644 --- a/dune/tectonic/samplefunctional.hh +++ b/dune/tectonic/ellipticenergy.hh @@ -13,15 +13,15 @@ #include "circularconvexfunction.hh" namespace Dune { -template <int dim> class SampleFunctional { +template <int dim> class EllipticEnergy { public: typedef FieldVector<double, dim> SmallVector; typedef FieldMatrix<double, dim, dim> SmallMatrix; typedef LocalNonlinearity<dim> NonlinearityType; - SampleFunctional(SmallMatrix const &A, SmallVector const &b, - shared_ptr<NonlinearityType const> phi, int ignore = dim) + EllipticEnergy(SmallMatrix const &A, SmallVector const &b, + shared_ptr<NonlinearityType const> phi, int ignore = dim) : A(A), b(b), phi(phi), ignore(ignore) {} double operator()(SmallVector const &v) const { diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh index 0a0864b5..3228de8d 100644 --- a/dune/tectonic/myblockproblem.hh +++ b/dune/tectonic/myblockproblem.hh @@ -13,7 +13,7 @@ #include "globalnonlinearity.hh" #include "localnonlinearity.hh" #include "mydirectionalconvexfunction.hh" -#include "samplefunctional.hh" +#include "ellipticenergy.hh" /* Just for debugging */ template <int dim, class VectorType, class MatrixType> @@ -320,8 +320,8 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { assert(localA != nullptr); auto const phi = problem.phi.restriction(m); - Dune::SampleFunctional<block_size> localJ(*localA, localb, phi, - ignore_component); + Dune::EllipticEnergy<block_size> localJ(*localA, localb, phi, + ignore_component); LocalVectorType correction; Dune::minimise(localJ, ui, localsteps, bisection); diff --git a/dune/tectonic/octave/duneoctave.hh b/dune/tectonic/octave/duneoctave.hh index 7c4a8a1e..1611f728 100644 --- a/dune/tectonic/octave/duneoctave.hh +++ b/dune/tectonic/octave/duneoctave.hh @@ -5,12 +5,12 @@ #include <octave/oct.h> -#include "../samplefunctional.hh" +#include "../ellipticenergy.hh" namespace Dune { template <int dimension> void octaveToDune(Array<double> const &from, - typename Dune::SampleFunctional<dimension>::SmallVector &to) { + typename Dune::EllipticEnergy<dimension>::SmallVector &to) { assert(from.length() == dimension); for (size_t i = 0; i < dimension; ++i) to[i] = from(i); @@ -18,7 +18,7 @@ void octaveToDune(Array<double> const &from, template <int dimension> void octaveToDune(Matrix const &from, - typename Dune::SampleFunctional<dimension>::SmallMatrix &to) { + typename Dune::EllipticEnergy<dimension>::SmallMatrix &to) { dim_vector dims = from.dims(); assert(dims.length() == 2); assert(dims(0) == 2); @@ -30,7 +30,7 @@ void octaveToDune(Matrix const &from, template <int dimension> void duneToOctave( - typename Dune::SampleFunctional<dimension>::SmallVector const &from, + typename Dune::EllipticEnergy<dimension>::SmallVector const &from, Array<double> &to) { assert(to.length() == dimension); for (size_t i = 0; i < dimension; ++i) diff --git a/src/test-gradient-horrible-logarithmic.cc b/src/test-gradient-horrible-logarithmic.cc index 5cbc16e1..6991b300 100644 --- a/src/test-gradient-horrible-logarithmic.cc +++ b/src/test-gradient-horrible-logarithmic.cc @@ -8,14 +8,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-horrible.cc b/src/test-gradient-horrible.cc index 2d319687..55dad144 100644 --- a/src/test-gradient-horrible.cc +++ b/src/test-gradient-horrible.cc @@ -8,14 +8,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-identity.cc b/src/test-gradient-identity.cc index e0c37253..fb5887a1 100644 --- a/src/test-gradient-identity.cc +++ b/src/test-gradient-identity.cc @@ -8,14 +8,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-method-helper.hh b/src/test-gradient-method-helper.hh index 421d0d9a..f3016d5a 100644 --- a/src/test-gradient-method-helper.hh +++ b/src/test-gradient-method-helper.hh @@ -5,11 +5,11 @@ #include <dune/tnnmg/problem-classes/bisection.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> template <int dim> -double functionTester(Dune::SampleFunctional<dim> J, - typename Dune::SampleFunctional<dim>::SmallVector &start, +double functionTester(Dune::EllipticEnergy<dim> J, + typename Dune::EllipticEnergy<dim>::SmallVector &start, size_t runs) { Bisection const bisection( 0.0, // acceptError: Stop if the search interval has @@ -27,10 +27,9 @@ double functionTester(Dune::SampleFunctional<dim> J, } template <int dim> -double two_distance( - typename Dune::SampleFunctional<dim>::SmallVector const &x, - typename Dune::SampleFunctional<dim>::SmallVector const &y) { - typename Dune::SampleFunctional<dim>::SmallVector tmp = x; +double two_distance(typename Dune::EllipticEnergy<dim>::SmallVector const &x, + typename Dune::EllipticEnergy<dim>::SmallVector const &y) { + typename Dune::EllipticEnergy<dim>::SmallVector tmp = x; tmp -= y; return tmp.two_norm(); } diff --git a/src/test-gradient-parabola.cc b/src/test-gradient-parabola.cc index a2ee2ee9..52b089ce 100644 --- a/src/test-gradient-parabola.cc +++ b/src/test-gradient-parabola.cc @@ -10,14 +10,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-helper.hh" #include "test-gradient-method-nicefunction.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-sample-3d.cc b/src/test-gradient-sample-3d.cc index a58ffc2a..a6e7578e 100644 --- a/src/test-gradient-sample-3d.cc +++ b/src/test-gradient-sample-3d.cc @@ -8,14 +8,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 3; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-sample-nonsmooth.cc b/src/test-gradient-sample-nonsmooth.cc index b9a474a1..5b237519 100644 --- a/src/test-gradient-sample-nonsmooth.cc +++ b/src/test-gradient-sample-nonsmooth.cc @@ -9,14 +9,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-sample-steep.cc b/src/test-gradient-sample-steep.cc index 7cca14ab..f636de24 100644 --- a/src/test-gradient-sample-steep.cc +++ b/src/test-gradient-sample-steep.cc @@ -8,14 +8,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-sample-steep2.cc b/src/test-gradient-sample-steep2.cc index d5a40ad4..cd8a074e 100644 --- a/src/test-gradient-sample-steep2.cc +++ b/src/test-gradient-sample-steep2.cc @@ -8,14 +8,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-sample-verysteep.cc b/src/test-gradient-sample-verysteep.cc index 0da5ad9f..74d2bd3d 100644 --- a/src/test-gradient-sample-verysteep.cc +++ b/src/test-gradient-sample-verysteep.cc @@ -8,14 +8,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-sample.cc b/src/test-gradient-sample.cc index 1bfd05c0..3d09b7a7 100644 --- a/src/test-gradient-sample.cc +++ b/src/test-gradient-sample.cc @@ -10,14 +10,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-sample2.cc b/src/test-gradient-sample2.cc index fd67e841..1392cad6 100644 --- a/src/test-gradient-sample2.cc +++ b/src/test-gradient-sample2.cc @@ -10,14 +10,14 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-nicefunction.hh" #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; diff --git a/src/test-gradient-trivial.cc b/src/test-gradient-trivial.cc index c8b7f0f5..1e4b4cc5 100644 --- a/src/test-gradient-trivial.cc +++ b/src/test-gradient-trivial.cc @@ -10,13 +10,13 @@ #include <dune/common/shared_ptr.hh> -#include <dune/tectonic/samplefunctional.hh> +#include <dune/tectonic/ellipticenergy.hh> #include "test-gradient-method-helper.hh" int main() { int const dim = 2; - typedef Dune::SampleFunctional<dim> Functional; + typedef Dune::EllipticEnergy<dim> Functional; typedef Functional::SmallMatrix SmallMatrix; typedef Functional::SmallVector SmallVector; -- GitLab