51 const bool include_deleted)
const
53 std::vector<simplex::IdSimplex> ret;
62 for (
size_t index = 0; index < cap; ++index) {
65 else if (include_deleted)
74 std::vector<Tuple> ret;
83 for (
size_t index = 0; index < cap; ++index) {
86 else if (include_deleted)
94 if (local_root ==
nullptr) {
140 return !(flag_accessor.index_access().const_scalar_attribute(index) & 0x1);
145 #if defined(WMTK_ENABLE_SIMPLEX_ID_CACHING)
150 return id_tuple == s.m_index;
187 const std::vector<std::vector<simplex::Simplex>>& simplices)
const
189 std::vector<std::vector<int64_t>> gids;
190 gids.resize(simplices.size());
191 for (
int i = 0; i < simplices.size(); ++i) {
192 auto simplices_i = simplices[i];
193 for (
const auto& simplex : simplices_i) {
196 gids[d].emplace_back(
id(simplex.tuple(), simplex.primitive_type()));
205 const std::initializer_list<PrimitiveType>& op_sequence)
const
207 return switch_tuples<std::initializer_list<PrimitiveType>>(tuple, op_sequence);
211 const std::initializer_list<PrimitiveType>& op_sequence)
const
213 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.
const attribute::Accessor< char > get_const_flag_accessor(PrimitiveType type) const
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
bool is_removed(const Tuple &tuple) const
const attribute::Accessor< char > 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.
CachingBaseType & index_access()
int64_t reserved_size() const
void serialize(MeshWriter &writer) const
std::vector< int64_t > m_capacities
void assert_capacity_valid() const
An accessor for cached attribute values.
T const_scalar_attribute(const int64_t index) 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.