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

make sure diameter of test set is bounded

[[Imported from SVN: r8043]]
parent 047ea758
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,18 @@ const double eps = 1e-6; ...@@ -20,6 +20,18 @@ const double eps = 1e-6;
using namespace Dune; using namespace Dune;
/** \brief Computes the diameter of a set */
template <class TargetSpace>
double diameter(const std::vector<TargetSpace>& v)
{
double d = 0;
for (size_t i=0; i<v.size(); i++)
for (size_t j=0; j<v.size(); j++)
d = std::max(d, TargetSpace::distance(v[i],v[j]));
return d;
}
template <int domainDim> template <int domainDim>
void testDerivativeTangentiality(const RealTuple<1>& x, void testDerivativeTangentiality(const RealTuple<1>& x,
const FieldMatrix<double,1,domainDim>& derivative) const FieldMatrix<double,1,domainDim>& derivative)
...@@ -354,6 +366,9 @@ void test() ...@@ -354,6 +366,9 @@ void test()
for (int j=0; j<domainDim+1; j++) for (int j=0; j<domainDim+1; j++)
corners[j] = testPoints[index[j]]; corners[j] = testPoints[index[j]];
if (diameter(corners) > 0.5*M_PI)
continue;
//testPermutationInvariance(corners); //testPermutationInvariance(corners);
testDerivative<domainDim>(corners); testDerivative<domainDim>(corners);
......
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