FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Geometry::MeshDistortion< MeshType_ > Class Template Reference

(Unpartitioned) mesh distortion class template More...

#include <mesh_distortion.hpp>

Inheritance diagram for FEAT::Geometry::MeshDistortion< MeshType_ >:
FEAT::Geometry::DistributedMeshDistortion< MeshType_ >

Public Types

typedef MeshType_::CoordType CoordType
 

Public Member Functions

 MeshDistortion (MeshType_ &mesh)
 Constructor. More...
 
 MeshDistortion (MeshType_ &mesh, Random::SeedType seed)
 Constructor. More...
 
void distort_shortest_edge_local (CoordType scale=CoordType(0.1))
 Distorts the mesh according to the shortest local edge. More...
 
void distort_shortest_edge_uniform (CoordType scale=CoordType(0.1))
 Distorts the mesh according to the shortest edge. More...
 
void distort_uniform (CoordType rad)
 Distorts the mesh uniformly. More...
 

Static Public Attributes

static constexpr int shape_dim = MeshType_::shape_dim
 
static constexpr int world_dim = MeshType_::world_dim
 

Protected Member Functions

virtual void _calc_boundary_facets ()
 determines for each facet whether it is a boundary facet or an inner facet More...
 
virtual void _calc_boundary_vertices ()
 determines for each vertex whether it is a boundary vertex or an inner vertex More...
 
virtual void _calc_shortest_edge ()
 determines for each vertex the length of the shortest adjacent edge More...
 
virtual void _synchronize ()
 synchronizes the distortion over all processes; is overridden in DistributedMeshDistortion More...
 

Protected Attributes

std::vector< int > _boundary_facets
 vector to story which facet is at the boundary More...
 
std::vector< int > _boundary_vertices
 vector to store which vertex is at the boundary More...
 
MeshType_ & _mesh
 the mesh we want to distort More...
 
const CoordType _pi_val = Math::pi<CoordType>()
 have a guess... More...
 
Random _rand
 random number generator for random distortion More...
 
std::vector< CoordType > _shortest_edge
 vector to store the length of the shortest edge belonging to each vertex More...
 

Detailed Description

template<typename MeshType_>
class FEAT::Geometry::MeshDistortion< MeshType_ >

(Unpartitioned) mesh distortion class template

Template Parameters
MeshType_The type of the mesh that is to be distorted, e.g. ConformalMesh
Attention
This class should only be used in serial applications, i.e. on unpartitioned meshes! If you need to distort a partitioned mesh, use the derived DistributedMeshDistortion class template instead!
Author
Chantal Jahner

Definition at line 41 of file mesh_distortion.hpp.

Member Typedef Documentation

◆ CoordType

template<typename MeshType_ >
typedef MeshType_::CoordType FEAT::Geometry::MeshDistortion< MeshType_ >::CoordType

Definition at line 44 of file mesh_distortion.hpp.

Constructor & Destructor Documentation

◆ MeshDistortion() [1/2]

template<typename MeshType_ >
FEAT::Geometry::MeshDistortion< MeshType_ >::MeshDistortion ( MeshType_ &  mesh)
inlineexplicit

Constructor.

Parameters
[in]_meshA reference to the mesh that is to be distorted

Definition at line 69 of file mesh_distortion.hpp.

◆ MeshDistortion() [2/2]

template<typename MeshType_ >
FEAT::Geometry::MeshDistortion< MeshType_ >::MeshDistortion ( MeshType_ &  mesh,
Random::SeedType  seed 
)
inlineexplicit

Constructor.

Parameters
[in]_meshA reference to the mesh that is to be distorted
[in]_seedThe seed for the random number generator

Definition at line 87 of file mesh_distortion.hpp.

◆ ~MeshDistortion()

template<typename MeshType_ >
virtual FEAT::Geometry::MeshDistortion< MeshType_ >::~MeshDistortion ( )
inlinevirtual

Definition at line 96 of file mesh_distortion.hpp.

Member Function Documentation

◆ _calc_boundary_facets()

template<typename MeshType_ >
virtual void FEAT::Geometry::MeshDistortion< MeshType_ >::_calc_boundary_facets ( )
inlineprotectedvirtual

◆ _calc_boundary_vertices()

◆ _calc_shortest_edge()

◆ _synchronize()

template<typename MeshType_ >
virtual void FEAT::Geometry::MeshDistortion< MeshType_ >::_synchronize ( )
inlineprotectedvirtual

◆ distort_shortest_edge_local()

template<typename MeshType_ >
void FEAT::Geometry::MeshDistortion< MeshType_ >::distort_shortest_edge_local ( CoordType  scale = CoordType(0.1))
inline

Distorts the mesh according to the shortest local edge.

