FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Geometry::VertexSet< num_coords_, Coord_ > Struct Template Reference

Fixed-Sized Vertex Set class template. More...

#include <vertex_set.hpp>

Public Types

typedef Coord_ CoordType
 vertex coordinate type More...
 
typedef Tiny::Vector< CoordType, num_coordsVertexType
 vertex type More...
 

Public Member Functions

 VertexSet ()
 standard constructor More...
 
 VertexSet (Index num_vertices)
 Constructor. More...
 
 VertexSet (VertexSet &&other)
 move constructor More...
 
virtual ~VertexSet ()
 virtual destructor More...
 
VertexTypebegin ()
 Iterator to the first element. More...
 
const VertexTypebegin () const
 Iterator to the first element. More...
 
std::size_t bytes () const
 
VertexSet clone () const
 
template<typename DT2_ >
std::vector< Tiny::Vector< DT2_, num_coords > > clone_internal_vector () const
 
VertexTypeend ()
 Iterator past the last element. More...
 
const VertexTypeend () const
 Iterator to the first element. More...
 
int get_num_coords () const
 Returns the number of coordinates per vertex. More...
 
Index get_num_vertices () const
 Returns the number of vertices in the vertex set. More...
 
VertexSetoperator= (VertexSet &&other)
 move-assignment operator More...
 
VertexTypeoperator[] (Index i)
 Returns a reference to a vertex. More...
 
const VertexTypeoperator[] (Index i) const
 Returns a reference to a vertex. More...
 
void permute (const Adjacency::Permutation &perm, bool invert=false)
 Applies a permutation onto this vertex set. More...
 
void transform (const VertexType &origin, const VertexType &angles, const VertexType &offset)
 Applies a "proper rigid" transformation onto the vertex set. More...
 

Static Public Member Functions

static String name ()
 Returns the name of the class. More...
 

Static Public Attributes

static constexpr int num_coords = num_coords_
 number of coordinates per vertex More...
 

Protected Member Functions

 VertexSet (const std::vector< VertexType > &vtx)
 internal clone constructor More...
 

Protected Attributes

std::vector< VertexType_vertices
 vertex vector More...
 

Detailed Description

template<int num_coords_, typename Coord_ = Real>
struct FEAT::Geometry::VertexSet< num_coords_, Coord_ >

Fixed-Sized Vertex Set class template.

This class implements a vertex set whose number of coordinates is specified at compile-time.

Template Parameters
num_coords_The number of coordinates per vertex. Must be > 0.
Coord_The data type for a vertex coordinate.
Author
Peter Zajac

Definition at line 36 of file vertex_set.hpp.

Member Typedef Documentation

◆ CoordType

template<int num_coords_, typename Coord_ = Real>
typedef Coord_ FEAT::Geometry::VertexSet< num_coords_, Coord_ >::CoordType

vertex coordinate type

Definition at line 45 of file vertex_set.hpp.

◆ VertexType

template<int num_coords_, typename Coord_ = Real>
typedef Tiny::Vector<CoordType, num_coords> FEAT::Geometry::VertexSet< num_coords_, Coord_ >::VertexType

vertex type

Definition at line 48 of file vertex_set.hpp.

Constructor & Destructor Documentation

◆ VertexSet() [1/4]

template<int num_coords_, typename Coord_ = Real>
FEAT::Geometry::VertexSet< num_coords_, Coord_ >::VertexSet ( const std::vector< VertexType > &  vtx)
inlineexplicitprotected

internal clone constructor

Definition at line 82 of file vertex_set.hpp.

◆ VertexSet() [2/4]

template<int num_coords_, typename Coord_ = Real>
FEAT::Geometry::VertexSet< num_coords_, Coord_ >::VertexSet ( )
inline

standard constructor

Definition at line 89 of file vertex_set.hpp.

Referenced by FEAT::Geometry::VertexSet< num_coords_, Coord_ >::clone().

◆ VertexSet() [3/4]

template<int num_coords_, typename Coord_ = Real>
FEAT::Geometry::VertexSet< num_coords_, Coord_ >::VertexSet ( Index  num_vertices)
inlineexplicit

Constructor.

Parameters
[in]num_verticesThe number of vertices to be allocated in the vertex set.

Definition at line 100 of file vertex_set.hpp.

◆ VertexSet() [4/4]

template<int num_coords_, typename Coord_ = Real>
FEAT::Geometry::VertexSet< num_coords_, Coord_ >::VertexSet ( VertexSet< num_coords_, Coord_ > &&  other)
inline

move constructor

Definition at line 106 of file vertex_set.hpp.

◆ ~VertexSet()

template<int num_coords_, typename Coord_ = Real>
virtual FEAT::Geometry::VertexSet< num_coords_, Coord_ >::~VertexSet ( )
inlinevirtual

virtual destructor

Definition at line 122 of file vertex_set.hpp.

Member Function Documentation

◆ begin() [1/2]

template<int num_coords_, typename Coord_ = Real>
VertexType * FEAT::Geometry::VertexSet< num_coords_, Coord_ >::begin ( )
inline

Iterator to the first element.

Returns
A pointer to the start of the internal vector _vertices.

Definition at line 189 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::_vertices.

◆ begin() [2/2]

template<int num_coords_, typename Coord_ = Real>
const VertexType * FEAT::Geometry::VertexSet< num_coords_, Coord_ >::begin ( ) const
inline

Iterator to the first element.

Returns
A pointer to the start of the internal vector _vertices.

Definition at line 195 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::_vertices.

◆ bytes()

template<int num_coords_, typename Coord_ = Real>
std::size_t FEAT::Geometry::VertexSet< num_coords_, Coord_ >::bytes ( ) const
inline

◆ clone()

