11 , m_coordinate_handle(coordinate)
16 assert(
mesh().top_cell_dimension() == 2);
46 const double h0 = ((p0 - p2).cross(p0 - p3)).norm() / (p2 - p3).norm();
47 const double h1 = ((p1 - p2).cross(p1 - p3)).norm() / (p2 - p3).norm();
48 const double h2 = ((p2 - p0).cross(p2 - p1)).norm() / (p0 - p1).norm();
49 const double h3 = ((p3 - p0).cross(p3 - p1)).norm() / (p0 - p1).norm();
51 const double min_old = std::min(h2, h3);
52 const double min_new = std::min(h0, h1);
54 if (((p0 - p1).norm() * h2 / 2) < 1e-10 || ((p0 - p1).norm() * h3 / 2) < 1e-10) {
55 if (((p2 - p3).norm() * h0 / 2) > 1e-10 && ((p2 - p3).norm() * h1 / 2) > 1e-10) {
60 return min_old < min_new;
const attribute::Accessor< T, Mesh, D > create_const_accessor(const attribute::MeshAttributeHandle &handle) const
Tuple switch_tuples(const Tuple &tuple, const ContainerType &op_sequence) const
virtual Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const =0
switch the orientation of the Tuple of the given dimension
bool before(const simplex::Simplex &t) const override
Swap2dEdgeLengthInvariant(const Mesh &m, const attribute::TypedAttributeHandle< double > &coordinate)
const attribute::TypedAttributeHandle< double > m_coordinate_handle
const Mesh & mesh() const
const Tuple & tuple() const
constexpr wmtk::PrimitiveType PF
constexpr PrimitiveType PV
Vector< double, 3 > Vector3d
constexpr PrimitiveType PE