Moves each inner vertex on an arbitrary point on a circle (2D) or sphere (3D) around the original vertex The radius of the circle/sphere is determined by the shortest edge adjacent to the vertex: radius = scale * length_shortest_edge

Parameters
[in]scalefactor to scale the length of the shortest edge to determine the radius
Note
This function only moves inner vertices and leaves boundary vertices untouched.

Definition at line 188 of file mesh_distortion.hpp.

References FEAT::Geometry::MeshDistortion< MeshType_ >::_boundary_vertices, FEAT::Geometry::MeshDistortion< MeshType_ >::_calc_boundary_vertices(), FEAT::Geometry::MeshDistortion< MeshType_ >::_calc_shortest_edge(), FEAT::Geometry::MeshDistortion< MeshType_ >::_mesh, FEAT::Geometry::MeshDistortion< MeshType_ >::_pi_val, FEAT::Geometry::MeshDistortion< MeshType_ >::_rand, FEAT::Geometry::MeshDistortion< MeshType_ >::_shortest_edge, FEAT::Geometry::MeshDistortion< MeshType_ >::_synchronize(), FEAT::Math::cos(), and FEAT::Math::sin().

◆ distort_shortest_edge_uniform()

template<typename MeshType_ >
void FEAT::Geometry::MeshDistortion< MeshType_ >::distort_shortest_edge_uniform ( CoordType  scale = CoordType(0.1))
inline

Distorts the mesh according to the shortest edge.

Moves each inner vertex on an arbitrary point on a circle (2D) or sphere (3D) around the original vertex The radius of the circle/sphere is determined by the shortest edge in the mesh:

radius = scale * shortest_edge

Parameters
[in]scalefactor to scale the length of the shortest edge to determine the radius
Note
This function only moves inner vertices and leaves boundary vertices untouched.

Definition at line 167 of file mesh_distortion.hpp.

References FEAT::Geometry::MeshDistortion< MeshType_ >::_calc_boundary_vertices(), FEAT::Geometry::MeshDistortion< MeshType_ >::_calc_shortest_edge(), FEAT::Geometry::MeshDistortion< MeshType_ >::_shortest_edge, and FEAT::Geometry::MeshDistortion< MeshType_ >::distort_uniform().

◆ distort_uniform()

template<typename MeshType_ >
void FEAT::Geometry::MeshDistortion< MeshType_ >::distort_uniform ( CoordType  rad)
inline

Distorts the mesh uniformly.

Moves each inner vertex on an arbitrary point on a circle (2D) or sphere (3D) around the original vertex

Parameters
[in]radRadius of the circle or sphere
Note
This function only moves inner vertices and leaves boundary vertices untouched.

Definition at line 111 of file mesh_distortion.hpp.

References FEAT::Geometry::MeshDistortion< MeshType_ >::_boundary_vertices, FEAT::Geometry::MeshDistortion< MeshType_ >::_calc_boundary_vertices(), FEAT::Geometry::MeshDistortion< MeshType_ >::_mesh, FEAT::Geometry::MeshDistortion< MeshType_ >::_pi_val, FEAT::Geometry::MeshDistortion< MeshType_ >::_rand, FEAT::Geometry::MeshDistortion< MeshType_ >::_synchronize(), FEAT::Math::cos(), and FEAT::Math::sin().

Referenced by FEAT::Geometry::MeshDistortion< MeshType_ >::distort_shortest_edge_uniform().

Member Data Documentation

◆ _boundary_facets

template<typename MeshType_ >
std::vector<int> FEAT::Geometry::MeshDistortion< MeshType_ >::_boundary_facets
protected

◆ _boundary_vertices

template<typename MeshType_ >
std::vector<int> FEAT::Geometry::MeshDistortion< MeshType_ >::_boundary_vertices
protected

◆ _mesh

◆ _pi_val

template<typename MeshType_ >
const CoordType FEAT::Geometry::MeshDistortion< MeshType_ >::_pi_val = Math::pi<CoordType>()
protected

◆ _rand

template<typename MeshType_ >
Random FEAT::Geometry::MeshDistortion< MeshType_ >::_rand
protected

◆ _shortest_edge

template<typename MeshType_ >
std::vector<CoordType> FEAT::Geometry::MeshDistortion< MeshType_ >::_shortest_edge
protected

◆ shape_dim

template<typename MeshType_ >
constexpr int FEAT::Geometry::MeshDistortion< MeshType_ >::shape_dim = MeshType_::shape_dim
staticconstexpr

Definition at line 45 of file mesh_distortion.hpp.

◆ world_dim

template<typename MeshType_ >
constexpr int FEAT::Geometry::MeshDistortion< MeshType_ >::world_dim = MeshType_::world_dim
staticconstexpr

Definition at line 46 of file mesh_distortion.hpp.


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