diff --git a/dune/gfe/rotation.hh b/dune/gfe/rotation.hh index 5d8cd68ac81baba1fcfb65c79abe059da8904554..e0ac46af0995e35a4e98f430c7a6718201130cb3 100644 --- a/dune/gfe/rotation.hh +++ b/dune/gfe/rotation.hh @@ -198,6 +198,21 @@ public: (*this)[3] = std::cos(angle/2); } + /** \brief Rebind the Rotation to another coordinate type */ + template<class U> + struct rebind + { + typedef Rotation<U,3> other; + }; + + /** \brief Assigment from RigidBodyMotion with different type -- used for automatic differentiation with ADOL-C */ + template <class T2> + Rotation& operator <<= (const Rotation<T2,3>& other) { + for (int i=0; i<4; i++) + (*this)[i] <<= other[i]; + return *this; + } + /** \brief Return the identity element */ static Rotation<T,3> identity() { // Default constructor creates an identity