hessian_energy.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2017 Alec Jacobson <alecjacobson@gmail.com> and Oded Stein <oded.stein@columbia.edu>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_HESSIAN_ENERGY_H
  9. #define IGL_HESSIAN_ENERGY_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. // Constructs the Hessian energy matrix using mixed FEM
  16. // as described in https://arxiv.org/abs/1707.04348
  17. // Natural Boundary Conditions for Smoothing in Geometry Processing
  18. // (Oded Stein, Eitan Grinspun, Max Wardetzky, Alec Jacobson)
  19. //
  20. // Inputs:
  21. // V #V by dim list of mesh vertex positions
  22. // F #F by 3 list of mesh faces (must be triangles)
  23. // Outputs:
  24. // Q #V by #V Hessian energy matrix, each row/column i corresponding to V(i,:)
  25. //
  26. //
  27. //
  28. template <typename DerivedV, typename DerivedF, typename Scalar>
  29. IGL_INLINE void hessian_energy(
  30. const Eigen::MatrixBase<DerivedV> & V,
  31. const Eigen::MatrixBase<DerivedF> & F,
  32. Eigen::SparseMatrix<Scalar>& Q);
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "hessian_energy.cpp"
  36. #endif
  37. #endif