29 :
m_accessor(m.create_accessor<int64_t>(attribute))
39 const std::vector<attribute::MeshAttributeHandle>& label_attributes,
40 const std::vector<int64_t>& values,
41 const std::vector<attribute::MeshAttributeHandle>& pass_through_attributes)
43 , m_label_attributes(label_attributes)
45 , m_pass_through_attributes(pass_through_attributes)
52 using namespace operations;
54 std::vector<attribute::MeshAttributeHandle> todo_handles;
58 todo_handles.emplace_back(todo_handle);
61 std::deque<TagAttribute> tag_attributes;
63 tag_attributes.emplace_back(
71 for (
size_t i = 0; i < tag_attributes.size(); ++i) {
75 "the top simplex type up to vertex.");
81 for (
size_t attr_it = 0; attr_it < tag_attributes.size() - 1; ++attr_it) {
103 for (
size_t attr_it = 0; attr_it < tag_attributes.size() - 1; ++attr_it) {
121 const TagAttribute& face_ta = tag_attributes[attr_it + 1];
123 bool all_faces_are_tagged =
true;
127 all_faces_are_tagged =
false;
132 if (all_faces_are_tagged) {
133 todo_acc.scalar_attribute(t) = 1;
154 SplitBasicStrategy::None,
155 SplitRibBasicStrategy::None);
168 if (stats.number_of_successful_operations() == 0) {
185 SplitBasicStrategy::None,
186 SplitRibBasicStrategy::None);
202 if (stats.number_of_successful_operations() == 0) {
attribute::MeshAttributeHandle register_attribute(const std::string &name, PrimitiveType type, int64_t size, bool replace=false, T default_value=T(0))
std::vector< Tuple > get_all(PrimitiveType type) const
Generate a vector of Tuples from global vertex/edge/triangle/tetrahedron index.
int64_t top_cell_dimension() const
attribute::Accessor< T, Mesh, D > create_accessor(const attribute::MeshAttributeHandle &handle)
PrimitiveType top_simplex_type() const
SchedulerStats run_operation_on_all(operations::Operation &op)
T & scalar_attribute(const ArgType &t)
T const_scalar_attribute(const ArgType &t) const
std::vector< int64_t > m_values
std::vector< attribute::MeshAttributeHandle > m_pass_through_attributes
std::vector< attribute::MeshAttributeHandle > m_label_attributes
RegularSpace(Mesh &mesh, const std::vector< attribute::MeshAttributeHandle > &label_attributes, const std::vector< int64_t > &values, const std::vector< attribute::MeshAttributeHandle > &pass_through_attributes)
wmtk::attribute::Accessor< int64_t > m_accessor
TagAttribute(TagAttribute &)=delete
TagAttribute(Mesh &m, const attribute::MeshAttributeHandle &attribute, PrimitiveType ptype, int64_t val)
void set_new_attribute_strategy(const attribute::MeshAttributeHandle &attribute, const std::shared_ptr< const operations::BaseCollapseNewAttributeStrategy > &other)
void set_new_attribute_strategy(const attribute::MeshAttributeHandle &attribute, const std::shared_ptr< const operations::BaseSplitNewAttributeStrategy > &other)
void add_invariant(std::shared_ptr< Invariant > invariant)
The return tuple is the new vertex, pointing to the original vertex.
EdgeCollapse & collapse()
std::vector< Tuple > faces_single_dimension_tuples(const Mesh &mesh, const Simplex &simplex, const PrimitiveType face_type)
SimplexCollection faces(const Mesh &mesh, const Simplex &simplex, const bool sort_and_clean)
Returns all faces of a simplex.
constexpr PrimitiveType get_primitive_type_from_id(int8_t id)
Get the primitive type corresponding to its unique integer id.
void log_and_throw_error(const std::string &msg)
constexpr int8_t get_primitive_type_id(PrimitiveType t)
Get a unique integer id corresponding to each primitive type.