ESyS-Particle  2.3.2
Mesh2D Class Reference

#include <Mesh2D.h>

Collaboration diagram for Mesh2D:

Public Types

typedef vector< Edge2D >::iterator edge_iterator
typedef vector< Corner2D >
::iterator 
corner_iterator

Public Member Functions

 Mesh2D ()
virtual ~Mesh2D ()
void LoadMesh (const vector< MeshNodeData2D > &, const vector< MeshEdgeData2D > &)
void moveNode (int, const Vec3 &)
void translateBy (const Vec3 &translation)
edge_iterator edges_begin ()
edge_iterator edges_end ()
corner_iterator corners_begin ()
corner_iterator corners_end ()
Edge2DgetEdgeById (int)
Corner2DgetCornerById (int)
void zeroForces ()
virtual void writeCheckPoint (ostream &, const string &) const
virtual void loadCheckPoint (istream &)
template<typename P >
void forAllEdgesGet (P &, typename P::value_type(Edge2D::*rdf)() const)
template<typename P >
vector< pair< int, P > > forAllEdgesGetIndexed (P(Edge2D::*rdf)() const)

Private Attributes

vector< Edge2Dm_edges
vector< Corner2Dm_corners
map< int, int > m_corner_by_id
multimap< int, Edge2D * > m_edge_by_node_id
map< int, int > m_edge_index_by_id

Detailed Description

A class for a 2D "mesh", i.e. a collection of lines connected by corners in a 2D plane which can interact with particles in 2D. The Main purpose is for coupling with 2D FEM (Finley) simulations via escript.

Member Typedef Documentation

typedef vector<Corner2D>::iterator Mesh2D::corner_iterator
typedef vector<Edge2D>::iterator Mesh2D::edge_iterator

Constructor & Destructor Documentation

Mesh2D::Mesh2D ( )

constructor for empty 2D mesh

virtual Mesh2D::~Mesh2D ( )
inlinevirtual

Member Function Documentation

corner_iterator Mesh2D::corners_begin ( )
inline

References m_corners.

corner_iterator Mesh2D::corners_end ( )
inline

References m_corners.

edge_iterator Mesh2D::edges_begin ( )
inline

References m_edges.

edge_iterator Mesh2D::edges_end ( )
inline

References m_edges.

template<typename P >
void Mesh2D::forAllEdgesGet ( P &  cont,
typename P::value_type(Edge2D::*)() const  rdf 
)

Call a constant member function of Edge2D taking no argument and returning a value for all edges 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_edges.

Here is the call graph for this function:

template<typename P >
vector< pair< int, P > > Mesh2D::forAllEdgesGetIndexed ( P(Edge2D::*)() const  rdf)
Parameters
rdfthe particle member function

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

Referenced by VectorEdge2DFieldSlave::SendDataFull().

Here is the call graph for this function:

Here is the caller graph for this function:

Corner2D * Mesh2D::getCornerById ( int  id)

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

Parameters
idthe id

References NULL.

Edge2D * Mesh2D::getEdgeById ( int  id)

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

Parameters
idthe id

References NULL.

void Mesh2D::loadCheckPoint ( istream &  ist)
virtual

load checkpoint data from stream. Re-uses code from meshreader to read in checkpointed meshes

Parameters
istthe input stream
Warning
doesn't deal with tags yet

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 Mesh2D::LoadMesh ( const vector< MeshNodeData2D > &  node_vec,
const vector< MeshEdgeData2D > &  edge_vec 
)

setup 2D mesh from node and edge data

Parameters
node_vecthe node data
edge_vecthe edge data

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

move one node by a given amount

Parameters
idthe id of the node
dthe displacement

References esys::lsm::bpu::iter(), Corner2D::move(), and NULL.

Here is the call graph for this function:

void Mesh2D::translateBy ( const Vec3 translation)
void Mesh2D::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
Warning
doesn't deal with tags yet

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

Here is the call graph for this function:

void Mesh2D::zeroForces ( )

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

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

Here is the call graph for this function:

Member Data Documentation

map<int,int> Mesh2D::m_corner_by_id
private
vector<Corner2D> Mesh2D::m_corners
private

Referenced by corners_begin(), and corners_end().

multimap<int,Edge2D*> Mesh2D::m_edge_by_node_id
private
map<int,int> Mesh2D::m_edge_index_by_id
private
vector<Edge2D> Mesh2D::m_edges
private

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