14#include <lagrange/SurfaceMesh.h>
17#include <Eigen/Sparse>
19namespace lagrange::polyddg {
36template <
typename Scalar,
typename Index>
40 using Vector = Eigen::Matrix<Scalar, 1, 3>;
59 Eigen::SparseMatrix<Scalar>
gradient()
const;
69 Eigen::SparseMatrix<Scalar>
d0()
const;
79 Eigen::SparseMatrix<Scalar>
d1()
const;
89 Eigen::SparseMatrix<Scalar>
star0()
const;
99 Eigen::SparseMatrix<Scalar>
star1()
const;
109 Eigen::SparseMatrix<Scalar>
star2()
const;
121 Eigen::SparseMatrix<Scalar>
flat()
const;
131 Eigen::SparseMatrix<Scalar>
sharp()
const;
141 Eigen::SparseMatrix<Scalar>
projection()
const;
195 Eigen::SparseMatrix<Scalar>
curl()
const;
328 Eigen::Matrix<Scalar, 3, Eigen::Dynamic>
gradient(Index fid)
const;
341 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
d0(Index fid)
const;
354 Eigen::Matrix<Scalar, 1, Eigen::Dynamic>
d1(Index fid)
const;
367 Eigen::Matrix<Scalar, Eigen::Dynamic, 3>
flat(Index fid)
const;
380 Eigen::Matrix<Scalar, 3, Eigen::Dynamic>
sharp(Index fid)
const;
393 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
projection(Index fid)
const;
448 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
laplacian(Index fid,
Scalar lambda = 1)
460 Eigen::Matrix<Scalar, 2, 2>
levi_civita(Index fid, Index lv)
const;
475 Eigen::Matrix<Scalar, 2, 2>
levi_civita_nrosy(Index fid, Index lv, Index n)
const;
488 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
levi_civita(Index fid)
const;
505 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
levi_civita_nrosy(Index fid, Index n)
604 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
611 void compute_vertex_normal_from_vector_area();
621 Eigen::Matrix<Scalar, 3, 2>
facet_basis(Index fid)
const;
630 Eigen::Matrix<Scalar, 3, 2>
vertex_basis(Index vid)
const;
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
Eigen::Matrix< Scalar, 3, 2 > vertex_basis(Index vid) const
Compute the local tangent basis for a single vertex.
Definition DifferentialOperators.cpp:1200
Eigen::SparseMatrix< Scalar > divergence(Scalar lambda=1) const
Compute the discrete divergence operator.
Definition DifferentialOperators.cpp:492
Eigen::SparseMatrix< Scalar > levi_civita_nrosy(Index n) const
Compute the discrete Levi-Civita connection for n-rosy fields.
Definition DifferentialOperators.cpp:625
Eigen::SparseMatrix< Scalar > projection() const
Compute the projection operator.
Definition DifferentialOperators.cpp:385
Eigen::SparseMatrix< Scalar > d1() const
Compute the discrete d1 operator.
Definition DifferentialOperators.cpp:197
DifferentialOperators(SurfaceMesh< Scalar, Index > &mesh)
Precomputes necessary attributes for the differential operators.
Definition DifferentialOperators.cpp:105
AttributeId get_vector_area_attribute_id() const
Get the attribute ID for the per-facet vector area.
Definition DifferentialOperators.h:638
Eigen::SparseMatrix< Scalar > covariant_derivative_nrosy(Index n) const
Compute the discrete covariant derivative operator for n-rosy fields.
Definition DifferentialOperators.cpp:674
Eigen::SparseMatrix< Scalar > connection_laplacian_nrosy(Index n, Scalar lambda=1) const
Compute the connection Laplacian operator for n-rosy fields.
Definition DifferentialOperators.cpp:740
Eigen::Matrix< Scalar, 3, 2 > facet_basis(Index fid) const
Compute the local tangent basis for a single facet.
Definition DifferentialOperators.cpp:1166
Eigen::SparseMatrix< Scalar > d0() const
Compute the discrete d0 operator.
Definition DifferentialOperators.cpp:172
Eigen::SparseMatrix< Scalar > sharp() const
Compute the discrete sharp operator.
Definition DifferentialOperators.cpp:337
Eigen::SparseMatrix< Scalar > vertex_tangent_coordinates() const
Compute the coordinate transformation that maps a per-vertex tangent vector field expressed in the gl...
Definition DifferentialOperators.cpp:540
Eigen::SparseMatrix< Scalar > star1() const
Compute the discrete Hodge star operator for 1-form.
Definition DifferentialOperators.cpp:237
Eigen::SparseMatrix< Scalar > inner_product_1_form(Scalar lambda=1) const
Compute the discrete inner product operator for 1-forms.
Definition DifferentialOperators.cpp:430
Eigen::SparseMatrix< Scalar > star2() const
Compute the discrete Hodge star operator for 2-form.
Definition DifferentialOperators.cpp:281
Eigen::SparseMatrix< Scalar > flat() const
Compute the discrete flat operator.
Definition DifferentialOperators.cpp:289
Eigen::SparseMatrix< Scalar > laplacian(Scalar lambda=1) const
Compute the discrete Laplacian operator.
Definition DifferentialOperators.cpp:531
Eigen::SparseMatrix< Scalar > connection_laplacian(Scalar lambda=1) const
Compute the connection Laplacian operator.
Definition DifferentialOperators.cpp:732
Eigen::SparseMatrix< Scalar > curl() const
Compute the discrete curl operator.
Definition DifferentialOperators.cpp:501
Eigen::SparseMatrix< Scalar > levi_civita() const
Compute the discrete Levi-Civita connection.
Definition DifferentialOperators.cpp:618
Eigen::SparseMatrix< Scalar > inner_product_0_form() const
Compute the discrete inner product operator for 0-forms.
Definition DifferentialOperators.cpp:398
Eigen::SparseMatrix< Scalar > covariant_derivative() const
Compute the discrete covariant derivative operator.
Definition DifferentialOperators.cpp:667
Eigen::SparseMatrix< Scalar > inner_product_2_form() const
Compute the discrete inner product operator for 2-forms.
Definition DifferentialOperators.cpp:470
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > covariant_projection(Index fid) const
Compute the discrete covariant projection operator for a single facet.
Definition DifferentialOperators.cpp:1091
Eigen::SparseMatrix< Scalar > gradient() const
Compute the discrete polygonal gradient operator.
Definition DifferentialOperators.cpp:122
Eigen::SparseMatrix< Scalar > facet_tangent_coordinates() const
Compute the coordinate transformation that maps a per-facet tangent vector field expressed in the glo...
Definition DifferentialOperators.cpp:579
AttributeId get_vertex_normal_attribute_id() const
Get the attribute ID for the per-vertex normal.
Definition DifferentialOperators.h:652
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > covariant_projection_nrosy(Index fid, Index n) const
Compute the discrete covariant projection operator for a single facet for n-rosy fields.
Definition DifferentialOperators.cpp:1099
Eigen::SparseMatrix< Scalar > star0() const
Compute the discrete Hodge star operator for 0-form.
Definition DifferentialOperators.cpp:230
AttributeId get_centroid_attribute_id() const
Get the attribute ID for the per-facet centroid.
Definition DifferentialOperators.h:645
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
constexpr AttributeId invalid_attribute_id()
Invalid attribute id.
Definition AttributeFwd.h:76
@ Scalar
Mesh attribute must have exactly 1 channel.
Definition AttributeFwd.h:56