FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Geometry::SubdivisionLevels Class Reference

Subdivision level markings for meshes. More...

#include <subdivision_levels.hpp>

Public Member Functions

 SubdivisionLevels (Index num_vertices)
 Constructor. More...
 
 SubdivisionLevels (Index num_vertices, std::uint64_t default_level)
 Constructor. More...
 
 SubdivisionLevels (SubdivisionLevels &&other) noexcept
 move-constructor More...
 
 SubdivisionLevels (SubdivisionLevels &other)=delete
 deleted copy-constructor
 
 ~SubdivisionLevels ()=default
 destructor
 
template<int n>
SubdivisionLevelTuple< n > get_levels (const IndexTuple< n > &indices) const
 Retrieve SubdivisionLevelTuple. More...
 
std::uint64_t maximum_level ()
 Returns the maximum refinement level assigned to any vertex. More...
 
void merge (const SubdivisionLevels &other)
 Adds up two SubdivisionLevels. More...
 
SubdivisionLevelsoperator= (SubdivisionLevels &&other) noexcept
 move-assign operator More...
 
SubdivisionLevelsoperator= (SubdivisionLevels &other)=delete
 deleted copy-assign operator
 
std::uint64_t & operator[] (Index idx)
 access operator More...
 
const std::uint64_t & operator[] (Index idx) const
 access operator More...
 
template<typename MeshType >
void set_level_for_element (const MeshType &mesh, Index element, std::uint64_t element_level)
 Set subdivision level for a mesh element. More...
 
template<typename MeshType >
void set_per_element (const MeshType &mesh, std::function< std::uint64_t(Index)> f)
 Sets subdivision levels for each cell of the given mesh. More...
 
std::size_t size () const
 

Private Attributes

std::vector< std::uint64_t > _levels
 Level markings. More...
 

Friends

std::ostream & operator<< (std::ostream &, const SubdivisionLevels &)
 Debug output operator. More...
 

Detailed Description

Subdivision level markings for meshes.

Used to assign a subdivision level to each vertex of a mesh.

Author
Markus Muegge

Definition at line 74 of file subdivision_levels.hpp.

Constructor & Destructor Documentation

◆ SubdivisionLevels() [1/3]

FEAT::Geometry::SubdivisionLevels::SubdivisionLevels ( Index  num_vertices)
inlineexplicit

Constructor.

Parameters
[in]num_verticesNumber of vertices to mark

Definition at line 85 of file subdivision_levels.hpp.

◆ SubdivisionLevels() [2/3]

FEAT::Geometry::SubdivisionLevels::SubdivisionLevels ( Index  num_vertices,
std::uint64_t  default_level 
)
inline

Constructor.

Parameters
[in]num_verticesNumber of vertices to mark
[in]default_levelDefault subdivision level for each vertex

Definition at line 95 of file subdivision_levels.hpp.

◆ SubdivisionLevels() [3/3]

FEAT::Geometry::SubdivisionLevels::SubdivisionLevels ( SubdivisionLevels &&  other)
inlinenoexcept

move-constructor

Definition at line 100 of file subdivision_levels.hpp.

Member Function Documentation

◆ get_levels()

template<int n>
SubdivisionLevelTuple< n > FEAT::Geometry::SubdivisionLevels::get_levels ( const IndexTuple< n > &  indices) const
inline

Retrieve SubdivisionLevelTuple.

Parameters
[in]indicesVertex-Indices to retrieve levels for

Definition at line 231 of file subdivision_levels.hpp.

References _levels, and FEAT::Geometry::IndexTuple< num_indices_ >::num_indices.

◆ maximum_level()

std::uint64_t FEAT::Geometry::SubdivisionLevels::maximum_level ( )
inline

Returns the maximum refinement level assigned to any vertex.

Definition at line 144 of file subdivision_levels.hpp.

References _levels.

◆ merge()

void FEAT::Geometry::SubdivisionLevels::merge ( const SubdivisionLevels other)
inline

Adds up two SubdivisionLevels.

Definition at line 216 of file subdivision_levels.hpp.

References _levels, and FEAT::Geometry::other.

◆ operator=()

SubdivisionLevels & FEAT::Geometry::SubdivisionLevels::operator= ( SubdivisionLevels &&  other)
inlinenoexcept

move-assign operator

Definition at line 106 of file subdivision_levels.hpp.

References _levels, and FEAT::Geometry::other.

◆ operator[]() [1/2]

std::uint64_t & FEAT::Geometry::SubdivisionLevels::operator[] ( Index  idx)
inline

access operator

Definition at line 128 of file subdivision_levels.hpp.

References _levels, and ASSERT.

◆ operator[]() [2/2]

const std::uint64_t & FEAT::Geometry::SubdivisionLevels::operator[] ( Index  idx) const
inline

access operator

Definition at line 135 of file subdivision_levels.hpp.

References _levels, and ASSERT.

◆ set_level_for_element()

template<typename MeshType >
void FEAT::Geometry::SubdivisionLevels::set_level_for_element ( const MeshType &  mesh,
Index  element,
std::uint64_t  element_level 
)
inline

Set subdivision level for a mesh element.

Assigns maximum of current level and element level to all vertices making up the chosen element.

Parameters
[in]meshMesh to take elements from
[in]elementElement to set level for
[in]element_levelLevel to set

Definition at line 200 of file subdivision_levels.hpp.

References _levels.

Referenced by set_per_element().

◆ set_per_element()

template<typename MeshType >
void FEAT::Geometry::SubdivisionLevels::set_per_element ( const MeshType &  mesh,
std::function< std::uint64_t(Index)>  f 
)
inline

Sets subdivision levels for each cell of the given mesh.

Vertices will be set to the maximum level of any cell they are contained in.

Template Parameters
MeshTypeThe type of the given mesh
Parameters
[in]meshThe mesh for whose cells levels should be set
[in]fA function assigning a level to each cell of mesh

Definition at line 173 of file subdivision_levels.hpp.

References _levels, and set_level_for_element().

◆ size()

std::size_t FEAT::Geometry::SubdivisionLevels::size ( ) const
inline

Definition at line 154 of file subdivision_levels.hpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const SubdivisionLevels sdls 
)
friend

Debug output operator.

Definition at line 247 of file subdivision_levels.hpp.

Member Data Documentation

◆ _levels

std::vector<std::uint64_t> FEAT::Geometry::SubdivisionLevels::_levels
private

The documentation for this class was generated from the following file: