crouzeix_raviart_massmatrix.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <[email protected]>
  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 CROUZEIX_RAVIART_MASSMATRIX_H
  9. #define CROUZEIX_RAVIART_MASSMATRIX_H
  10. #include <Eigen/Dense>
  11. #include <Eigen/Sparse>
  12. namespace igl
  13. {
  14. /// CROUZEIX_RAVIART_MASSMATRIX Compute the Crouzeix-Raviart mass matrix where
  15. /// M(e,e) is just the sum of the areas of the triangles on either side of an
  16. /// edge e.
  17. ///
  18. /// See for example "Discrete Quadratic Curvature Energies" [Wardetzky, Bergou,
  19. /// Harmon, Zorin, Grinspun 2007]
  20. ///
  21. /// @param[in] V #V by dim list of vertex positions
  22. /// @param[in] F #F by 3/4 list of triangle/tetrahedron indices
  23. /// @param[out] M #E by #E edge/face-based diagonal mass matrix
  24. /// @param[out] E #E by 2/3 list of edges/faces
  25. /// @param[out] EMAP #F*3/4 list of indices mapping allE to E
  26. ///
  27. /// \see crouzeix_raviart_cotmatrix
  28. template <typename MT, typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP>
  29. void crouzeix_raviart_massmatrix(
  30. const Eigen::MatrixBase<DerivedV> & V,
  31. const Eigen::MatrixBase<DerivedF> & F,
  32. Eigen::SparseMatrix<MT> & M,
  33. Eigen::PlainObjectBase<DerivedE> & E,
  34. Eigen::PlainObjectBase<DerivedEMAP> & EMAP);
  35. /// CROUZEIX_RAVIART_MASSMATRIX Compute the Crouzeix-Raviart mass matrix where
  36. /// M(e,e) is just the sum of the areas of the triangles on either side of an
  37. /// edge e.
  38. ///
  39. /// See for example "Discrete Quadratic Curvature Energies" [Wardetzky, Bergou,
  40. /// Harmon, Zorin, Grinspun 2007]
  41. ///
  42. /// @param[in] V #V by dim list of vertex positions
  43. /// @param[in] F #F by 3/4 list of triangle/tetrahedron indices
  44. /// @param[in] E #E by 2/3 list of edges/faces
  45. /// @param[in] EMAP #F*3/4 list of indices mapping allE to E
  46. /// @param[out] M #E by #E edge/face-based diagonal mass matrix
  47. ///
  48. /// \see crouzeix_raviart_cotmatrix
  49. template <typename MT, typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP>
  50. void crouzeix_raviart_massmatrix(
  51. const Eigen::MatrixBase<DerivedV> & V,
  52. const Eigen::MatrixBase<DerivedF> & F,
  53. const Eigen::MatrixBase<DerivedE> & E,
  54. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  55. Eigen::SparseMatrix<MT> & M);
  56. }
  57. #ifndef IGL_STATIC_LIBRARY
  58. # include "crouzeix_raviart_massmatrix.cpp"
  59. #endif
  60. #endif