massmatrix_intrinsic.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 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 IGL_MASSMATRIX_INTRINSIC_H
  9. #define IGL_MASSMATRIX_INTRINSIC_H
  10. #include "igl_inline.h"
  11. #include "massmatrix.h"
  12. #include <Eigen/Dense>
  13. #include <Eigen/Sparse>
  14. namespace igl
  15. {
  16. /// Constructs the mass (area) matrix for a given mesh (V,F).
  17. ///
  18. /// @param[in] l #l by simplex_size list of mesh edge lengths
  19. /// @param[in] F #F by simplex_size list of mesh elements (triangles or tetrahedra)
  20. /// @param[in] type one of the following ints:
  21. /// MASSMATRIX_TYPE_BARYCENTRIC barycentric
  22. /// MASSMATRIX_TYPE_VORONOI voronoi-hybrid {default}
  23. /// MASSMATRIX_TYPE_FULL full
  24. /// @param[out] M #V by #V mass matrix
  25. ///
  26. /// \see massmatrix
  27. ///
  28. template <typename Derivedl, typename DerivedF, typename Scalar>
  29. IGL_INLINE void massmatrix_intrinsic(
  30. const Eigen::MatrixBase<Derivedl> & l,
  31. const Eigen::MatrixBase<DerivedF> & F,
  32. const MassMatrixType type,
  33. Eigen::SparseMatrix<Scalar>& M);
  34. /// \overload
  35. /// @param[in] n number of vertices (>= F.maxCoeff()+1)
  36. template <typename Derivedl, typename DerivedF, typename Scalar>
  37. IGL_INLINE void massmatrix_intrinsic(
  38. const Eigen::MatrixBase<Derivedl> & l,
  39. const Eigen::MatrixBase<DerivedF> & F,
  40. const MassMatrixType type,
  41. const int n,
  42. Eigen::SparseMatrix<Scalar>& M);
  43. }
  44. #ifndef IGL_STATIC_LIBRARY
  45. # include "massmatrix_intrinsic.cpp"
  46. #endif
  47. #endif