hessian.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2017 Alec Jacobson <[email protected]>
  4. // and Oded Stein <[email protected]>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla Public License
  7. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  8. // obtain one at http://mozilla.org/MPL/2.0/.
  9. #ifndef IGL_HESSIAN_H
  10. #define IGL_HESSIAN_H
  11. #include "igl_inline.h"
  12. #include <Eigen/Dense>
  13. #include <Eigen/Sparse>
  14. namespace igl
  15. {
  16. /// Constructs the finite element Hessian matrix
  17. /// as described in https://arxiv.org/abs/1707.04348,
  18. /// Natural Boundary Conditions for Smoothing in Geometry Processing
  19. /// (Oded Stein, Eitan Grinspun, Max Wardetzky, Alec Jacobson)
  20. /// The interior vertices are NOT set to zero yet.
  21. ///
  22. /// @param[in] V #V by dim list of mesh vertex positions
  23. /// @param[in] F #F by 3 list of mesh faces (must be triangles)
  24. /// @param[out] H dim²⋅#V by #V Hessian matrix, each column i
  25. /// corresponding to V(i,:)
  26. ///
  27. ///
  28. /// \see curved_hessian_energy, hessian_energy
  29. ///
  30. template <typename DerivedV, typename DerivedF, typename Scalar>
  31. IGL_INLINE void hessian(
  32. const Eigen::MatrixBase<DerivedV> & V,
  33. const Eigen::MatrixBase<DerivedF> & F,
  34. Eigen::SparseMatrix<Scalar>& H);
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. # include "hessian.cpp"
  38. #endif
  39. #endif