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

a test to compare SO(2) and S^1, which should be the same, but implemented differently

[[Imported from SVN: r5919]]
parent a18108b6
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ LDADD = $(UG_LDFLAGS) $(AMIRAMESH_LDFLAGS) $(UG_LIBS) $(AMIRAMESH_LIBS)
AM_CPPFLAGS += $(UG_CPPFLAGS) $(AMIRAMESH_CPPFLAGS) -Wall
check_PROGRAMS = frameinvariancetest rotationtest fdcheck localgeodesicfefunctiontest \
harmonicenergytest averagedistanceassemblertest
harmonicenergytest averagedistanceassemblertest unitcircletest
frameinvariancetest_SOURCES = frameinvariancetest.cc
......@@ -19,6 +19,8 @@ harmonicenergytest_SOURCES = harmonicenergytest.cc
averagedistanceassemblertest_SOURCES = averagedistanceassemblertest.cc
unitcircletest_SOURCES = unitcircletest.cc
# don't follow the full GNU-standard
# we need automake 1.5
AUTOMAKE_OPTIONS = foreign 1.5
#include <config.h>
#include <dune/src/unitvector.hh>
#include <dune/src/rotation.hh>
using namespace Dune;
int main()
{
// Set up elements of S^1
FieldVector<double,2> v;
v[0] = 1; v[1] = 1;
UnitVector<2> uv1; uv1 = v;
v[0] = 0; v[1] = 1;
UnitVector<2> uv0; uv0 = v;
// Set up elements of SO(2)
Rotation<2,double> ro1(M_PI/4);
Rotation<2,double> ro0(M_PI/2);
std::cout << UnitVector<2>::distance(uv0, uv1) << std::endl;
std::cout << Rotation<2,double>::distance(ro0, ro1) << std::endl;
std::cout << UnitVector<2>::derivativeOfDistanceSquaredWRTSecondArgument(uv0, uv1) << std::endl;
std::cout << Rotation<2,double>::derivativeOfDistanceSquaredWRTSecondArgument(ro0, ro1) << std::endl;
std::cout << UnitVector<2>::secondDerivativeOfDistanceSquaredWRTSecondArgument(uv0, uv1) << std::endl;
std::cout << Rotation<2,double>::secondDerivativeOfDistanceSquaredWRTSecondArgument(ro0, ro1) << std::endl;
}
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