From 04a18a300466e94d5e51a88a277ae53f2657b2d9 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Sun, 30 Dec 2012 11:36:26 +0000 Subject: [PATCH] Code for 2d and 3d hyperbolic half-spaces [[Imported from SVN: r9077]] --- test/valuefactory.hh | 65 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/test/valuefactory.hh b/test/valuefactory.hh index 10fddcb3..26946b52 100644 --- a/test/valuefactory.hh +++ b/test/valuefactory.hh @@ -303,5 +303,70 @@ public: }; +/** \brief A class that creates sets of values of various types, to be used in unit tests + * + * This is the specialization for HyperbolicHalfspacePoint<3> + */ +template <> +class ValueFactory<HyperbolicHalfspacePoint<double,2> > +{ +public: + static void get(std::vector<HyperbolicHalfspacePoint<double,2> >& values) { + + int nTestPoints = 10; + double testPoints[10][3] = {{1,0.01}, {0,0.01}, {-0.838114,0.412667}, + {-0.490946,0.81551},{-0.944506,0.304319}, + {-0.6,0.2},{0.45,0.517}, + {-0.1,0.1},{-0.444506,0.104319},{-0.7,0.304319}}; + + values.resize(nTestPoints); + + // Set up elements of S^1 + for (int i=0; i<nTestPoints; i++) { + + Dune::FieldVector<double,2> w; + for (int j=0; j<2; j++) + w[j] = testPoints[i][j]; + values[i] = HyperbolicHalfspacePoint<double,2>(w); + + } + + } + +}; + +/** \brief A class that creates sets of values of various types, to be used in unit tests + * + * This is the specialization for HyperbolicHalfspacePoint<3> + */ +template <> +class ValueFactory<HyperbolicHalfspacePoint<double,3> > +{ +public: + static void get(std::vector<HyperbolicHalfspacePoint<double,3> >& values) { + + int nTestPoints = 10; + double testPoints[10][3] = {{1,0,0.01}, {0,1,0.01}, {-0.838114,0.356751,0.412667}, + {-0.490946,-0.306456,0.81551},{-0.944506,0.123687,0.304319}, + {-0.6,0.1,0.2},{0.45,0.12,0.517}, + {-0.1,0.3,0.1},{-0.444506,0.123687,0.104319},{-0.7,-0.123687,0.304319}}; + + values.resize(nTestPoints); + + // Set up elements of S^1 + for (int i=0; i<nTestPoints; i++) { + + Dune::FieldVector<double,3> w; + for (int j=0; j<3; j++) + w[j] = testPoints[i][j]; + values[i] = HyperbolicHalfspacePoint<double,3>(w); + + } + + } + +}; + + #endif \ No newline at end of file -- GitLab