Skip to content
Snippets Groups Projects
Commit ec888c76 authored by Sander, Oliver's avatar Sander, Oliver
Browse files

LocalGeodesicFEStiffness is an abstract base class now

parent ab19f673
No related branches found
No related tags found
No related merge requests found
...@@ -27,22 +27,12 @@ public: ...@@ -27,22 +27,12 @@ public:
//! Dimension of the embedding space //! Dimension of the embedding space
enum { embeddedBlocksize = TargetSpace::EmbeddedTangentVector::dimension }; enum { embeddedBlocksize = TargetSpace::EmbeddedTangentVector::dimension };
/** \brief Assemble the local stiffness matrix at the current position /** \brief Assemble the local gradient and stiffness matrix at the current position
This default implementation used finite-difference approximations to compute the second derivatives
The formula for the Riemannian Hessian has been taken from Absil, Mahony, Sepulchre:
'Optimization algorithms on matrix manifolds', page 107. There it says that
\f[
\langle Hess f(x)[\xi], \eta \rangle
= \frac 12 \frac{d^2}{dt^2} \Big(f(\exp_x(t(\xi + \eta))) - f(\exp_x(t\xi)) - f(\exp_x(t\eta))\Big)\Big|_{t=0}.
\f]
We compute that using a finite difference approximation.
*/ */
virtual void assembleGradientAndHessian(const typename Basis::LocalView& localView, virtual void assembleGradientAndHessian(const typename Basis::LocalView& localView,
const std::vector<TargetSpace>& localSolution, const std::vector<TargetSpace>& localSolution,
std::vector<typename TargetSpace::TangentVector>& localGradient); std::vector<typename TargetSpace::TangentVector>& localGradient) = 0;
/** \brief Compute the energy at the current configuration */ /** \brief Compute the energy at the current configuration */
virtual RT energy (const typename Basis::LocalView& localView, virtual RT energy (const typename Basis::LocalView& localView,
...@@ -53,35 +43,12 @@ public: ...@@ -53,35 +43,12 @@ public:
The default implementation in this class uses a finite difference approximation */ The default implementation in this class uses a finite difference approximation */
virtual void assembleGradient(const typename Basis::LocalView& localView, virtual void assembleGradient(const typename Basis::LocalView& localView,
const std::vector<TargetSpace>& solution, const std::vector<TargetSpace>& solution,
std::vector<typename TargetSpace::TangentVector>& gradient) const; std::vector<typename TargetSpace::TangentVector>& gradient) const = 0;
// assembled data // assembled data
Dune::Matrix<Dune::FieldMatrix<RT,blocksize,blocksize> > A_; Dune::Matrix<Dune::FieldMatrix<RT,blocksize,blocksize> > A_;
}; };
template <class Basis, class TargetSpace>
void LocalGeodesicFEStiffness<Basis, TargetSpace>::
assembleGradient(const typename Basis::LocalView& localView,
const std::vector<TargetSpace>& localSolution,
std::vector<typename TargetSpace::TangentVector>& localGradient) const
{
DUNE_THROW(Dune::NotImplemented, "!");
}
// ///////////////////////////////////////////////////////////
// Compute gradient by finite-difference approximation
// ///////////////////////////////////////////////////////////
template <class Basis, class TargetSpace>
void LocalGeodesicFEStiffness<Basis, TargetSpace>::
assembleGradientAndHessian(const typename Basis::LocalView& localView,
const std::vector<TargetSpace>& localSolution,
std::vector<typename TargetSpace::TangentVector>& localGradient)
{
DUNE_THROW(Dune::NotImplemented, "!");
}
#endif #endif
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