ESyS-Particle
4.0.1
|
#include <Mesh2D.h>
Public Types | |
typedef vector< Edge2D >::iterator | edge_iterator |
typedef vector< Corner2D > ::iterator | corner_iterator |
Public Member Functions | |
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 () |
Edge2D * | getEdgeById (int) |
Corner2D * | getCornerById (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) |
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.
Mesh2D::Mesh2D | ( | ) |
constructor for empty 2D mesh
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.
cont | the container |
rdf | the particle member function |
vector< pair< int, P > > Mesh2D::forAllEdgesGetIndexed | ( | P(Edge2D::*)() const | rdf | ) |
rdf | the particle member function |
Referenced by VectorEdge2DFieldSlave::SendDataFull().
Corner2D * Mesh2D::getCornerById | ( | int | id | ) |
Get a pointer to a corner with a given ID. If the ID doesn't exist, return NULL
id | the id |
Edge2D * Mesh2D::getEdgeById | ( | int | id | ) |
Get a pointer to a edge with a given ID. If the ID doesn't exist, return NULL
id | the id |
|
virtual |
load checkpoint data from stream. Re-uses code from meshreader to read in checkpointed meshes
ist | the input stream |
void Mesh2D::LoadMesh | ( | const vector< MeshNodeData2D > & | node_vec, |
const vector< MeshEdgeData2D > & | edge_vec | ||
) |
setup 2D mesh from node and edge data
node_vec | the node data |
edge_vec | the edge data |
References BasicCon::Debug().
Referenced by TSubLattice< T >::addMesh2D().
void Mesh2D::moveNode | ( | int | id, |
const Vec3 & | d | ||
) |
move one node by a given amount
id | the id of the node |
d | the displacement |
References Corner2D::move().
|
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
ost | the output stream |
delim | the delimiter |
void Mesh2D::zeroForces | ( | ) |
zero all forces on the mesh. Currently forces are only on edge