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

add method to get an orthonormal frame at each point (for dim==2 only)

[[Imported from SVN: r5964]]
parent 0b5a0097
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,11 @@ public:
/** \brief The type used for coordinates */
typedef double ctype;
/** \brief Global coordinates wrt an isometric embedding function are available */
static const bool isometricallyEmbedded = true;
typedef Dune::FieldVector<double,dim-1> TangentVector;
typedef Dune::FieldVector<double,dim> EmbeddedTangentVector;
UnitVector<dim>& operator=(const Dune::FieldVector<double,dim>& vector)
......@@ -49,6 +53,17 @@ public:
return *this;
}
/** \brief The exponential map */
static UnitVector exp(const UnitVector& p, const TangentVector& v) {
Dune::FieldMatrix<double,dim-1,dim> frame = p.orthonormalFrame();
EmbeddedTangentVector ev;
frame.mtv(v,ev);
return exp(p,ev);
}
/** \brief The exponential map */
static UnitVector exp(const UnitVector& p, const EmbeddedTangentVector& v) {
......@@ -146,6 +161,23 @@ public:
return data_;
}
/** \brief Compute an orthonormal basis of the tangent space of S^n.
This basis is of course not globally continuous.
*/
Dune::FieldMatrix<double,dim-1,dim> orthonormalFrame() const {
Dune::FieldMatrix<double,dim-1,dim> result;
if (dim==2) {
result[0][0] = -data_[1];
result[0][1] = data_[0];
} else
DUNE_THROW(Dune::NotImplemented, "orthonormalFrame for dim!=2!");
return result;
}
/** \brief Write LocalKey object to output stream */
friend std::ostream& operator<< (std::ostream& s, const UnitVector& unitVector)
{
......
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