LifeV
MeshTransformer< REGIONMESH, RMTYPE > Class Template Reference

Class to transform a mesh. More...

#include <MeshUtility.hpp>

+ Collaboration diagram for MeshTransformer< REGIONMESH, RMTYPE >:

Public Member Functions

 MeshTransformer (REGIONMESH &m)
 the constructor may take a reference to the mesh to be manipulated More...
 
template<typename VECTOR >
void moveMesh (const VECTOR &disp, UInt dim)
 Move the mesh according to a given displacement. More...
 
template<typename VECTOR >
void transformMesh (const VECTOR &scale, const VECTOR &rotate, const VECTOR &translate)
 Transform the mesh. More...
 
template<typename function >
void transformMesh (const function &meshMapping)
 Transform the mesh according to a given mapping. More...
 
bool hasOldPoint () const
 Tells if we store old points. More...
 
void savePoints ()
 Saves the mesh points. More...
 
void resetMovement ()
 Resets movement. More...
 
REGIONMESH::point_Type const & pointInitial (ID const i) const
 Returns the i-th mesh Point before the last movement. More...
 
REGIONMESH::points_Type const & pointListInitial () const
 Returns a constant reference to the list of Points before the last movement. More...
 

Private Attributes

REGIONMESH & M_mesh
 Appropriately sets internal switches. More...
 
REGIONMESH::points_Type M_pointList
 

Detailed Description

template<typename REGIONMESH, typename RMTYPE = typename REGIONMESH::markerCommon_Type>
class LifeV::MeshUtility::MeshTransformer< REGIONMESH, RMTYPE >

Class to transform a mesh.

Fix mesh switches Using some heuristics it tries to fix mesh switches A class that implements methods to transform a mesh without changing mesh connectivities. It has a constructor that takes the mesh to be transformed

Note
The Template RMTYPE is used to compile with IBM AIX compilers
Author
Luca Formaggia
Date
2 August 2011

Definition at line 2386 of file MeshUtility.hpp.

Constructor & Destructor Documentation

◆ MeshTransformer()

MeshTransformer ( REGIONMESH &  m)

the constructor may take a reference to the mesh to be manipulated

Definition at line 2517 of file MeshUtility.hpp.

Member Function Documentation

◆ moveMesh()

void moveMesh ( const VECTOR &  disp,
UInt  dim 
)

Move the mesh according to a given displacement.

It moves the mesh from the last position saved with savePoints() For backward compatibility, if it is called before without calling savePoints(), the first time it is called it will save the current mesh point and then apply the movement.

Displacement is a 3*numpoints() VECTOR which stores the x-displacement first, then the y-displacements etc.

The VECTOR object must comply with lifeV distributed vector concept EpetraVector in particular it must have the methods isGlobalIDPresent(Uint i).

Author
Miguel Fernandez
Date
11/2002
Parameters
dispDisplacement vector. In this version it must be an EpetraVector
dimLength of vector disp.
Todo:
this method should be changed to make sure not to generate invalid elements

Definition at line 2523 of file MeshUtility.hpp.

◆ transformMesh() [1/2]

void transformMesh ( const VECTOR &  scale,
const VECTOR &  rotate,
const VECTOR &  translate 
)

Transform the mesh.

It uses boost::numeric::ublas (3,3) matrices scale, rotate and translate to perform the mesh movement (operations performed in this order).

Date
14/09/2009
Author
Cristiano Malossi
Note
- Rotation follows Paraview conventions: first rotate around z-axis, then around y-axis and finally around x-axis;
- All the vectors must allow the command: operator[];
Parameters
scalevector of three components for (x,y,z) scaling of the mesh
rotatevector of three components (radiants) for rotating the mesh
translatevector of three components for (x,y,z) translation the mesh
Todo:
Change using homogeneous coordinates to make it more efficient.

Definition at line 2590 of file MeshUtility.hpp.

◆ transformMesh() [2/2]

void transformMesh ( const function &  meshMapping)

Transform the mesh according to a given mapping.

Transform the mesh according to a given meshMapping(Real& x, Real& y, Real& z).

Date
12/2010
Author
Mauro Perego
Parameters
meshMappingfunction void meshMmapping(Real& x, Real& y, Real& z) which receive x, y, z, and transform them according to a certain mapping

Definition at line 2669 of file MeshUtility.hpp.

◆ hasOldPoint()

bool hasOldPoint ( ) const
inline

Tells if we store old points.

If true than we can interrogate the old point position

Definition at line 2442 of file MeshUtility.hpp.

◆ savePoints()

void savePoints ( )

Saves the mesh points.

Useful for algorithms which require to remember the position of the mesh before the movement

Definition at line 2555 of file MeshUtility.hpp.

◆ resetMovement()

void resetMovement ( )
inline

Resets movement.

Next step is like the mesh has never moved

Definition at line 2454 of file MeshUtility.hpp.

◆ pointInitial()

const REGIONMESH::point_Type & pointInitial ( ID const  i) const

Returns the i-th mesh Point before the last movement.

If the mesh points have not been saved with a previous call to savePoints() the method returns the mesh point

Note
Avoid extensive use: it is inefficient. use pointListInitial() instead
Parameters
iId of the Point.
Returns
i-th mesh Point before the last movement.

Definition at line 2574 of file MeshUtility.hpp.

◆ pointListInitial()

const REGIONMESH::points_Type & pointListInitial ( ) const

Returns a constant reference to the list of Points before the last movement.

If the mesh points have not been saved with a previous call to savePoints() returns the current mesh Points

Returns
The list mesh Point before the last movement.

Definition at line 2582 of file MeshUtility.hpp.

Field Documentation

◆ M_mesh

REGIONMESH& M_mesh
private

Appropriately sets internal switches.

It must be called by any mesh transformation method to ensure that the handling of (possibly) stored points works;

Definition at line 2485 of file MeshUtility.hpp.

◆ M_pointList

REGIONMESH::points_Type M_pointList
private

Definition at line 2486 of file MeshUtility.hpp.


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