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

second derivatives of exp

[[Imported from SVN: r1699]]
parent 473dd552
No related branches found
No related tags found
No related merge requests found
...@@ -109,6 +109,45 @@ public: ...@@ -109,6 +109,45 @@ public:
return result; return result;
} }
static void DDexp(const Dune::FieldVector<T,3>& v,
Dune::array<Dune::FieldMatrix<T,3,3>, 4>& result) {
T norm = v.two_norm();
if (norm==0) {
for (int m=0; m<4; m++)
result[m] = 0;
for (int i=0; i<3; i++)
result[3][i][i] = -0.25;
} else {
for (int i=0; i<3; i++) {
for (int j=0; j<3; j++) {
for (int m=0; m<3; m++) {
result[m][i][j] = -0.25*v[i]*v[j]*v[m]*norm*norm*norm*std::sin(norm/2)
+ 0.5 / (norm*norm) * ((i==j)*v[m] + (j==m)*v[i] + (i==m)*v[j] - 3*v[i]*v[j]*v[m]/(norm*norm))
* (std::cos(norm/2) - sincHalf(norm));
}
result[3][i][j] = -0.25/(norm*norm)
* ( 0.5*std::cos(norm/2)*v[i]*v[j] + std::sin(norm/2) * ((i==j)*norm - v[i]*v[j]/norm));
}
}
}
}
/** \brief The inverse of the exponential map */ /** \brief The inverse of the exponential map */
static Dune::FieldVector<T,3> expInv(const Quaternion<T>& q) { static Dune::FieldVector<T,3> expInv(const Quaternion<T>& q) {
// Compute v = exp^{-1} q // Compute v = exp^{-1} q
......
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