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

Hack around an inconsistency between Rotation<3> and other target spaces,

notably the almost-equivalent UnitVector<4>: A vector with three entries
is interpreted by the UnitVector<4> class as a tangent vector given in
the basis returned by orthonormalFrame.  That is correct as it works
for all kinds of manifolds.  On the other hand, the Rotation<3> class
interprets as a 3x3 skew matrix (a tangent vector at the identity in
the matrix representation) even though the implementation used quaternion
coordinates.

To trick around this the use of exp methods with FieldVector<3> is avoided
by this patch.  A real fix would involve introducing a SkewMatrix class
and using that in Rotation<3>.

[[Imported from SVN: r7575]]
parent 5affcea4
No related branches found
No related tags found
No related merge requests found
......@@ -342,8 +342,17 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
// ////////////////////////////////////////////////////
SolutionType newIterate = x_;
#if 0 // out-commented until the Rotation class can distinguish skew-symmetric matrices from three-vectors
for (int j=0; j<newIterate.size(); j++)
newIterate[j] = TargetSpace::exp(newIterate[j], corr[j]);
#else
for (int j=0; j<newIterate.size(); j++) {
Dune::FieldMatrix<double,TargetSpace::TangentVector::size,TargetSpace::EmbeddedTangentVector::size> B = x_[j].orthonormalFrame();
Dune::FieldVector<double,TargetSpace::EmbeddedTangentVector::size> embeddedCorr(0);
B.mtv(corr[j], embeddedCorr);
newIterate[j] = TargetSpace::exp(newIterate[j], embeddedCorr);
}
#endif
double energy = assembler_->computeEnergy(newIterate);
......
......@@ -107,7 +107,15 @@ void TargetSpaceRiemannianTRSolver<TargetSpace,N>::solve()
// ////////////////////////////////////////////////////
TargetSpace newIterate = x_;
#if 0 // out-commented until the Rotation class can distinguish skew-symmetric matrices from three-vectors
newIterate = TargetSpace::exp(newIterate, corr[0]);
#else
Dune::FieldMatrix<double,TargetSpace::TangentVector::size,TargetSpace::EmbeddedTangentVector::size> B = x_.orthonormalFrame();
Dune::FieldVector<double,TargetSpace::EmbeddedTangentVector::size> embeddedCorr(0);
B.mtv(corr[0], embeddedCorr);
newIterate = TargetSpace::exp(newIterate, embeddedCorr);
#endif
/** \todo Don't always recompute oldEnergy */
double oldEnergy = assembler_->value(x_);
......
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