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

test method orthonormalFrame

[[Imported from SVN: r7201]]
parent 93f40364
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,17 @@ FieldMatrix<double,worldDim,worldDim> getSecondDerivativeOfSecondArgumentFD(cons
return ret2;
}
template <class TargetSpace, int worldDim>
void testOrthonormalFrame(const TargetSpace& a)
{
const size_t spaceDim = TargetSpace::dim;
FieldMatrix<double,spaceDim,worldDim> B = a.orthonormalFrame();
for (int i=0; i<spaceDim; i++)
for (int j=0; j<spaceDim; j++)
assert( std::fabs(B[i]*B[j] - (i==j)) < 1e-10 );
}
template <class TargetSpace, int dim>
void testDerivativeOfSquaredDistance(const TargetSpace& a, const TargetSpace& b)
{
......@@ -291,10 +302,13 @@ void testUnitVector2d()
// Set up elements of S^1
for (int i=0; i<nTestPoints; i++) {
Dune::array<double,2> w0 = {testPoints[i][0], testPoints[i][1]};
UnitVector<2> v0(w0);
testOrthonormalFrame<UnitVector<2>, 2>(v0);
for (int j=0; j<nTestPoints; j++) {
Dune::array<double,2> w0 = {testPoints[i][0], testPoints[i][1]};
UnitVector<2> v0(w0);
Dune::array<double,2> w1 = {testPoints[j][0], testPoints[j][1]};
UnitVector<2> v1(w1);
......@@ -319,10 +333,13 @@ void testUnitVector3d()
// Set up elements of S^1
for (int i=0; i<nTestPoints; i++) {
Dune::array<double,3> w0 = {testPoints[i][0], testPoints[i][1], testPoints[i][2]};
UnitVector<3> uv0(w0);
testOrthonormalFrame<UnitVector<3>, 3>(uv0);
for (int j=0; j<nTestPoints; j++) {
Dune::array<double,3> w0 = {testPoints[i][0], testPoints[i][1], testPoints[i][2]};
UnitVector<3> uv0(w0);
Dune::array<double,3> w1 = {testPoints[j][0], testPoints[j][1], testPoints[j][2]};
UnitVector<3> uv1(w1);
......
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