Wildmeshing Toolkit
|
An Accessor that uses tuples for accessing attributes instead of indices. More...
#include <Accessor.hpp>
Public Types | |
using | Scalar = T |
using | AttributeType = AttributeType_ |
template<int D = Dim> | |
using | MapResult = typename AttributeType::template MapResult< D > |
template<int D = Dim> | |
using | ConstMapResult = typename AttributeType::template ConstMapResult< D > |
Public Member Functions | |
Accessor (MeshType &m, const TypedAttributeHandle< T > &handle) | |
Accessor (const MeshType &m, const TypedAttributeHandle< T > &handle) | |
template<typename OMType , typename OAT , int D> | |
Accessor (const Accessor< T, OMType, OAT, D > &o) | |
auto | dimension () const -> int64_t |
auto | reserved_size () const -> int64_t |
auto | default_value () const -> const Scalar & |
template<int D = Dim, typename ArgType = wmtk::Tuple> | |
MapResult< std::max(D, Dim)> | vector_attribute (const ArgType &t) |
Access function for a vector attribute. | |
template<int D = Dim, typename ArgType = wmtk::Tuple> | |
ConstMapResult< std::max(D, Dim)> | const_vector_attribute (const ArgType &t) const |
Constant access function for a vector attribute. | |
template<typename ArgType > | |
Scalar & | scalar_attribute (const ArgType &t) |
Access function for a scalar attribute. | |
template<typename ArgType > | |
const Scalar & | const_scalar_attribute (const ArgType &t) const |
Constant access function for a scalar attribute. | |
const T & | const_topological_scalar_attribute (const Tuple &t, PrimitiveType pt) const |
MeshType & | mesh () |
const MeshType & | mesh () const |
int64_t | transaction_depth () const |
MeshAttributeHandle | handle () const |
const TypedAttributeHandle< T > & | typed_handle () const |
PrimitiveType | primitive_type () const |
template<int D, typename ArgType > | |
auto | const_vector_attribute (const ArgType &t) const -> ConstMapResult< std::max(D, Dim)> |
template<int D, typename ArgType > | |
auto | vector_attribute (const ArgType &t) -> MapResult< std::max(D, Dim)> |
template<typename ArgType > | |
auto | scalar_attribute (const ArgType &t) -> Scalar & |
template<typename ArgType > | |
auto | const_scalar_attribute (const ArgType &t) const -> const Scalar & |
Protected Member Functions | |
int64_t | index (const Tuple &t) const |
Retrieve the global ID of the given simplex. | |
int64_t | index (const simplex::Simplex &t) const |
Retrieve the global ID of the given simplex. | |
int64_t | index (const simplex::IdSimplex &t) const |
Same as with Simplex . | |
int64_t | index (const int64_t t) const |
AttributeType & | attribute () |
const AttributeType & | attribute () const |
Private Attributes | |
TypedAttributeHandle< T > | m_handle |
MeshType & | m_mesh |
AttributeType & | m_attribute |
Friends | |
class | wmtk::Mesh |
class | wmtk::tests::DEBUG_PointMesh |
class | wmtk::tests::DEBUG_EdgeMesh |
class | wmtk::tests::DEBUG_TriMesh |
class | wmtk::tests_3d::DEBUG_TetMesh |
class | IndexFlagAccessor< MeshType > |
class | wmtk::HDF5Reader |
An Accessor that uses tuples for accessing attributes instead of indices.
The parameter T is the type of the attribute data, and always must match the underlying attribute's type MeshType can default to Mesh, but specializing it with the specific type of mesh this attribute lies in avoids some virtual calls AttributeType_ specifies the type of teh underlying attribute, which should almost always be CachingAttribute<T> to take advantage of our transactional caching system, but for unit tests (or guaranteed raw access to the underlying buffers) this can be changed to Attribute<T> Dim specifies the dimension of the underlying attribute - specifying this parameter when possible can have a notable performance improvement, so specify it when possible. This performance change is the change between passing a single pointer for each attribute vs a pointer + int size for each value
Definition at line 43 of file Accessor.hpp.
using wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::AttributeType = AttributeType_ |
Definition at line 56 of file Accessor.hpp.
using wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::ConstMapResult = typename AttributeType::template ConstMapResult<D> |
Definition at line 66 of file Accessor.hpp.
using wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::MapResult = typename AttributeType::template MapResult<D> |
Definition at line 63 of file Accessor.hpp.
using wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::Scalar = T |
Definition at line 54 of file Accessor.hpp.
|
inline |
Definition at line 9 of file Accessor.hxx.
wmtk::attribute::Accessor< T, MeshType, AttributeType, Dim >::Accessor | ( | const MeshType & | m, |
const TypedAttributeHandle< T > & | handle | ||
) |
Definition at line 17 of file Accessor.hxx.
wmtk::attribute::Accessor< T, MeshType, AttributeType, Dim >::Accessor | ( | const Accessor< T, OMType, OAT, D > & | o | ) |
Definition at line 24 of file Accessor.hxx.
|
inlineprotected |
Definition at line 159 of file Accessor.hxx.
Referenced by wmtk::attribute::IndexFlagAccessor< MeshType >::attribute(), wmtk::attribute::IndexFlagAccessor< MeshType >::attribute(), wmtk::Mesh::consolidate(), wmtk::Mesh::get_index_access(), and wmtk::Mesh::get_index_access().
|
inlineprotected |
Definition at line 164 of file Accessor.hxx.
const Scalar & wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::const_scalar_attribute | ( | const ArgType & | t | ) | const |
Constant access function for a scalar attribute.
The scalar attribute circumvents the Eigen::Map that is necessary for vector attributes.
t | Tuple, Simplex, or IdSimplex for which the attribute should be accessed. |
Referenced by wmtk::TodoInvariant::before(), wmtk::TodoLargerInvariant::before(), wmtk::TodoSmallerInvariant::before(), wmtk::components::internal::MultiMeshFromTag::compute_substructure_mesh(), wmtk::components::internal::MultiMeshFromTag::create_substructure_soup(), wmtk::multimesh::utils::internal::TupleTag::get_edge_tag(), wmtk::multimesh::utils::internal::TupleTag::get_vertex_tag(), wmtk::TetMesh::is_connectivity_valid(), wmtk::TriMesh::is_connectivity_valid(), wmtk::EdgeMesh::is_connectivity_valid(), wmtk::components::TagAttribute::is_tagged(), wmtk::components::Marching::process(), wmtk::components::internal::RegularSpace::regularize_tags(), and wmtk::EdgeMesh::vertex_tuple_from_id().
auto wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::const_scalar_attribute | ( | const ArgType & | t | ) | const -> const Scalar& |
Definition at line 86 of file Accessor.hxx.
const T & wmtk::attribute::Accessor< T, MeshType, AttributeType, Dim >::const_topological_scalar_attribute | ( | const Tuple & | t, |
PrimitiveType | pt | ||
) | const |
Definition at line 103 of file Accessor.hxx.
References wmtk::Edge, wmtk::Tuple::global_cid(), wmtk::Tuple::local_eid(), wmtk::Tuple::local_fid(), wmtk::Tuple::local_vid(), wmtk::Tetrahedron, wmtk::Triangle, and wmtk::Vertex.
ConstMapResult< std::max(D, Dim)> wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::const_vector_attribute | ( | const ArgType & | t | ) | const |
Constant access function for a vector attribute.
t | Tuple, Simplex, or IdSimplex for which the attribute should be accessed. |
Referenced by wmtk::invariants::EnvelopeInvariant::after(), wmtk::operations::CollapseNewAttributeStrategy< T >::assign_collapsed(), wmtk::operations::SplitNewAttributeStrategy< T >::assign_split(), wmtk::operations::SplitNewAttributeStrategy< T >::assign_split_ribs(), wmtk::MaxEdgeLengthInvariant::before(), wmtk::invariants::MinEdgeLengthInvariant::before(), wmtk::components::internal::MultiMeshFromTag::build_adjacency_matrix(), wmtk::mesh_utils::compute_face_normal_area_weighted(), wmtk::components::internal::MultiMeshFromTag::compute_substructure_ids(), wmtk::invariants::EnvelopeInvariant::EnvelopeInvariant(), wmtk::EdgeMesh::id(), wmtk::operations::OptimizationSmoothing::WMTKProblem< T >::initial_value(), wmtk::TetMesh::is_boundary_face(), wmtk::EdgeMesh::is_boundary_vertex(), wmtk::TetMesh::is_connectivity_valid(), wmtk::TriMesh::is_connectivity_valid(), wmtk::EdgeMesh::is_connectivity_valid(), wmtk::operations::composite::ProjectOperation::ProjectOperation(), wmtk::multimesh::utils::read_tuple_map_attribute(), wmtk::EdgeMesh::switch_tuple(), wmtk::EdgeMesh::tuple_from_global_ids(), wmtk::EdgeMesh::vertex_tuple_from_id(), and wmtk::multimesh::utils::write_tuple_map_attribute().
auto wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::const_vector_attribute | ( | const ArgType & | t | ) | const -> ConstMapResult<std::max(D, Dim)> |
Definition at line 60 of file Accessor.hxx.
|
inline |
Definition at line 153 of file Accessor.hxx.
|
inline |
Definition at line 147 of file Accessor.hxx.
Referenced by wmtk::invariants::EnvelopeInvariant::after(), wmtk::invariants::EnvelopeInvariant::EnvelopeInvariant(), wmtk::multimesh::utils::read_tuple_map_attribute(), and wmtk::multimesh::utils::write_tuple_map_attribute().
|
inline |
Definition at line 175 of file Accessor.hxx.
|
inlineprotected |
Definition at line 53 of file Accessor.hxx.
|
protected |
Same as with Simplex
.
Definition at line 46 of file Accessor.hxx.
References wmtk::simplex::IdSimplex::primitive_type().
|
protected |
Retrieve the global ID of the given simplex.
Simplex's primitive type must match this attribute, should assert failure if not.
t | Simplex for accessing. |
Definition at line 39 of file Accessor.hxx.
References wmtk::simplex::Simplex::primitive_type(), and wmtk::simplex::Simplex::tuple().
|
protected |
Retrieve the global ID of the given simplex.
The simplex is defined by the given Tuple t
and the PrimitiveType of the attribute.
t | Tuple used for accessing. |
Definition at line 32 of file Accessor.hxx.
|
inline |
Definition at line 124 of file Accessor.hxx.
Referenced by wmtk::operations::composite::ProjectOperation::execute(), and wmtk::operations::composite::ProjectOperation::ProjectOperation().
|
inline |
Definition at line 129 of file Accessor.hxx.
|
inline |
Definition at line 181 of file Accessor.hxx.
Referenced by wmtk::operations::CollapseNewAttributeStrategy< T >::assign_collapsed(), wmtk::operations::SplitNewAttributeStrategy< T >::assign_split(), and wmtk::operations::SplitNewAttributeStrategy< T >::assign_split_ribs().
|
inline |
Definition at line 141 of file Accessor.hxx.
Referenced by wmtk::Mesh::request_simplex_indices(), and wmtk::Mesh::set_capacities_from_flags().
Scalar & wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::scalar_attribute | ( | const ArgType & | t | ) |
Access function for a scalar attribute.
The scalar attribute circumvents the Eigen::Map that is necessary for vector attributes.
t | Tuple, Simplex, or IdSimplex for which the attribute should be accessed. |
Referenced by wmtk::EdgeMesh::initialize(), wmtk::TriMesh::initialize(), wmtk::components::Marching::process(), wmtk::components::internal::RegularSpace::regularize_tags(), wmtk::multimesh::utils::internal::TupleTag::set_edge_tag(), wmtk::components::TagAttribute::set_tag(), wmtk::multimesh::utils::internal::TupleTag::set_vertex_tag(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().
auto wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::scalar_attribute | ( | const ArgType & | t | ) | -> Scalar& |
Definition at line 78 of file Accessor.hxx.
|
inline |
Definition at line 135 of file Accessor.hxx.
|
inline |
Definition at line 169 of file Accessor.hxx.
MapResult< std::max(D, Dim)> wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::vector_attribute | ( | const ArgType & | t | ) |
Access function for a vector attribute.
t | Tuple, Simplex, or IdSimplex for which the attribute should be accessed. |
Referenced by wmtk::operations::CollapseNewAttributeStrategy< T >::assign_collapsed(), wmtk::operations::SplitNewAttributeStrategy< T >::assign_split(), wmtk::operations::SplitNewAttributeStrategy< T >::assign_split_ribs(), wmtk::components::internal::MultiMeshFromTag::build_adjacency_matrix(), wmtk::components::internal::MultiMeshFromTag::compute_substructure_ids(), wmtk::operations::composite::ProjectOperation::execute(), wmtk::operations::OptimizationSmoothing::WMTKProblem< T >::gradient(), wmtk::operations::OptimizationSmoothing::WMTKProblem< T >::hessian(), wmtk::EdgeMesh::initialize(), wmtk::TriMesh::initialize(), wmtk::operations::OptimizationSmoothing::WMTKProblem< T >::is_step_valid(), and wmtk::operations::OptimizationSmoothing::WMTKProblem< T >::value().
auto wmtk::attribute::Accessor< T, MeshType, AttributeType_, Dim >::vector_attribute | ( | const ArgType & | t | ) | -> MapResult<std::max(D, Dim)> |
Definition at line 69 of file Accessor.hxx.
|
friend |
Definition at line 50 of file Accessor.hpp.
|
friend |
Definition at line 52 of file Accessor.hpp.
|
friend |
Definition at line 46 of file Accessor.hpp.
|
friend |
Definition at line 48 of file Accessor.hpp.
|
friend |
Definition at line 47 of file Accessor.hpp.
|
friend |
Definition at line 49 of file Accessor.hpp.
|
friend |
Definition at line 50 of file Accessor.hpp.
|
private |
Definition at line 182 of file Accessor.hpp.
|
private |
Definition at line 180 of file Accessor.hpp.
|
private |
Definition at line 181 of file Accessor.hpp.