Skip to content
Snippets Groups Projects
Commit 5a7d802f authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

some refactoring to allow testing of other TargetSpaces

[[Imported from SVN: r7382]]
parent ec74a09a
No related branches found
No related tags found
No related merge requests found
...@@ -11,10 +11,14 @@ ...@@ -11,10 +11,14 @@
#include "multiindex.hh" #include "multiindex.hh"
#include "valuefactory.hh" #include "valuefactory.hh"
typedef UnitVector<3> TargetSpace;
using namespace Dune; using namespace Dune;
//typedef std::conditional<domainDim==1,OneDGrid,UGGrid<domainDim> >::type GridType;
typedef OneDGrid GridType;
...@@ -55,26 +59,13 @@ energy(const Entity& element, ...@@ -55,26 +59,13 @@ energy(const Entity& element,
} }
template <int domainDim> template <int domainDim>
void testUnitVector3d() GridType* makeTestGrid()
{ {
// //////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////
// Make a test grid consisting of a single simplex // 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; GridFactory<GridType> factory;
FieldVector<double,domainDim> pos(0); FieldVector<double,domainDim> pos(0);
...@@ -91,8 +82,21 @@ void testUnitVector3d() ...@@ -91,8 +82,21 @@ void testUnitVector3d()
v[i] = i; v[i] = i;
factory.insertElement(GeometryType(GeometryType::simplex,domainDim), v); 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 // Test whether the energy is invariant under isometries
...@@ -180,5 +184,5 @@ void testUnitVector3d() ...@@ -180,5 +184,5 @@ void testUnitVector3d()
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
testUnitVector3d<1>(); testHessian<UnitVector<3>, 1>();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment