From fa958556a1a16ec1e4bb9ddcf5590262b40691a8 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Thu, 3 Nov 2011 01:38:04 +0100 Subject: [PATCH] Do away with dummy nonlinearities --- dune/tectonic/myblockproblem.hh | 2 -- dune/tectonic/myconvexproblem.hh | 14 ++++---------- src/one-body-sample.cc | 11 +++-------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh index 02e33783..54f7f66c 100644 --- a/dune/tectonic/myblockproblem.hh +++ b/dune/tectonic/myblockproblem.hh @@ -7,7 +7,6 @@ #include <dune/common/bitsetvector.hh> #include <dune/tnnmg/problem-classes/bisection.hh> -#include <dune/tnnmg/problem-classes/nonlinearity.hh> #include <dune/tnnmg/problem-classes/onedconvexfunction.hh> #include "mynonlinearity.hh" @@ -20,7 +19,6 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem { public: typedef MyConvexProblemTypeTEMPLATE MyConvexProblemType; typedef typename MyConvexProblemType::FunctionType FunctionType; - typedef typename MyConvexProblemType::NonlinearityType NonlinearityType; typedef typename MyConvexProblemType::VectorType VectorType; typedef typename MyConvexProblemType::MatrixType MatrixType; typedef typename MyConvexProblemType::LocalVectorType LocalVectorType; diff --git a/dune/tectonic/myconvexproblem.hh b/dune/tectonic/myconvexproblem.hh index a42df6e1..1ec36849 100644 --- a/dune/tectonic/myconvexproblem.hh +++ b/dune/tectonic/myconvexproblem.hh @@ -3,19 +3,15 @@ #ifndef MY_CONVEX_PROBLEM_HH #define MY_CONVEX_PROBLEM_HH -#include <dune/tnnmg/problem-classes/nonlinearity.hh> - /** \brief TODO - \tparam NonlinearityTypeTEMPLATE The type used to implement the nonlinearity \tparam MatrixTypeTEMPLATE The type used for the matrix of the quadratic part */ -template <class NonlinearityTypeTEMPLATE, class MatrixTypeTEMPLATE, - class VectorTypeTEMPLATE, class FunctionTypeTEMPLATE> +template <class MatrixTypeTEMPLATE, class VectorTypeTEMPLATE, + class FunctionTypeTEMPLATE> class MyConvexProblem { public: - typedef NonlinearityTypeTEMPLATE NonlinearityType; typedef FunctionTypeTEMPLATE FunctionType; typedef VectorTypeTEMPLATE VectorType; typedef MatrixTypeTEMPLATE MatrixType; @@ -27,17 +23,15 @@ class MyConvexProblem { /** \brief Constructor with the problem components \param A The matrix of the quadratic part - \param phi The nonlinearity \param f The linear functional \param u The solution vector */ MyConvexProblem(MatrixType const &A, Dune::MyGlobalNonlinearity<block_size, FunctionType> &newphi, - NonlinearityType &phi, VectorType const &f, VectorType &u) - : A(A), newphi(newphi), phi(phi), f(f), u(u) {}; + VectorType const &f, VectorType &u) + : A(A), newphi(newphi), f(f), u(u) {}; MatrixType const &A; - NonlinearityType φ Dune::MyGlobalNonlinearity<block_size, FunctionType> const &newphi; VectorType const &f; diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index 3c533a90..9a09140d 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -28,8 +28,6 @@ #include <dune/fufem/functionspacebases/p1nodalbasis.hh> #include <dune/tnnmg/iterationsteps/genericnonlineargs.hh> -#include <dune/tnnmg/problem-classes/nonlinearity.hh> -#include <dune/tnnmg/nonlinearities/zerononlinearity.hh> #include <dune/solvers/common/numproc.hh> // Solver::FULL #include <dune/solvers/iterationsteps/blockgsstep.hh> @@ -207,14 +205,11 @@ int main() { // experiment with convex problems and the like - typedef ZeroNonlinearity<SmallVector, SmallMatrix> NonlinearityType; - NonlinearityType phi; - - typedef MyConvexProblem<NonlinearityType, OperatorType, VectorType, - Dune::LinearFunction> MyConvexProblemType; + typedef MyConvexProblem<OperatorType, VectorType, Dune::LinearFunction> + MyConvexProblemType; MyConvexProblemType myConvexProblem(stiffnessMatrix, myGlobalNonlinearity, - phi, f, u1); + f, u1); typedef MyBlockProblem<MyConvexProblemType> MyBlockProblemType; MyBlockProblemType myBlockProblem(myConvexProblem); -- GitLab