diff --git a/dune/gfe/unitvector.hh b/dune/gfe/unitvector.hh index a8cd3287a8b7e70271158fdaa45075a7e41542f1..a7be1603cb7218bf05ad44422c80b5eff80b3342 100644 --- a/dune/gfe/unitvector.hh +++ b/dune/gfe/unitvector.hh @@ -6,6 +6,10 @@ #include <dune/gfe/tensor3.hh> +/** \brief A unit vector in R^dim + + \tparam dim Dimension of the embedding space +*/ template <int dim> class UnitVector { @@ -280,13 +284,16 @@ public: This basis is of course not globally continuous. */ - Dune::FieldMatrix<double,dim-1,dim> orthonormalFrame() const { + Dune::FieldMatrix<double,dim,dim> orthonormalFrame() const { - Dune::FieldMatrix<double,dim-1,dim> result; + Dune::FieldMatrix<double,dim,dim> result; if (dim==2) { + // spans the tangent space result[0][0] = -data_[1]; result[0][1] = data_[0]; + // spans the normal space + result[1] = data_; } else DUNE_THROW(Dune::NotImplemented, "orthonormalFrame for dim!=2!");