From bfb0b69c911b6e34fc3dfccfe8c787fefe310a75 Mon Sep 17 00:00:00 2001 From: Jonathan Youett <youett@mi.fu-berlin.de> Date: Mon, 17 Oct 2011 09:58:05 +0000 Subject: [PATCH] use SkewMatrix class instead of FieldVector to represent elements of the lie algebra [[Imported from SVN: r7932]] --- dune/gfe/rotation.hh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dune/gfe/rotation.hh b/dune/gfe/rotation.hh index 668675cb..0a8684e5 100644 --- a/dune/gfe/rotation.hh +++ b/dune/gfe/rotation.hh @@ -271,14 +271,14 @@ public: return exp(p, vMatrix); } - /** \brief Compute tangent vector from given basepoint and axial vector. */ - static TangentVector axialToTangentVector(const Rotation<3,T>& p, const Dune::FieldVector<T,3> axialVector) { + /** \brief Compute tangent vector from given basepoint and skew symmetric matrix. */ + static TangentVector axialToTangentVector(const Rotation<3,T>& p, const SkewMatrix<T,3>& v ) { // embedded tangent vector at identity Quaternion<T> vAtIdentity(0); - vAtIdentity[0] = 0.5*axialVector[0]; - vAtIdentity[1] = 0.5*axialVector[1]; - vAtIdentity[2] = 0.5*axialVector[2]; + vAtIdentity[0] = 0.5*v.axial()[0]; + vAtIdentity[1] = 0.5*v.axial()[1]; + vAtIdentity[2] = 0.5*v.axial()[2]; // multiply with base point to get real embedded tangent vector Quaternion<T> vQuat = p.mult(vAtIdentity); @@ -293,8 +293,8 @@ public: return tang; } - /** \brief Compute axial vector from given basepoint and tangent vector. */ - static Dune::FieldVector<T,3> tangentToAxialVector(const Rotation<3,T>& p, const TangentVector& tangent) { + /** \brief Compute skew matrix from given basepoint and tangent vector. */ + static SkewMatrix<T,3> tangentToAxialVector(const Rotation<3,T>& p, const TangentVector& tangent) { // embedded tangent vector Dune::FieldMatrix<T,3,4> basis = p.orthonormalFrame(); @@ -305,12 +305,12 @@ public: Quaternion<T> vAtIdentity = p.inverse().mult(embeddedTangent); assert( std::fabs(vAtIdentity[3]) < 1e-8 ); - Dune::FieldVector<T,3> axial; - axial[0] = 2*vAtIdentity[0]; - axial[1] = 2*vAtIdentity[1]; - axial[2] = 2*vAtIdentity[2]; + SkewMatrix<T,3> skew; + skew.axial()[0] = 2*vAtIdentity[0]; + skew.axial()[1] = 2*vAtIdentity[1]; + skew.axial()[2] = 2*vAtIdentity[2]; - return axial; + return skew; } static Rotation<3,T> exp(const Rotation<3,T>& p, const Dune::FieldVector<T,4>& v) { -- GitLab