17#include <lagrange/utils/assert.h>
23template <
typename DerivedV,
typename DerivedF,
typename DeriveddblA>
25 const Eigen::MatrixBase<DerivedV>& V,
26 const Eigen::MatrixBase<DerivedF>& F,
27 Eigen::PlainObjectBase<DeriveddblA>& dblA)
29 const auto dim = V.cols();
30 const auto m = F.rows();
39 Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 3> l;
42 const auto& proj_doublearea = [&V, &F](Eigen::Index x, Eigen::Index y, Eigen::Index f) ->
43 typename DerivedV::Scalar {
44 auto rx = V(F(f, 0), x) - V(F(f, 2), x);
45 auto sx = V(F(f, 1), x) - V(F(f, 2), x);
46 auto ry = V(F(f, 0), y) - V(F(f, 2), y);
47 auto sy = V(F(f, 1), y) - V(F(f, 2), y);
48 return rx * sy - ry * sx;
53 dblA = DeriveddblA::Zero(m, 1);
54 for (Eigen::Index f = 0; f < m; f++) {
55 for (
int d = 0; d < 3; d++) {
56 const auto dblAd = proj_doublearea(d, (d + 1) % 3, f);
57 dblA(f) += dblAd * dblAd;
60 dblA = dblA.array().sqrt().eval();
65 for (Eigen::Index f = 0; f < m; f++) {
66 dblA(f) = proj_doublearea(0, 1, f);
#define la_runtime_assert(...)
Runtime assertion check.
Definition: assert.h:169
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array,...
Definition: attribute_string_utils.h:21