GooseFEM 1.4.1.dev2+g78f16df
Loading...
Searching...
No Matches
GooseFEM::Mesh::Stitch Class Reference

Stitch mesh objects, automatically searching for overlapping nodes. More...

#include <GooseFEM/Mesh.h>

Inheritance diagram for GooseFEM::Mesh::Stitch:
GooseFEM::Mesh::Vstack

Public Member Functions

 Stitch (double rtol=1e-5, double atol=1e-8)
 
template<class C , class E >
void push_back (const C &coor, const E &conn)
 Add mesh to be stitched.
 
size_t nmesh () const
 Number of sub meshes.
 
size_t nelem () const
 Number of elements.
 
size_t nnode () const
 Number of nodes.
 
size_t nne () const
 Number of nodes-per-element.
 
size_t ndim () const
 Number of dimensions.
 
const array_type::tensor< double, 2 > & coor () const
 Nodal coordinates [nnode, ndim].
 
const array_type::tensor< size_t, 2 > & conn () const
 Connectivity [nelem, nne].
 
array_type::tensor< size_t, 2 > dofs () const
 DOF numbers for each node (numbered sequentially) [nnode, ndim].
 
std::vector< array_type::tensor< size_t, 1 > > nodemap () const
 Node-map per sub-mesh.
 
std::vector< array_type::tensor< size_t, 1 > > elemmap () const
 Element-map per sub-mesh.
 
array_type::tensor< size_t, 1 > nodemap (size_t mesh_index) const
 The node numbers in the stitched mesh that are coming from a specific sub-mesh.
 
array_type::tensor< size_t, 1 > elemmap (size_t mesh_index) const
 The element numbers in the stitched mesh that are coming from a specific sub-mesh.
 
template<class T >
T nodeset (const T &set, size_t mesh_index) const
 Convert set of node-numbers for a sub-mesh to the stitched mesh.
 
template<class T >
T elemset (const T &set, size_t mesh_index) const
 Convert set of element-numbers for a sub-mesh to the stitched mesh.
 
template<class T >
T nodeset (const std::vector< T > &set) const
 Combine set of node numbers for an original to the final mesh (removes duplicates).
 
template<class T >
T nodeset (std::initializer_list< T > set) const
 Combine set of node numbers for an original to the final mesh (removes duplicates).
 
template<class T >
T elemset (const std::vector< T > &set) const
 Combine set of element numbers for an original to the final mesh.
 
template<class T >
T elemset (std::initializer_list< T > set) const
 Combine set of element numbers for an original to the final mesh.
 

Protected Attributes

array_type::tensor< double, 2 > m_coor
 Nodal coordinates [nnode, ndim].
 
array_type::tensor< size_t, 2 > m_conn
 Connectivity [nelem, nne].
 
std::vector< array_type::tensor< size_t, 1 > > m_map
 See nodemap(size_t)
 
std::vector< size_tm_nel
 Number of elements per sub-mesh.
 
std::vector< size_tm_el_offset
 First element of every sub-mesh.
 
double m_rtol
 Relative tolerance to find overlapping nodes.
 
double m_atol
 Absolute tolerance to find overlapping nodes.
 

Detailed Description

Stitch mesh objects, automatically searching for overlapping nodes.

Definition at line 2013 of file Mesh.h.

Constructor & Destructor Documentation

◆ Stitch()

GooseFEM::Mesh::Stitch::Stitch ( double rtol = 1e-5,
double atol = 1e-8 )
inline
Parameters
rtolRelative tolerance for position match.
atolAbsolute tolerance for position match.

Definition at line 2019 of file Mesh.h.

Member Function Documentation

◆ conn()

const array_type::tensor< size_t, 2 > & GooseFEM::Mesh::Stitch::conn ( ) const
inline

Connectivity [nelem, nne].

Returns
nodes per element

Definition at line 2124 of file Mesh.h.

◆ coor()

const array_type::tensor< double, 2 > & GooseFEM::Mesh::Stitch::coor ( ) const
inline

Nodal coordinates [nnode, ndim].

Returns
coordinates per node

Definition at line 2115 of file Mesh.h.

◆ dofs()

array_type::tensor< size_t, 2 > GooseFEM::Mesh::Stitch::dofs ( ) const
inline

DOF numbers for each node (numbered sequentially) [nnode, ndim].

Returns
DOFs per node

Definition at line 2133 of file Mesh.h.

◆ elemmap() [1/2]

std::vector< array_type::tensor< size_t, 1 > > GooseFEM::Mesh::Stitch::elemmap ( ) const
inline

Element-map per sub-mesh.

Returns
elements per mesh

Definition at line 2157 of file Mesh.h.

◆ elemmap() [2/2]

array_type::tensor< size_t, 1 > GooseFEM::Mesh::Stitch::elemmap ( size_t mesh_index) const
inline

The element numbers in the stitched mesh that are coming from a specific sub-mesh.

Parameters
mesh_indexIndex of the sub-mesh.
Returns
List of element numbers.

Definition at line 2184 of file Mesh.h.

◆ elemset() [1/3]

template<class T >
T GooseFEM::Mesh::Stitch::elemset ( const std::vector< T > & set) const
inline

Combine set of element numbers for an original to the final mesh.

Parameters
setList of element numbers per mesh.
Returns
List of element numbers for the stitched mesh.

