diff --git a/components/wildmeshing/wmtk/components/wildmeshing/internal/wildmeshing2d.cpp b/components/wildmeshing/wmtk/components/wildmeshing/internal/wildmeshing2d.cpp index d58c937bdf..9d46318801 100644 --- a/components/wildmeshing/wmtk/components/wildmeshing/internal/wildmeshing2d.cpp +++ b/components/wildmeshing/wmtk/components/wildmeshing/internal/wildmeshing2d.cpp @@ -85,7 +85,10 @@ using namespace invariants; std::vector, std::string>> wildmeshing2d( const WildMeshingOptions& options) { - auto mesh = options.input_mesh; + auto mesh = std::dynamic_pointer_cast(options.input_mesh); + if(!bool(mesh)) { + throw std::runtime_error("input mesh of wildmeshing3d must be a trimesh"); + } if (!mesh->is_connectivity_valid()) { throw std::runtime_error("input mesh for wildmeshing connectivity invalid"); diff --git a/components/wildmeshing/wmtk/components/wildmeshing/internal/wildmeshing3d.cpp b/components/wildmeshing/wmtk/components/wildmeshing/internal/wildmeshing3d.cpp index 89096a93f6..b87b24567f 100644 --- a/components/wildmeshing/wmtk/components/wildmeshing/internal/wildmeshing3d.cpp +++ b/components/wildmeshing/wmtk/components/wildmeshing/internal/wildmeshing3d.cpp @@ -88,7 +88,10 @@ using namespace invariants; std::vector, std::string>> wildmeshing3d( const WildMeshingOptions& options) { - auto mesh = options.input_mesh; + auto mesh = std::dynamic_pointer_cast(options.input_mesh); + if(!bool(mesh)) { + throw std::runtime_error("input mesh of wildmeshing3d must be a tetmesh"); + } if (!mesh->is_connectivity_valid()) { throw std::runtime_error("input mesh for wildmeshing connectivity invalid"); @@ -1775,4 +1778,4 @@ void set_operation_energy_filter_after_sizing_field( } -} // namespace wmtk::components::internal \ No newline at end of file +} // namespace wmtk::components::internal diff --git a/src/wmtk/EdgeMesh.hpp b/src/wmtk/EdgeMesh.hpp index 692d1eecb6..171908a420 100644 --- a/src/wmtk/EdgeMesh.hpp +++ b/src/wmtk/EdgeMesh.hpp @@ -44,6 +44,7 @@ class EdgeMesh : public MeshCRTP Eigen::Ref EE, Eigen::Ref VE); + using Mesh::is_valid; bool is_valid(const Tuple& tuple) const final override; bool is_connectivity_valid() const override; diff --git a/src/wmtk/Mesh.cpp b/src/wmtk/Mesh.cpp index 06cfe8a746..8813d2f8c5 100644 --- a/src/wmtk/Mesh.cpp +++ b/src/wmtk/Mesh.cpp @@ -38,7 +38,7 @@ simplex::IdSimplex Mesh::get_id_simplex(const simplex::Simplex& s) const simplex::Simplex Mesh::get_simplex(const simplex::IdSimplex& s) const { const Tuple& t = tuple_from_id(s.primitive_type(), s.index()); - return simplex::Simplex(*this, s.primitive_type(), t); + return simplex::Simplex(s.primitive_type(), t); } Tuple Mesh::get_tuple_from_id_simplex(const simplex::IdSimplex& s) const @@ -112,7 +112,16 @@ bool Mesh::is_boundary(const simplex::Simplex& s) const bool Mesh::is_valid(const Tuple& tuple) const { - return !tuple.is_null() && !is_removed(tuple); + const bool nullity = tuple.is_null(); + const bool removed = is_removed(tuple); + const bool bad = nullity || removed; +#if !defined(NDEBUG) + if(bad) { + logger().trace("Mesh::is_valid failed, got nullity:{} removedness:{}", nullity, removed); + + } +#endif + return !bad; } bool Mesh::is_removed(const Tuple& tuple) const @@ -143,16 +152,7 @@ bool Mesh::is_removed(int64_t index, PrimitiveType pt) const bool Mesh::is_valid(const simplex::Simplex& s) const { -#if defined(WMTK_ENABLE_SIMPLEX_ID_CACHING) - if (!is_valid(s.tuple())) { - return false; - } else { - const int64_t id_tuple = id(s.tuple(), s.primitive_type()); - return id_tuple == s.m_index; - } -#else return is_valid(s.tuple()) && !is_removed(s.tuple(), s.primitive_type()); -#endif } diff --git a/src/wmtk/Mesh.hpp b/src/wmtk/Mesh.hpp index e850800167..0e554639a7 100644 --- a/src/wmtk/Mesh.hpp +++ b/src/wmtk/Mesh.hpp @@ -29,6 +29,7 @@ #include "multimesh/attribute/UseParentScopeRAII.hpp" + #include "simplex/IdSimplex.hpp" #include "simplex/NavigatableSimplex.hpp" #include "simplex/Simplex.hpp" diff --git a/src/wmtk/TetMesh.hpp b/src/wmtk/TetMesh.hpp index ff17b83e65..30422a9053 100644 --- a/src/wmtk/TetMesh.hpp +++ b/src/wmtk/TetMesh.hpp @@ -34,6 +34,7 @@ class TetMesh : public MeshCRTP bool is_boundary_edge(const Tuple& tuple) const; bool is_boundary_face(const Tuple& tuple) const; + using Mesh::is_valid; bool is_valid(const Tuple& tuple) const final override; void initialize( diff --git a/src/wmtk/TriMesh.hpp b/src/wmtk/TriMesh.hpp index 57aa8d5730..532e929674 100644 --- a/src/wmtk/TriMesh.hpp +++ b/src/wmtk/TriMesh.hpp @@ -54,6 +54,7 @@ class TriMesh : public MeshCRTP void initialize(Eigen::Ref F, bool make_free = false); void initialize_free(int64_t count); + using Mesh::is_valid; bool is_valid(const Tuple& tuple) const final override; bool is_connectivity_valid() const final override; diff --git a/src/wmtk/operations/EdgeSplit.cpp b/src/wmtk/operations/EdgeSplit.cpp index eae7e549c6..d23a3e4c38 100644 --- a/src/wmtk/operations/EdgeSplit.cpp +++ b/src/wmtk/operations/EdgeSplit.cpp @@ -20,7 +20,6 @@ bool EdgeSplit::attribute_new_all_configured() const for (const auto& strat : m_new_attr_strategies) { if (strat->invalid_state()) { all_configured = false; - wmtk::logger().warn("Attribute new {} was not configured", strat->name()); } } return all_configured; @@ -86,12 +85,23 @@ void EdgeSplit::set_new_attribute_strategy( const attribute::MeshAttributeHandle& attribute, const std::shared_ptr& other) { + // checks through every attr strategy, keeping track of if it's found an attribute to detect duplicate attribute transfers + bool done = false; for (size_t i = 0; i < m_new_attr_strategies.size(); ++i) { if (m_new_attr_strategies[i]->matches_attribute(attribute)) { + if(done) { + throw std::runtime_error("Two of one attr strat"); + } + auto old = m_new_attr_strategies[i]; m_new_attr_strategies[i] = other; - return; + other->invalid_state(); + done = true; + //return; } } + if(done) { + return ; + } throw std::runtime_error("unable to find attribute"); } diff --git a/src/wmtk/operations/Operation.cpp b/src/wmtk/operations/Operation.cpp index 7deb38c263..615bac12ed 100644 --- a/src/wmtk/operations/Operation.cpp +++ b/src/wmtk/operations/Operation.cpp @@ -65,9 +65,6 @@ void Operation::add_transfer_strategy( std::vector Operation::operator()(const simplex::Simplex& simplex) { - if (!mesh().is_valid(simplex)) { - return {}; - } if (!before(simplex)) { return {}; } @@ -97,14 +94,9 @@ std::vector Operation::operator()(const simplex::Simplex& simp bool Operation::before(const simplex::Simplex& simplex) const { // const attribute::Accessor accessor = hash_accessor(); - - // if (!mesh().is_valid( - // simplex.tuple(), - // accessor)) { // TODO: chang to is_removed and resurrect later - // return false; - // } - - if (mesh().is_removed(simplex.tuple()) || !mesh().is_valid(simplex)) { + // we assume the current MeshType's is_valid calls Mesh::is_valid first, which checks if the + // simplex is removed or not + if (!mesh().is_valid(simplex)) { return false; } @@ -152,7 +144,6 @@ void Operation::apply_attribute_transfer(const std::vector& di for (const auto& s : direct_mods) { if (!s.tuple().is_null()) { assert(m_mesh.is_valid(s)); - assert(m_mesh.get_const_flag_accessor(s.primitive_type()).is_active(s)); for (const simplex::IdSimplex& ss : simplex::closed_star_iterable(m_mesh, s)) { all.add(ss); } @@ -165,6 +156,7 @@ void Operation::apply_attribute_transfer(const std::vector& di for (const auto& at_ptr : m_attr_transfer_strategies) { if (&m_mesh == &(at_ptr->mesh())) { for (const simplex::IdSimplex& s : all.simplex_vector()) { + assert(m_mesh.get_const_flag_accessor(s.primitive_type()).is_active(s)); if (s.primitive_type() == at_ptr->primitive_type()) { at_ptr->run(m_mesh.get_simplex(s)); } diff --git a/src/wmtk/operations/composite/CMakeLists.txt b/src/wmtk/operations/composite/CMakeLists.txt index e607ec831d..18d97a25c9 100644 --- a/src/wmtk/operations/composite/CMakeLists.txt +++ b/src/wmtk/operations/composite/CMakeLists.txt @@ -1,4 +1,8 @@ set(SRC_FILES + + EdgeSwap.cpp + EdgeSwap.hpp + TriFaceSplit.hpp TriFaceSplit.cpp diff --git a/src/wmtk/operations/composite/EdgeSwap.cpp b/src/wmtk/operations/composite/EdgeSwap.cpp new file mode 100644 index 0000000000..534630fde0 --- /dev/null +++ b/src/wmtk/operations/composite/EdgeSwap.cpp @@ -0,0 +1,15 @@ +#include "EdgeSwap.hpp" + +namespace wmtk::operations::composite { +EdgeSwap::EdgeSwap(Mesh& m) + : EdgeSwap(m, std::make_shared(m), std::make_shared(m)) +{} +EdgeSwap::EdgeSwap( + Mesh& m, + std::shared_ptr split, + std::shared_ptr collapse) + : Operation(m) + , m_split(std::move(split)) + , m_collapse(std::move(collapse)) +{} +} // namespace wmtk::operations::composite diff --git a/src/wmtk/operations/composite/EdgeSwap.hpp b/src/wmtk/operations/composite/EdgeSwap.hpp new file mode 100644 index 0000000000..bb1843477e --- /dev/null +++ b/src/wmtk/operations/composite/EdgeSwap.hpp @@ -0,0 +1,23 @@ +#pragma once +#include +#include +#include + +namespace wmtk::operations::composite { +class EdgeSwap : public Operation +{ +public: + EdgeSwap(Mesh& m); + EdgeSwap(Mesh& m, std::shared_ptr split, std::shared_ptr collapse); + + EdgeSplit& split() { return *m_split; } + EdgeCollapse& collapse() { return *m_collapse; } + const EdgeSplit& split() const { return *m_split; } + const EdgeCollapse& collapse() const { return *m_collapse; } + +protected: + std::shared_ptr m_split; + std::shared_ptr m_collapse; +}; +} // namespace wmtk::operations::composite + diff --git a/src/wmtk/operations/composite/ProjectOperation.cpp b/src/wmtk/operations/composite/ProjectOperation.cpp index daf81341fe..ad87003938 100644 --- a/src/wmtk/operations/composite/ProjectOperation.cpp +++ b/src/wmtk/operations/composite/ProjectOperation.cpp @@ -22,66 +22,87 @@ ProjectOperation::ProjectOperation( , m_main_op(main_op) { for (auto& pair : mesh_constaint_pairs) { - int64_t count = 0; - int64_t index = 0; - - const std::vector& facest = - pair.first.mesh().get_all(pair.first.mesh().top_simplex_type()); - - const int64_t dim = int64_t(pair.first.mesh().top_simplex_type()) + 1; - - Eigen::MatrixXd vertices(dim * facest.size(), pair.first.dimension()); - Eigen::MatrixXi faces(facest.size(), dim); + add_constraint(pair.second, pair.first); + } +} - // hugly copy paste - if (pair.first.holds()) { - const attribute::Accessor accessor = - pair.first.mesh().create_const_accessor(pair.first.as()); - - for (const auto& f : facest) { - auto tmp = faces_single_dimension_tuples( - pair.first.mesh(), - simplex::Simplex(pair.first.mesh(), pair.first.mesh().top_simplex_type(), f), - PrimitiveType::Vertex); - - assert(tmp.size() == dim); - for (int64_t j = 0; j < tmp.size(); ++j) { - auto p = accessor.const_vector_attribute(tmp[j]); - faces(index, j) = count; - vertices.row(dim * index + j) = p; - - ++count; - } - ++index; +void ProjectOperation::add_constraint( + const attribute::MeshAttributeHandle& mah, + const attribute::MeshAttributeHandle& projection_mah) +{ + int64_t count = 0; + int64_t index = 0; + + const std::vector& facest = + projection_mah.mesh().get_all(projection_mah.mesh().top_simplex_type()); + + const int64_t dim = int64_t(projection_mah.mesh().top_simplex_type()) + 1; + + Eigen::MatrixXd vertices(dim * facest.size(), projection_mah.dimension()); + Eigen::MatrixXi faces(facest.size(), dim); + + // hugly copy paste + if (projection_mah.holds()) { + const attribute::Accessor accessor = + projection_mah.mesh().create_const_accessor(projection_mah.as()); + + for (const auto& f : facest) { + auto tmp = faces_single_dimension_tuples( + projection_mah.mesh(), + simplex::Simplex( + projection_mah.mesh(), + projection_mah.mesh().top_simplex_type(), + f), + PrimitiveType::Vertex); + + assert(tmp.size() == dim); + for (int64_t j = 0; j < tmp.size(); ++j) { + auto p = accessor.const_vector_attribute(tmp[j]); + faces(index, j) = count; + vertices.row(dim * index + j) = p; + + ++count; } - } else { - const attribute::Accessor accessor = - pair.first.mesh().create_const_accessor(pair.first.as()); - - - for (const auto& f : facest) { - auto tmp = faces_single_dimension_tuples( - pair.first.mesh(), - simplex::Simplex(pair.first.mesh(), pair.first.mesh().top_simplex_type(), f), - PrimitiveType::Vertex); - - assert(tmp.size() == dim); - for (int64_t j = 0; j < tmp.size(); ++j) { - auto p = accessor.const_vector_attribute(tmp[j]).cast(); - faces(index, j) = count; - vertices.row(dim * index + j) = p; - - ++count; - } - ++index; + ++index; + } + } else { + const attribute::Accessor accessor = + projection_mah.mesh().create_const_accessor(projection_mah.as()); + + + for (const auto& f : facest) { + auto tmp = faces_single_dimension_tuples( + projection_mah.mesh(), + simplex::Simplex( + projection_mah.mesh(), + projection_mah.mesh().top_simplex_type(), + f), + PrimitiveType::Vertex); + + assert(tmp.size() == dim); + for (int64_t j = 0; j < tmp.size(); ++j) { + auto p = accessor.const_vector_attribute(tmp[j]).cast(); + faces(index, j) = count; + vertices.row(dim * index + j) = p; + + ++count; } + ++index; } + } - auto bvh = std::make_shared(); - bvh->init(vertices, faces, 1e-10); + auto bvh = std::make_shared(); + bvh->init(vertices, faces, 1e-10); + m_bvh.emplace_back(mah, bvh); +} - m_bvh.emplace_back(pair.second, bvh); - } +void ProjectOperation::add_constraint( + const attribute::MeshAttributeHandle& mah, + std::shared_ptr bvh) +{ + assert(mah.is_valid()); + assert(bool(bvh)); + m_bvh.emplace_back(mah, bvh); } std::vector ProjectOperation::execute(const simplex::Simplex& simplex) diff --git a/src/wmtk/operations/composite/ProjectOperation.hpp b/src/wmtk/operations/composite/ProjectOperation.hpp index b6df673d38..a37e53b367 100644 --- a/src/wmtk/operations/composite/ProjectOperation.hpp +++ b/src/wmtk/operations/composite/ProjectOperation.hpp @@ -22,12 +22,20 @@ class ProjectOperation : public AttributesUpdate ProjectOperation( std::shared_ptr main_op, - const std::vector& mesh_constaint_pairs); + const std::vector& mesh_constaint_pairs = {}); std::vector execute(const simplex::Simplex& simplex) override; PrimitiveType primitive_type() const override { return m_main_op->primitive_type(); } + void add_constraint( + const attribute::MeshAttributeHandle& mah, + std::shared_ptr bvh); + + void add_constraint( + const attribute::MeshAttributeHandle& mah, + const attribute::MeshAttributeHandle& bvh_mesh_attribute); + private: using BVHConstrainPair = std::pair>; diff --git a/src/wmtk/operations/composite/TetCellSplit.cpp b/src/wmtk/operations/composite/TetCellSplit.cpp index 8a516f08da..177b051d38 100644 --- a/src/wmtk/operations/composite/TetCellSplit.cpp +++ b/src/wmtk/operations/composite/TetCellSplit.cpp @@ -5,7 +5,7 @@ namespace wmtk::operations::composite { -TetCellSplit::TetCellSplit(Mesh& m) +TetCellSplit::TetCellSplit(TetMesh& m) : Operation(m) , m_split(m) , m_collapse(m) diff --git a/src/wmtk/operations/composite/TetCellSplit.hpp b/src/wmtk/operations/composite/TetCellSplit.hpp index 26a2bc3698..c39138dc47 100644 --- a/src/wmtk/operations/composite/TetCellSplit.hpp +++ b/src/wmtk/operations/composite/TetCellSplit.hpp @@ -18,7 +18,7 @@ namespace wmtk::operations::composite { class TetCellSplit : public Operation { public: - TetCellSplit(Mesh& m); + TetCellSplit(TetMesh& m); PrimitiveType primitive_type() const override { return PrimitiveType::Tetrahedron; } diff --git a/src/wmtk/operations/composite/TetEdgeSwap.cpp b/src/wmtk/operations/composite/TetEdgeSwap.cpp index 0f9b4bfaf4..cf81f5843f 100644 --- a/src/wmtk/operations/composite/TetEdgeSwap.cpp +++ b/src/wmtk/operations/composite/TetEdgeSwap.cpp @@ -7,16 +7,14 @@ #include namespace wmtk::operations::composite { -TetEdgeSwap::TetEdgeSwap(Mesh& m, int64_t collapse_index) - : Operation(m) - , m_split(m) - , m_collapse(m) +TetEdgeSwap::TetEdgeSwap(TetMesh& m, int64_t collapse_index) + : EdgeSwap(m) , m_collapse_index(collapse_index) {} std::vector TetEdgeSwap::execute(const simplex::Simplex& simplex) { - const auto split_simplicies = m_split(simplex); + const auto split_simplicies = split()(simplex); if (split_simplicies.empty()) return {}; assert(split_simplicies.size() == 1); @@ -135,7 +133,7 @@ std::vector TetEdgeSwap::execute(const simplex::Simplex& simpl // do collapse const auto collapse_simplicies = - m_collapse(simplex::Simplex(mesh(), m_collapse.primitive_type(), collapse_tuple)); + collapse()(simplex::Simplex(mesh(), collapse().primitive_type(), collapse_tuple)); if (collapse_simplicies.empty()) return {}; assert(collapse_simplicies.size() == 1); diff --git a/src/wmtk/operations/composite/TetEdgeSwap.hpp b/src/wmtk/operations/composite/TetEdgeSwap.hpp index 33068bb623..892af6043d 100644 --- a/src/wmtk/operations/composite/TetEdgeSwap.hpp +++ b/src/wmtk/operations/composite/TetEdgeSwap.hpp @@ -1,7 +1,6 @@ #pragma once -#include -#include +#include "EdgeSwap.hpp" namespace wmtk::operations::composite { @@ -15,15 +14,13 @@ namespace wmtk::operations::composite { * */ -class TetEdgeSwap : public Operation +class TetEdgeSwap : public EdgeSwap { public: - TetEdgeSwap(Mesh& m, int64_t collapse_index = 0); + TetEdgeSwap(TetMesh& m, int64_t collapse_index = 0); PrimitiveType primitive_type() const override { return PrimitiveType::Edge; } - inline EdgeSplit& split() { return m_split; } - inline EdgeCollapse& collapse() { return m_collapse; } protected: @@ -32,10 +29,8 @@ class TetEdgeSwap : public Operation std::vector execute(const simplex::Simplex& simplex) override; private: - EdgeSplit m_split; - EdgeCollapse m_collapse; int64_t m_collapse_index; }; -} // namespace wmtk::operations::composite \ No newline at end of file +} // namespace wmtk::operations::composite diff --git a/src/wmtk/operations/composite/TetFaceSwap.cpp b/src/wmtk/operations/composite/TetFaceSwap.cpp index 57fbd416c5..a34f007b4b 100644 --- a/src/wmtk/operations/composite/TetFaceSwap.cpp +++ b/src/wmtk/operations/composite/TetFaceSwap.cpp @@ -2,7 +2,7 @@ #include namespace wmtk::operations::composite { -TetFaceSwap::TetFaceSwap(Mesh& m) +TetFaceSwap::TetFaceSwap(TetMesh& m) : Operation(m) , m_split(m) , m_collapse(m) diff --git a/src/wmtk/operations/composite/TetFaceSwap.hpp b/src/wmtk/operations/composite/TetFaceSwap.hpp index c73dde1ce1..8018ea9fe8 100644 --- a/src/wmtk/operations/composite/TetFaceSwap.hpp +++ b/src/wmtk/operations/composite/TetFaceSwap.hpp @@ -37,7 +37,7 @@ namespace wmtk::operations::composite { class TetFaceSwap : public Operation { public: - TetFaceSwap(Mesh& m); + TetFaceSwap(TetMesh& m); PrimitiveType primitive_type() const override { return PrimitiveType::Triangle; } @@ -54,4 +54,4 @@ class TetFaceSwap : public Operation EdgeCollapse m_collapse; }; -} // namespace wmtk::operations::composite \ No newline at end of file +} // namespace wmtk::operations::composite diff --git a/src/wmtk/operations/composite/TriEdgeSwap.cpp b/src/wmtk/operations/composite/TriEdgeSwap.cpp index 99935fb082..8ed5706b37 100644 --- a/src/wmtk/operations/composite/TriEdgeSwap.cpp +++ b/src/wmtk/operations/composite/TriEdgeSwap.cpp @@ -4,10 +4,8 @@ namespace wmtk::operations::composite { -TriEdgeSwap::TriEdgeSwap(Mesh& m) - : Operation(m) - , m_split(m) - , m_collapse(m) +TriEdgeSwap::TriEdgeSwap(TriMesh& m) + : EdgeSwap(m) {} @@ -21,7 +19,7 @@ std::vector TriEdgeSwap::execute(const simplex::Simplex& simpl // \ / // \ / // \ / - const auto split_simplicies = m_split(simplex); + const auto split_simplicies = split()(simplex); if (split_simplicies.empty()) return {}; assert(split_simplicies.size() == 1); @@ -47,7 +45,7 @@ std::vector TriEdgeSwap::execute(const simplex::Simplex& simpl // \ | / // \|/ const auto collapse_simplicies = - m_collapse(simplex::Simplex(mesh(), m_collapse.primitive_type(), collapse_input_tuple)); + collapse()(simplex::Simplex(mesh(), collapse().primitive_type(), collapse_input_tuple)); if (collapse_simplicies.empty()) return {}; assert(collapse_simplicies.size() == 1); diff --git a/src/wmtk/operations/composite/TriEdgeSwap.hpp b/src/wmtk/operations/composite/TriEdgeSwap.hpp index 2e35b040f4..ce3608fe5b 100644 --- a/src/wmtk/operations/composite/TriEdgeSwap.hpp +++ b/src/wmtk/operations/composite/TriEdgeSwap.hpp @@ -1,8 +1,7 @@ #pragma once -#include -#include +#include "EdgeSwap.hpp" namespace wmtk::operations::composite { /** @@ -37,24 +36,19 @@ namespace wmtk::operations::composite { * X */ -class TriEdgeSwap : public Operation +class TriEdgeSwap : public EdgeSwap { public: - TriEdgeSwap(Mesh& m); + TriEdgeSwap(TriMesh& m); PrimitiveType primitive_type() const override { return PrimitiveType::Edge; } - inline EdgeSplit& split() { return m_split; } - inline EdgeCollapse& collapse() { return m_collapse; } protected: std::vector unmodified_primitives( const simplex::Simplex& simplex) const override; std::vector execute(const simplex::Simplex& simplex) override; -private: - EdgeSplit m_split; - EdgeCollapse m_collapse; }; } // namespace wmtk::operations::composite diff --git a/src/wmtk/operations/composite/TriFaceSplit.cpp b/src/wmtk/operations/composite/TriFaceSplit.cpp index 84299ea858..a30dae0bee 100644 --- a/src/wmtk/operations/composite/TriFaceSplit.cpp +++ b/src/wmtk/operations/composite/TriFaceSplit.cpp @@ -4,7 +4,7 @@ namespace wmtk::operations::composite { -TriFaceSplit::TriFaceSplit(Mesh& m) +TriFaceSplit::TriFaceSplit(TriMesh& m) : Operation(m) , m_split(m) , m_collapse(m) diff --git a/src/wmtk/operations/composite/TriFaceSplit.hpp b/src/wmtk/operations/composite/TriFaceSplit.hpp index b319c342c0..49b905e07c 100644 --- a/src/wmtk/operations/composite/TriFaceSplit.hpp +++ b/src/wmtk/operations/composite/TriFaceSplit.hpp @@ -20,7 +20,7 @@ namespace wmtk::operations::composite { class TriFaceSplit : public Operation { public: - TriFaceSplit(Mesh& m); + TriFaceSplit(TriMesh& m); PrimitiveType primitive_type() const override { return PrimitiveType::Triangle; } diff --git a/src/wmtk/operations/utils/MultiMeshEdgeCollapseFunctor.cpp b/src/wmtk/operations/utils/MultiMeshEdgeCollapseFunctor.cpp index dcf71f7047..9960beb90b 100644 --- a/src/wmtk/operations/utils/MultiMeshEdgeCollapseFunctor.cpp +++ b/src/wmtk/operations/utils/MultiMeshEdgeCollapseFunctor.cpp @@ -24,6 +24,7 @@ tri_mesh::EdgeOperationData MultiMeshEdgeCollapseFunctor::operator()( TriMesh& m, const simplex::Simplex& s) const { + assert(m.is_valid(s)); TriMesh::TriMeshOperationExecutor exec(m, s.tuple()); exec.collapse_edge(); return std::move(static_cast(exec));