51 const bool include_deleted)
const
53 std::vector<simplex::IdSimplex> ret;
62 for (
size_t index = 0; index < cap; ++index) {
63 if (flag_accessor_indices.
is_active(index))
65 else if (include_deleted)
74 std::vector<Tuple> ret;
83 for (
size_t index = 0; index < cap; ++index) {
84 if (flag_accessor_indices.
is_active(index)) {
86 }
else if (include_deleted) {
95 if (local_root ==
nullptr) {
141 return !flag_accessor.index_access().is_active(index);
146 #if defined(WMTK_ENABLE_SIMPLEX_ID_CACHING)
151 return id_tuple == s.m_index;
190 const std::vector<std::vector<simplex::Simplex>>& simplices)
const
192 std::vector<std::vector<int64_t>> gids;
193 gids.resize(simplices.size());
194 for (
int i = 0; i < simplices.size(); ++i) {
195 auto simplices_i = simplices[i];
196 for (
const auto& simplex : simplices_i) {
199 gids[d].emplace_back(
id(simplex.tuple(), simplex.primitive_type()));
208 const std::initializer_list<PrimitiveType>& op_sequence)
const
210 return switch_tuples<std::initializer_list<PrimitiveType>>(tuple, op_sequence);
214 const std::initializer_list<PrimitiveType>& op_sequence)
const
216 return switch_tuples_unsafe<std::initializer_list<PrimitiveType>>(tuple, op_sequence);
Tuple switch_tuples_unsafe(const Tuple &tuple, const ContainerType &op_sequence) const
simplex::Simplex get_simplex(const simplex::IdSimplex &s) const
Convert an IdSimplex into a Simplex.
void serialize(MeshWriter &writer, const Mesh *local_root=nullptr) const
int64_t capacity(PrimitiveType type) const
read in the m_capacities return the upper bound for the number of entities of the given dimension
std::vector< TypedAttributeHandle< char > > m_flag_handles
0x1 == true = simplex is active (simplex exists) all flag default to 0
simplex::NavigatableSimplex simplex_from_id(const PrimitiveType type, const int64_t gid) const
const attribute::Accessor< T, Mesh, D > create_const_accessor(const attribute::MeshAttributeHandle &handle) const
int64_t id(const Tuple &tuple, PrimitiveType type) const
return the global id of the Tuple of the given dimension
bool is_boundary(const simplex::Simplex &tuple) const
check if a simplex lies on a boundary or not
virtual Tuple tuple_from_id(const PrimitiveType type, const int64_t gid) const =0
internal function that returns the tuple of requested type, and has the global index cid
void assert_capacity_valid() const
std::vector< Tuple > get_all(PrimitiveType type) const
Generate a vector of Tuples from global vertex/edge/triangle/tetrahedron index.
multimesh::MultiMeshManager m_multi_mesh_manager
std::vector< std::vector< int64_t > > simplices_to_gids(const std::vector< std::vector< simplex::Simplex >> &simplices) const
std::vector< simplex::IdSimplex > get_all_id_simplex(PrimitiveType type) const
Tuple switch_tuples(const Tuple &tuple, const ContainerType &op_sequence) const
virtual bool is_valid(const Tuple &tuple) const
check validity of tuple including its hash
void set_capacities_from_flags()
int64_t top_cell_dimension() const
bool operator==(const Mesh &other) const
attribute::Accessor< T, Mesh, D > create_accessor(const attribute::MeshAttributeHandle &handle)
simplex::IdSimplex get_id_simplex(const Tuple &tuple, PrimitiveType pt) const
Retrieve the IdSimplex that is represented by the tuple and primitive type.
PrimitiveType top_simplex_type() const
Tuple get_tuple_from_id_simplex(const simplex::IdSimplex &s) const
const attribute::FlagAccessor< Mesh > get_const_flag_accessor(PrimitiveType type) const
bool is_removed(const Tuple &tuple) const
const attribute::FlagAccessor< Mesh > get_flag_accessor(PrimitiveType type) const
attribute::AttributeManager m_attribute_manager
virtual void write_top_simplex_type(const PrimitiveType type)=0
virtual void write_absolute_id(const std::vector< int64_t > &id)=0
bool is_null() const
Checks if a tuple is "null". This merely implies the global index is -1.
A CachingAccessor that uses tuples for accessing attributes instead of indices.
int64_t reserved_size() const
void serialize(MeshWriter &writer) const
std::vector< int64_t > m_capacities
void assert_capacity_valid() const
const IndexBaseType & index_access() const
bool is_active(int64_t t) const
std::vector< int64_t > absolute_id() const
void serialize(MeshWriter &writer, const Mesh *local_root=nullptr) const
static std::vector< int64_t > relative_id(const std::vector< int64_t > &parent, const std::vector< int64_t > &child)
PrimitiveType primitive_type() const
const Tuple & tuple() const
PrimitiveType primitive_type() const
constexpr int8_t get_primitive_type_id(PrimitiveType t)
Get a unique integer id corresponding to each primitive type.