template<int num_coords_, typename Coord_ = Real>
VertexSet FEAT::Geometry::VertexSet< num_coords_, Coord_ >::clone ( ) const
inline
Returns
An independent clone of this vertex set object.

Definition at line 127 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::VertexSet().

Referenced by FEAT::Geometry::ConformalMesh< Shape_, num_coords_, Coord_ >::clone().

◆ clone_internal_vector()

template<int num_coords_, typename Coord_ = Real>
template<typename DT2_ >
std::vector< Tiny::Vector< DT2_, num_coords > > FEAT::Geometry::VertexSet< num_coords_, Coord_ >::clone_internal_vector ( ) const
inline

Definition at line 133 of file vertex_set.hpp.

◆ end() [1/2]

template<int num_coords_, typename Coord_ = Real>
VertexType * FEAT::Geometry::VertexSet< num_coords_, Coord_ >::end ( )
inline

Iterator past the last element.

Returns
A pointer to the end + 1 of the internal vector _vertices.

Definition at line 205 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::_vertices.

◆ end() [2/2]

template<int num_coords_, typename Coord_ = Real>
const VertexType * FEAT::Geometry::VertexSet< num_coords_, Coord_ >::end ( ) const
inline

Iterator to the first element.

Returns
A pointer to the start of the internal vector _vertices.

Definition at line 211 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::_vertices.

◆ get_num_coords()

template<int num_coords_, typename Coord_ = Real>
int FEAT::Geometry::VertexSet< num_coords_, Coord_ >::get_num_coords ( ) const
inline

Returns the number of coordinates per vertex.

Definition at line 151 of file vertex_set.hpp.

◆ get_num_vertices()

template<int num_coords_, typename Coord_ = Real>
Index FEAT::Geometry::VertexSet< num_coords_, Coord_ >::get_num_vertices ( ) const
inline

◆ name()

template<int num_coords_, typename Coord_ = Real>
static String FEAT::Geometry::VertexSet< num_coords_, Coord_ >::name ( )
inlinestatic

Returns the name of the class.

Definition at line 274 of file vertex_set.hpp.

◆ operator=()

template<int num_coords_, typename Coord_ = Real>
VertexSet & FEAT::Geometry::VertexSet< num_coords_, Coord_ >::operator= ( VertexSet< num_coords_, Coord_ > &&  other)
inline

move-assignment operator

Definition at line 112 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::_vertices, and FEAT::Geometry::other.

◆ operator[]() [1/2]

template<int num_coords_, typename Coord_ = Real>
VertexType & FEAT::Geometry::VertexSet< num_coords_, Coord_ >::operator[] ( Index  i)
inline

Returns a reference to a vertex.

Parameters
[in]iThe index of the vertex to be returned.
Returns
A reference to the vertex.

Definition at line 171 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::_vertices, ASSERT, and FEAT::Geometry::VertexSet< num_coords_, Coord_ >::get_num_vertices().

◆ operator[]() [2/2]

template<int num_coords_, typename Coord_ = Real>
const VertexType & FEAT::Geometry::VertexSet< num_coords_, Coord_ >::operator[] ( Index  i) const
inline

Returns a reference to a vertex.

Parameters
[in]iThe index of the vertex to be returned.
Returns
A reference to the vertex.

Definition at line 178 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::_vertices, ASSERT, and FEAT::Geometry::VertexSet< num_coords_, Coord_ >::get_num_vertices().

◆ permute()

template<int num_coords_, typename Coord_ = Real>
void FEAT::Geometry::VertexSet< num_coords_, Coord_ >::permute ( const Adjacency::Permutation perm,
bool  invert = false 
)
inline

Applies a permutation onto this vertex set.

Parameters
[in]permThe permutation that is to be applied.
[in]invertSpecifies whether to apply the inverse permutation instead of the forward one.

Definition at line 264 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::_vertices, FEAT::Adjacency::Permutation::apply(), FEAT::Adjacency::Permutation::empty(), FEAT::Adjacency::Permutation::size(), and XASSERT.

Referenced by FEAT::Geometry::ConformalMesh< Shape_, num_coords_, Coord_ >::create_permutation(), and FEAT::Geometry::ConformalMesh< Shape_, num_coords_, Coord_ >::set_permutation().

◆ transform()

template<int num_coords_, typename Coord_ = Real>
void FEAT::Geometry::VertexSet< num_coords_, Coord_ >::transform ( const VertexType origin,
const VertexType angles,
const VertexType offset 
)
inline

Applies a "proper rigid" transformation onto the vertex set.

Let v denote the origin world point, w the offset world point and R the rotation matrix corresponding to the angles, then this function applies the following transformation for any vertex x of the vertex set:

\[ x \mapsto w + R\cdot (x - v) \]

Parameters
[in]originThe origin of the transformation. This is subtracted from any vertex before applying the rotation.
[in]anglesThe angles of the rotation matrix.
  • 2D: the rotation angle in radians is stored as:
    • angles(0): rotation angle
    • angles(1): ignored
  • 3D: the rotation angles in radians stored as:
    • angles(0): yaw angle
    • angles(1): pitch angle
    • angles(2): roll angle
[in]offsetThe offset of the transformation. This is added to any vertex after applying the rotation.

Definition at line 242 of file vertex_set.hpp.

References FEAT::Geometry::VertexSet< num_coords_, Coord_ >::_vertices.

Referenced by FEAT::Geometry::ConformalMesh< Shape_, num_coords_, Coord_ >::transform().

Member Data Documentation

◆ _vertices

◆ num_coords

template<int num_coords_, typename Coord_ = Real>
constexpr int FEAT::Geometry::VertexSet< num_coords_, Coord_ >::num_coords = num_coords_
staticconstexpr

number of coordinates per vertex

Definition at line 42 of file vertex_set.hpp.


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