ESyS-Particle  2.3.2
TriMesh Class Reference

class for a triangle mesh More...

#include <TriMesh.h>

Collaboration diagram for TriMesh:

Public Types

typedef vector< Triangle >
::iterator 
triangle_iterator
typedef vector< Edge >::iterator edge_iterator
typedef vector< Corner >::iterator corner_iterator

Public Member Functions

 TriMesh ()
virtual ~TriMesh ()
void LoadMesh (const vector< MeshNodeData > &, const vector< MeshTriData > &)
void moveNode (int, const Vec3 &)
void translateBy (const Vec3 &translation)
triangle_iterator triangles_begin ()
triangle_iterator triangles_end ()
edge_iterator edges_begin ()
edge_iterator edges_end ()
corner_iterator corners_begin ()
corner_iterator corners_end ()
TrianglegetTriangleById (int)
bool hasMovedBy (double)
void resetCurrentDisplacement ()
void zeroForces ()
virtual void writeCheckPoint (ostream &, const string &) const
virtual void loadCheckPoint (istream &)
template<typename P >
void forAllTrianglesGet (P &, typename P::value_type(Triangle::*rdf)() const)
template<typename P >
vector< pair< int, P > > forAllTrianglesGetIndexed (P(Triangle::*rdf)() const)

Private Attributes

vector< Trianglem_triangles
vector< Edgem_edges
vector< Cornerm_corners
multimap< int, Triangle * > m_triangle_by_node_id
multimap< int, Edge * > m_edge_by_node_id
map< int, int > m_corner_by_id
map< int, int > m_tri_index_by_id

Detailed Description

class for a triangle mesh

Author
Steffen Abe $Revision$ $Date$

Member Typedef Documentation

typedef vector<Corner>::iterator TriMesh::corner_iterator
typedef vector<Edge>::iterator TriMesh::edge_iterator
typedef vector<Triangle>::iterator TriMesh::triangle_iterator

Constructor & Destructor Documentation

TriMesh::TriMesh ( )

Constructor

virtual TriMesh::~TriMesh ( )
inlinevirtual

Member Function Documentation

corner_iterator TriMesh::corners_begin ( )
inline

References m_corners.

corner_iterator TriMesh::corners_end ( )
inline

References m_corners.

edge_iterator TriMesh::edges_begin ( )
inline

References m_edges.

edge_iterator TriMesh::edges_end ( )
inline

References m_edges.

template<typename P >
void TriMesh::forAllTrianglesGet ( P &  cont,
typename P::value_type(Triangle::*)() const  rdf 
)

Call a constant member function of Triangle taking no argument and returning a value for all Triangles and collect the return values in a container. The container has to be an STL sequence container (vector,list...) or something with the same interface. The template parameter P is a type of container of the return type of the particle member function, not the return type itself.

Parameters
contthe container
rdfthe particle member function

References esys::lsm::bpu::iter(), and m_triangles.

Here is the call graph for this function:

template<typename P >
vector< pair< int, P > > TriMesh::forAllTrianglesGetIndexed ( P(Triangle::*)() const  rdf)
Parameters
rdfthe particle member function

References esys::lsm::bpu::iter(), and m_triangles.

Referenced by VectorTriangleFieldSlave::SendDataFull(), and ScalarTriangleFieldSlave::SendDataFull().

Here is the call graph for this function:

Here is the caller graph for this function:

Triangle * TriMesh::getTriangleById ( int  id)

Get a pointer to a triangle with a given ID. If the ID doesn't exist, return NULL

Parameters
idthe id

References NULL.

bool TriMesh::hasMovedBy ( double  dist)

check if any point in the mesh has moved by at least the given distance

Parameters
distthe distance
void TriMesh::loadCheckPoint ( istream &  ist)
virtual

References esys::lsm::IterativeReader< TmplIterator >::getIterator().

Referenced by TSubLattice< T >::loadCheckPointData().

Here is the call graph for this function:

Here is the caller graph for this function:

void TriMesh::LoadMesh ( const vector< MeshNodeData > &  node_vec,
const vector< MeshTriData > &  tri_vec 
)

setup the triangle mesh from node,edge and triangle data

Parameters
node_vecthe node data
tri_vecthe triangle data

References console, Console::Error(), esys::lsm::bpu::iter(), and Console::XDebug().

Referenced by TSubLattice< T >::addTriMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

void TriMesh::moveNode ( int  id,
const Vec3 d 
)

Move a node in the mesh. If the node with the given Id isn't in the mesh, nothing happens

Parameters
idthe id of the node
dthe displacement

References esys::lsm::bpu::iter().

Here is the call graph for this function:

void TriMesh::resetCurrentDisplacement ( )

reset displacement since last neighbor search

References esys::lsm::bpu::iter().

Here is the call graph for this function:

void TriMesh::translateBy ( const Vec3 translation)

References esys::lsm::bpu::iter().

Here is the call graph for this function:

triangle_iterator TriMesh::triangles_begin ( )
inline

References m_triangles.

triangle_iterator TriMesh::triangles_end ( )
inline

References m_triangles.

void TriMesh::writeCheckPoint ( ostream &  ost,
const string &  delim 
) const
virtual

Write checkpoint data to stream. The mesh data is written in the original mesh file format -> can reuse meshreader to read in checkpointed meshes

Parameters
ostthe output stream
delimthe delimiter

References esys::lsm::bpu::iter().

Here is the call graph for this function:

void TriMesh::zeroForces ( )

zero all forces on the mesh. Currently forces are only on triangles

References console, esys::lsm::bpu::iter(), and Console::XDebug().

Here is the call graph for this function:

Member Data Documentation

map<int,int> TriMesh::m_corner_by_id
private
vector<Corner> TriMesh::m_corners
private

Referenced by corners_begin(), and corners_end().

multimap<int,Edge*> TriMesh::m_edge_by_node_id
private
vector<Edge> TriMesh::m_edges
private

Referenced by edges_begin(), and edges_end().

map<int,int> TriMesh::m_tri_index_by_id
private
multimap<int,Triangle*> TriMesh::m_triangle_by_node_id
private
vector<Triangle> TriMesh::m_triangles
private

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