crouzeix_raviart_cotmatrix.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef IGL_CROUZEIX_RAVIART_COTMATRIX
  2. #define IGL_CROUZEIX_RAVIART_COTMATRIX
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <Eigen/Sparse>
  6. namespace igl
  7. {
  8. // CROUZEIX_RAVIART_COTMATRIX Compute the Crouzeix-Raviart cotangent
  9. // stiffness matrix.
  10. //
  11. // See for example "Discrete Quadratic Curvature Energies" [Wardetzky, Bergou,
  12. //
  13. // Harmon, Zorin, Grinspun 2007]
  14. // Inputs:
  15. // V #V by dim list of vertex positions
  16. // F #F by 3 list of triangle indices
  17. // Outputs:
  18. // L #E by #E edge-based diagonal cotangent matrix
  19. // E #E by 2 list of edges
  20. // EMAP #F*3 list of indices mapping allE to E
  21. //
  22. template <typename DerivedV, typename DerivedF, typename LT, typename DerivedE, typename DerivedEMAP>
  23. void crouzeix_raviart_cotmatrix(
  24. const Eigen::MatrixBase<DerivedV> & V,
  25. const Eigen::MatrixBase<DerivedF> & F,
  26. Eigen::SparseMatrix<LT> & L,
  27. Eigen::PlainObjectBase<DerivedE> & E,
  28. Eigen::PlainObjectBase<DerivedEMAP> & EMAP);
  29. // wrapper if E and EMAP are already computed (better match!)
  30. template <typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP, typename LT>
  31. void crouzeix_raviart_cotmatrix(
  32. const Eigen::MatrixBase<DerivedV> & V,
  33. const Eigen::MatrixBase<DerivedF> & F,
  34. const Eigen::MatrixBase<DerivedE> & E,
  35. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  36. Eigen::SparseMatrix<LT> & L);
  37. }
  38. #ifndef IGL_STATIC_LIBRARY
  39. # include "crouzeix_raviart_cotmatrix.cpp"
  40. #endif
  41. #endif