From 5a7d802fbf229c27d2d3efd19196dbc5b9cdc46e Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 7 Jun 2011 09:00:36 +0000 Subject: [PATCH] some refactoring to allow testing of other TargetSpaces [[Imported from SVN: r7382]] --- test/localgeodesicfestiffnesstest.cc | 40 +++++++++++++++------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/test/localgeodesicfestiffnesstest.cc b/test/localgeodesicfestiffnesstest.cc index 59115871..dfef3418 100644 --- a/test/localgeodesicfestiffnesstest.cc +++ b/test/localgeodesicfestiffnesstest.cc @@ -11,10 +11,14 @@ #include "multiindex.hh" #include "valuefactory.hh" -typedef UnitVector<3> TargetSpace; using namespace Dune; +//typedef std::conditional<domainDim==1,OneDGrid,UGGrid<domainDim> >::type GridType; +typedef OneDGrid GridType; + + + @@ -55,26 +59,13 @@ energy(const Entity& element, } - - - - - - - - - - template <int domainDim> -void testUnitVector3d() +GridType* makeTestGrid() { // //////////////////////////////////////////////////////// // Make a test grid consisting of a single simplex // //////////////////////////////////////////////////////// - //typedef std::conditional<domainDim==1,OneDGrid,UGGrid<domainDim> >::type GridType; - typedef OneDGrid GridType; - GridFactory<GridType> factory; FieldVector<double,domainDim> pos(0); @@ -91,8 +82,21 @@ void testUnitVector3d() v[i] = i; factory.insertElement(GeometryType(GeometryType::simplex,domainDim), v); - const GridType* grid = factory.createGrid(); - + return factory.createGrid(); +} + + + + + + + + + +template <class TargetSpace, int domainDim> +void testHessian() +{ + const GridType* grid = makeTestGrid<domainDim>(); // ////////////////////////////////////////////////////////// // Test whether the energy is invariant under isometries @@ -180,5 +184,5 @@ void testUnitVector3d() int main(int argc, char** argv) { - testUnitVector3d<1>(); + testHessian<UnitVector<3>, 1>(); } -- GitLab