Definition at line 2265 of file Mesh.h.

◆ elemset() [2/3]

template<class T >
T GooseFEM::Mesh::Stitch::elemset ( const T & set,
size_t mesh_index ) const
inline

Convert set of element-numbers for a sub-mesh to the stitched mesh.

Parameters
setList of element numbers.
mesh_indexIndex of the sub-mesh.
Returns
List of element numbers for the stitched mesh.

Definition at line 2213 of file Mesh.h.

◆ elemset() [3/3]

template<class T >
T GooseFEM::Mesh::Stitch::elemset ( std::initializer_list< T > set) const
inline

Combine set of element numbers for an original to the final mesh.

Parameters
setList of element numbers per mesh.
Returns
List of element numbers for the stitched mesh.

Definition at line 2291 of file Mesh.h.

◆ ndim()

size_t GooseFEM::Mesh::Stitch::ndim ( ) const
inline

Number of dimensions.

Returns
unsigned int

Definition at line 2106 of file Mesh.h.

◆ nelem()

size_t GooseFEM::Mesh::Stitch::nelem ( ) const
inline

Number of elements.

Returns
unsigned int

Definition at line 2079 of file Mesh.h.

◆ nmesh()

size_t GooseFEM::Mesh::Stitch::nmesh ( ) const
inline

Number of sub meshes.

Returns
unsigned int

Definition at line 2070 of file Mesh.h.

◆ nne()

size_t GooseFEM::Mesh::Stitch::nne ( ) const
inline

Number of nodes-per-element.

Returns
unsigned int

Definition at line 2097 of file Mesh.h.

◆ nnode()

size_t GooseFEM::Mesh::Stitch::nnode ( ) const
inline

Number of nodes.

Returns
unsigned int

Definition at line 2088 of file Mesh.h.

◆ nodemap() [1/2]

std::vector< array_type::tensor< size_t, 1 > > GooseFEM::Mesh::Stitch::nodemap ( ) const
inline

Node-map per sub-mesh.

Returns
nodes per mesh

Definition at line 2144 of file Mesh.h.

◆ nodemap() [2/2]

array_type::tensor< size_t, 1 > GooseFEM::Mesh::Stitch::nodemap ( size_t mesh_index) const
inline

The node numbers in the stitched mesh that are coming from a specific sub-mesh.

Parameters
mesh_indexIndex of the sub-mesh.
Returns
List of node numbers.

Definition at line 2172 of file Mesh.h.

◆ nodeset() [1/3]

template<class T >
T GooseFEM::Mesh::Stitch::nodeset ( const std::vector< T > & set) const
inline

Combine set of node numbers for an original to the final mesh (removes duplicates).

Parameters
setList of node numbers per mesh.
Returns
List of node numbers for the stitched mesh.

Definition at line 2227 of file Mesh.h.

◆ nodeset() [2/3]

template<class T >
T GooseFEM::Mesh::Stitch::nodeset ( const T & set,
size_t mesh_index ) const
inline

Convert set of node-numbers for a sub-mesh to the stitched mesh.

Parameters
setList of node numbers.
mesh_indexIndex of the sub-mesh.
Returns
List of node numbers for the stitched mesh.

Definition at line 2198 of file Mesh.h.

◆ nodeset() [3/3]

template<class T >
T GooseFEM::Mesh::Stitch::nodeset ( std::initializer_list< T > set) const
inline

Combine set of node numbers for an original to the final mesh (removes duplicates).

Parameters
setList of node numbers per mesh.
Returns
List of node numbers for the stitched mesh.

Definition at line 2253 of file Mesh.h.

◆ push_back()

template<class C , class E >
void GooseFEM::Mesh::Stitch::push_back ( const C & coor,
const E & conn )
inline

Add mesh to be stitched.

Parameters
coorNodal coordinates [nnode, ndim].
connConnectivity [nelem, nne].

Definition at line 2032 of file Mesh.h.

Member Data Documentation

◆ m_atol

double GooseFEM::Mesh::Stitch::m_atol
protected

Absolute tolerance to find overlapping nodes.

Definition at line 2303 of file Mesh.h.

◆ m_conn

array_type::tensor<size_t, 2> GooseFEM::Mesh::Stitch::m_conn
protected

Connectivity [nelem, nne].

Definition at line 2298 of file Mesh.h.

◆ m_coor

array_type::tensor<double, 2> GooseFEM::Mesh::Stitch::m_coor
protected

Nodal coordinates [nnode, ndim].

Definition at line 2297 of file Mesh.h.

◆ m_el_offset

std::vector<size_t> GooseFEM::Mesh::Stitch::m_el_offset
protected

First element of every sub-mesh.

Definition at line 2301 of file Mesh.h.

◆ m_map

std::vector<array_type::tensor<size_t, 1> > GooseFEM::Mesh::Stitch::m_map
protected

See nodemap(size_t)

Definition at line 2299 of file Mesh.h.

◆ m_nel

std::vector<size_t> GooseFEM::Mesh::Stitch::m_nel
protected

Number of elements per sub-mesh.

Definition at line 2300 of file Mesh.h.

◆ m_rtol

double GooseFEM::Mesh::Stitch::m_rtol
protected

Relative tolerance to find overlapping nodes.

Definition at line 2302 of file Mesh.h.


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