ESyS-Particle
4.0.1
|
Public Types | |
typedef std::vector < esys::lsm::Runnable * > | RunnableVector |
typedef std::pair< int, int > | ParticleIdPair |
typedef std::vector < ParticleIdPair > | ParticleIdPairVector |
typedef std::vector< MeshNodeData > | MeshNodeDataVector |
typedef std::vector< MeshTriData > | MeshTriDataVector |
typedef std::pair < MeshNodeDataVector, MeshTriDataVector > | TriMeshDataPair |
typedef std::vector< int > | IdVector |
Public Member Functions | |
std::string | getLsmVersion () const |
int | getNumWorkerProcesses () const |
int | getTimeStep () const |
double | getTimeStepSize () const |
void | setTimeStepSize (double dt) |
void | init () |
void | spawnSlaves (int numWorkers) |
void | run () |
void | runInit () |
void | runOneStep () |
void | runEnd () |
void | oneStep () |
void | searchNeighbors (bool) |
bool | checkNeighbors () |
void | updateInteractions () |
void | addBondedIG (const CBondedIGP &) |
void | addCappedBondedIG (int, const std::string &, double, double, double) |
void | addShortBondedIG (int, const std::string &, double, double) |
void | addPairIG (const CElasticIGP &prms) |
void | addPairIG (const CFrictionIGP &prms) |
void | addPairIG (const FractalFrictionIGP &prms) |
void | addPairIG (const CAdhesiveFrictionIGP &prms) |
void | addPairIG (const CRotElasticIGP &prms) |
void | addPairIG (const CRotFrictionIGP &prms) |
void | addPairIG (const CHertzianElasticIGP &prms) |
void | addPairIG (const CHertzianViscoElasticFrictionIGP &prms) |
void | addPairIG (const CHertzianViscoElasticIGP &prms) |
void | addPairIG (const CLinearDashpotIGP &prms) |
void | addPairIG (const CRotThermElasticIGP &prms) |
void | addPairIG (const CRotThermFrictionIGP &prms) |
void | addTaggedPairIG (const CRotFrictionIGP &prms, int, int, int, int) |
void | addTaggedPairIG (const CFrictionIGP &prms, int, int, int, int) |
void | addTaggedPairIG (const CHertzianElasticIGP &prms, int, int, int, int) |
void | addTaggedPairIG (const CHertzianViscoElasticFrictionIGP &prms, int, int, int, int) |
void | addTaggedPairIG (const CHertzianViscoElasticIGP &prms, int, int, int, int) |
void | addTaggedPairIG (const CLinearDashpotIGP &prms, int, int, int, int) |
void | addTaggedPairIG (const CRotElasticIGP &prms, int, int, int, int) |
void | addTaggedPairIG (const CElasticIGP &prms, int, int, int, int) |
void | removeIG (const std::string &) |
void | readAndDistributeTriMesh (const std::string &, const std::string &, int) |
void | readAndDistributeTriMesh (const std::string &, const std::string &) |
void | createTriMesh (const std::string &meshName, const MeshNodeDataVector &mndVector, const MeshTriDataVector &mtdVector) |
void | addMesh2D (const std::string &, const std::string &, int) |
void | addMesh2DIG (const ETriMeshIP &prms) |
void | addTriMesh (const std::string &meshName, const std::string &fileName) |
void | addTriMeshIG (const ETriMeshIP &prms) |
void | addBondedTriMeshIG (const BTriMeshIP &triMeshPrms, const MeshTagBuildPrms &buildPrms) |
void | addBondedTriMeshIG (const BTriMeshIP &triMeshPrms, const MeshGapBuildPrms &buildPrms) |
void | addBondedMesh2DIG (const BMesh2DIP &, const MeshTagBuildPrms &) |
void | addBondedMesh2DIG (const BMesh2DIP &, const MeshGapBuildPrms &) |
void | addDamping (const CDampingIGP &dampingIGP) |
void | addDamping (const CLocalDampingIGP &dampingIGP) |
void | addDamping (const ABCDampingIGP &dampingIGP) |
void | addSingleIG (const esys::lsm::GravityIGP &gravityIGP) |
void | addExIG (const std::string &, const std::string &) |
void | setNumSteps (int s) |
int | getNumSteps () const |
int | getSteps () const |
void | addRotBondedIG (int, const std::string &, double, double, double, double, double, double, double, double, bool) |
void | addRotThermBondedIG (const CRotThermBondedIGP &prms) |
void | addWall (const std::string &, const Vec3 &, const Vec3 &) |
void | addWallIG (const CEWallIGP &) |
void | addWallIG (const CBWallIGP &) |
void | addWallIG (const CVWallIGP &) |
void | addWallIG (const CSoftBWallIGP &) |
Vec3 | getWallPosn (const std::string &) |
Vec3 | getWallForce (const std::string &) |
void | moveParticleTo (int particleTag, const Vec3 &posn) |
void | moveTaggedParticlesBy (int particleTag, const Vec3 &displacement) |
void | moveSingleParticleTo (int particleId, const Vec3 &posn) |
Vec3 | getParticlePosn (int particleId) |
void | setParticleNonDynamic (int) |
void | setParticleNonRot (int) |
void | setParticleNonTrans (int) |
void | setParticleVel (int, const Vec3 &) |
void | setParticleAngVel (int, const Vec3 &) |
void | setParticleDensity (int tag, int mask, double rho) |
void | setTaggedParticleVel (int tag, const Vec3 &) |
void | moveWallBy (const std::string &, const Vec3 &) |
void | setWallNormal (const std::string &, const Vec3 &) |
void | setVelocityOfWall (const std::string &, const Vec3 &) |
void | tagParticleNearestTo (int, int, const Vec3 &) |
int | findParticleNearestTo (const Vec3 &pos) |
void | applyForceToWall (const std::string &, const Vec3 &) |
void | moveSingleNodeBy (const std::string &, int, const Vec3 &) |
void | moveTaggedNodesBy (const std::string &, int, const Vec3 &) |
void | translateMeshBy (const std::string &, const Vec3 &) |
void | saveTimingDataToFile (const std::string &fileNamePrefix) |
void | do2dCalculations (bool do2d) |
void | setProcessDims (const esys::lsm::CLatticeParam::ProcessDims &dims) |
const esys::lsm::CLatticeParam::ProcessDims & | getProcessDims () const |
void | setTimingFileName (const std::string &fileName) |
const std::string & | getTimingFileName () const |
const std::string & | getParticleType () const |
int | getNumParticles () |
void | addScalarParticleSaveField (const std::string &, const std::string &, const std::string &, int, int, int) |
field saving functions | |
void | addTaggedScalarParticleSaveField (const std::string &, const std::string &, const std::string &, int, int, int, int, int) |
void | addVectorParticleSaveField (const std::string &, const std::string &, const std::string &, int, int, int) |
void | addTaggedVectorParticleSaveField (const std::string &, const std::string &, const std::string &, int, int, int, int, int) |
void | addScalarInteractionSaveField (const std::string &, const std::string &, const std::string &, const std::string &, const std::string &, int, int, int, bool checked=false) |
void | addVectorInteractionSaveField (const std::string &, const std::string &, const std::string &, const std::string &, const std::string &, int, int, int, bool checked=false) |
void | addTaggedScalarInteractionSaveField (const std::string &, const std::string &, const std::string &, const std::string &, const std::string &, int, int, int, int, int, bool) |
void | addTaggedScalarParticleDistributionSaver (const std::string &, const std::string &, const std::string &, int, int, int, int, int, int, double, double, int) |
void | addVectorTriangleSaveField (const string &, const string &, const string &, const string &, int, int, int) |
void | addScalarTriangleSaveField (const string &, const string &, const string &, const string &, int, int, int) |
void | addVectorWallField (const string &, const string &, vector< string >, const string &, int, int, int) |
void | addVectorParticleSaveFieldWT (const std::string &, const std::string &, const std::string &, int, int, int, const MaxTrigParams &) |
void | addTaggedVectorParticleSaveFieldWT (const std::string &, const std::string &, const std::string &, int, int, int, int, int, const MaxTrigParams &) |
void | performCheckPoints (const std::string &fileNamePrefix, int beginTime, int endTime, int timeInterval) |
void | performCheckPointsThroughMaster (const std::string &fileNamePrefix, int beginTime, int endTime, int timeInterval) |
void | initSnapShotController (const std::string &, int, int, int) |
void | makeLattice (const char *particleType, double gridSize, double verletDist) |
initialization functions | |
void | makeLattice (const char *particleType, double gridSize, double verletDist, double dt) |
void | addPreTimeStepRunnable (esys::lsm::Runnable &runnable) |
const RunnableVector & | getPreTimeStepRunnableVector () const |
RunnableVector & | getPreTimeStepRunnableVector () |
void | addPostTimeStepRunnable (esys::lsm::Runnable &runnable) |
const RunnableVector & | getPostTimeStepRunnableVector () const |
RunnableVector & | getPostTimeStepRunnableVector () |
void | setSpatialDomain (const Vec3 &minBBoxPt, const Vec3 &maxBBoxPt) |
void | setSpatialDomain (const Vec3 &minBBoxPt, const Vec3 &maxBBoxPt, const esys::lsm::IntVector &circDimVector) |
bool | haveSetSpatialDomain () const |
void | getSlaveSpatialDomains () |
void | initialiseGeometry (const esys::lsm::GeometryInfo &geoInfo) |
void | initialiseGeometry (const esys::lsm::GeometryInfo &geoInfo, bool) |
template<class TmplParticle > | |
void | readGeometry (const std::string &fileName) |
void | readGeometryFile (const std::string &fileName) |
void | loadCheckPointData (const std::string &checkPointFileName) |
template<class TmplIterator , class TmplParticle > | |
void | addParticles (TmplIterator &it) |
template<class TmplIterator > | |
void | addConnections (TmplIterator &it) |
template<typename TmplVisitor > | |
void | visitMeshFaceReferences (const string &meshName) |
template<typename TmplVisitor > | |
void | visitMesh2dNodeReferences (const string &meshName, TmplVisitor &visitor) |
template<typename TmplVisitor > | |
void | visitMesh2dEdgeStress (const string &meshName, TmplVisitor &visitor) |
template<typename TmplVisitor > | |
void | visitTriMeshFaceForce (const string &meshName, TmplVisitor &visitor) |
template<typename TmplVisitor , typename TmplParticle > | |
void | visitParticlesOfType (const IdVector &particleIdVector, TmplVisitor &visitor) |
template<typename TmplVisitor > | |
void | visitParticles (const IdVector &particleIdVector, TmplVisitor &visitor) |
void | setVerbosity (bool) |
Protected Types | |
typedef std::vector< int > | ConnIdVector |
Protected Member Functions | |
void | runRunnables (RunnableVector::iterator begin, RunnableVector::iterator end) |
void | runPreRunnables () |
void | runPostRunnables () |
void | makeWorkerComm () |
void | saveTimingData () |
TriMeshDataPair | readTriMesh (const std::string &fileName, int) |
TriMeshDataPair | readTriMesh (const std::string &fileName) |
void | readAndDistributeMesh2D (const std::string &, int) |
MpiRankAndComm | getGlobalRankAndComm () const |
void | disconnectWorkerProcesses () |
Protected Attributes | |
map< int, ConnIdVector > | m_temp_conn |
vector< AFieldMaster * > | m_save_fields |
double | m_x_max |
double | m_x_min |
double | m_y_max |
double | m_y_min |
double | m_z_max |
double | m_z_min |
int | m_global_rank |
int | m_global_size |
int | m_max_ts |
int | m_center_id |
double | m_total_time |
int | m_t |
double | m_dt |
bool | m_isInitialized |
bool | m_first_time |
std::string | m_particle_type |
RunnableVector | m_preRunnableVector |
RunnableVector | m_postRunnableVector |
TML_Comm | m_tml_global_comm |
MPI_Comm | m_global_comm |
void CLatticeMaster::addBondedIG | ( | const CBondedIGP & | prms | ) |
Create and add a new bonded IG
name | the name of the bonded IG |
k | spring constant of the created bonds |
dist | maximum distance between two particles to create bond |
break_dist | (relative) breaking distance of bonds |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CBondedIGP::k, CBondedIGP::rbreak, CMPIBarrier::wait(), and BasicCon::XDebug().
void CLatticeMaster::addBondedMesh2DIG | ( | const BMesh2DIP & | igp, |
const MeshGapBuildPrms & | buildPrms | ||
) |
add bonded interactions with 2d mesh
References BroadcastCommand::broadcast(), and BasicCon::Debug().
void CLatticeMaster::addBondedTriMeshIG | ( | const BTriMeshIP & | triMeshPrms, |
const MeshTagBuildPrms & | buildPrms | ||
) |
add bonded trimesh IG by particle tag
triMeshPrms | the interaction parameters, i.e. k , r_break.... |
buildPrms | the build parameters, i.e. the tag & mask |
References BroadcastCommand::broadcast(), and BasicCon::Debug().
void CLatticeMaster::addBondedTriMeshIG | ( | const BTriMeshIP & | triMeshPrms, |
const MeshGapBuildPrms & | buildPrms | ||
) |
add bonded trimesh IG by distance between particle & mesh
triMeshPrms | the interaction parameters, i.e. k , r_break.... |
buildPrms | the build parameters, i.e. the max. dist |
References BroadcastCommand::broadcast(), and BasicCon::Debug().
void CLatticeMaster::addCappedBondedIG | ( | int | , |
const std::string & | , | ||
double | , | ||
double | , | ||
double | |||
) |
Create and add a new bonded IG with force limit
name | the name of the bonded IG |
k | spring constant of the created bonds |
dist | maximum distance between two particles to create bond |
break_dist | (relative) breaking distance of bonds |
maxforce | the maximum force |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CMPIBarrier::wait(), and BasicCon::XDebug().
void CLatticeMaster::addConnections | ( | TmplIterator & | it | ) |
Adds enumeration of connections/bonds to the lattice.
it | Iterator object with next() and hasNext() methods. The TmplIterator::next() method is required to return an object which can accepted as a constructor argument for the SimpleConnectionData class. |
References CMPILCmdBuffer::broadcast(), TML_Comm::broadcast_cont_packed(), searchNeighbors(), CMPIBarrier::wait(), and BasicCon::XDebug().
void CLatticeMaster::addExIG | ( | const std::string & | , |
const std::string & | |||
) |
set IG s1 as excluding IG in s2, i.e. an two particles interacting in s1 can't interact in s2
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CMPIBarrier::wait(), and BasicCon::XDebug().
void CLatticeMaster::addMesh2D | ( | const std::string & | , |
const std::string & | , | ||
int | |||
) |
add a 2D mesh
name | the name of the mesh |
filename | the name of the mesh file |
tag | the tag of the edges that are included into the mesh |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and BasicCon::XDebug().
void CLatticeMaster::addMesh2DIG | ( | const ETriMeshIP & | prms | ) |
add(non-bonded) interaction group between particles and a 2D mesh
References BroadcastCommand::append(), BroadcastCommand::appendTypeAndName(), and BroadcastCommand::broadcast().
void CLatticeMaster::addParticles | ( | TmplIterator & | it | ) |
Adds enumeration of particles to the lattice.
it | Iterator object with next() and hasNext() methods. The TmplIterator::next() method is required to return an object which can accepted as a constructor argument for the CParticle class. |
References CMPILCmdBuffer::broadcast(), TML_Comm::broadcast_cont_packed(), searchNeighbors(), CMPIBarrier::wait(), and BasicCon::XDebug().
void CLatticeMaster::addPostTimeStepRunnable | ( | esys::lsm::Runnable & | runnable | ) |
Adds reference to an object whose 'run' method is executed at the end of the runOneStep method.
void CLatticeMaster::addPreTimeStepRunnable | ( | esys::lsm::Runnable & | runnable | ) |
Adds reference to an object whose 'run' method is executed at the beginning of the runOneStep method.
void CLatticeMaster::addScalarInteractionSaveField | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | , | ||
bool | checked = false |
||
) |
add a scalar interaction field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
igname | the name of the interaction group from which the field is taken |
savetype | output file format |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
checked | choose between normal and checked field (defaults to false) |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addScalarParticleSaveField | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | |||
) |
field saving functions
add a scalar particle field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
savetype | output file format |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addScalarTriangleSaveField | ( | const string & | filename, |
const string & | fieldname, | ||
const string & | meshname, | ||
const string & | savetype, | ||
int | t_0, | ||
int | t_end, | ||
int | dt | ||
) |
add a scalar field on the triangles of a given trimesh to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
meshname | the name of the mesh from which the field is taken |
savetype | the format in which the data is to be saved |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addShortBondedIG | ( | int | , |
const std::string & | , | ||
double | , | ||
double | |||
) |
Create and add a new short bonded IG
name | the name of the bonded IG |
k | spring constant of the created bonds |
dist | maximum distance between two particles to create bond |
break_dist | (relative) breaking distance of bonds |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CMPIBarrier::wait(), and BasicCon::XDebug().
void CLatticeMaster::addTaggedScalarInteractionSaveField | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | , | ||
int | , | ||
int | , | ||
bool | |||
) |
add a scalar interaction field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
igname | the name of the interaction group from which the field is taken |
savetype | output file format |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
tag | the particle tag |
mask | the mask used for tag comparisons |
checked | choice between "full" and "checked" fields |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addTaggedScalarParticleDistributionSaver | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | , | ||
int | , | ||
int | , | ||
int | , | ||
double | , | ||
double | , | ||
int | |||
) |
save the distribution/histogram of a scalar field on tagged particles
filename | the name of the file the field is saved into |
fieldname | the name of the field |
savetype | output file format (WINDOW or GLOBAL) |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between adding samples into the distribution |
t_snap | time between snapshot saves |
tag | tag of the particles for which the field is saved |
mask | the mask used in tag comparisons |
x_0 | minimum data size in distribution |
x_max | maximum data size in distribution |
nx | number of bins |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addTaggedScalarParticleSaveField | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | , | ||
int | , | ||
int | |||
) |
add a scalar particle field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
savetype | output file format |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
tag | tag of the particles for which the field is saved |
mask | the mask used in tag comparisons |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addTaggedVectorParticleSaveField | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | , | ||
int | , | ||
int | |||
) |
add a vector particle field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
savetype | output file format |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
tag | tag of the particles for which the field is saved |
mask | the mask used in tag comparisons |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addTaggedVectorParticleSaveFieldWT | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | , | ||
int | , | ||
int | , | ||
const MaxTrigParams & | |||
) |
add a vector particle field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
savetype | output file format |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
tag | tag of the particles for which the field is saved |
mask | the mask used in tag comparisons |
tprms | trigger parameters |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addTriMesh | ( | const std::string & | meshName, |
const std::string & | fileName | ||
) |
add a triangle mesh
name | the name of the mesh |
filename | the name of the mesh file |
References BasicCon::XDebug().
void CLatticeMaster::addTriMeshIG | ( | const ETriMeshIP & | prms | ) |
add(non-bonded) trimesh IG
References BroadcastCommand::append(), BroadcastCommand::appendTypeAndName(), and BroadcastCommand::broadcast().
void CLatticeMaster::addVectorInteractionSaveField | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | , | ||
bool | checked = false |
||
) |
add a vector interaction field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
igname | the name of the interaction group from which the field is taken |
savetype | output file format |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
checked | choose between normal and checked field (defaults to false) |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addVectorParticleSaveField | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | |||
) |
add a vector particle field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
savetype | output file format |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addVectorParticleSaveFieldWT | ( | const std::string & | , |
const std::string & | , | ||
const std::string & | , | ||
int | , | ||
int | , | ||
int | , | ||
const MaxTrigParams & | |||
) |
add a vector particle field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
savetype | output file format |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
tprms | trigger parameters |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addVectorTriangleSaveField | ( | const string & | filename, |
const string & | fieldname, | ||
const string & | meshname, | ||
const string & | savetype, | ||
int | t_0, | ||
int | t_end, | ||
int | dt | ||
) |
add a vector field on the triangles of a given trimesh to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
meshname | the name of the mesh from which the field is taken |
savetype | the format in which the data is to be saved |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::addVectorWallField | ( | const string & | filename, |
const string & | fieldname, | ||
vector< string > | walls, | ||
const string & | savetype, | ||
int | t_0, | ||
int | t_end, | ||
int | dt | ||
) |
add a vector wall field to the list of fields to be saved
filename | the name of the file the field is saved into |
fieldname | the name of the field |
walls | names of the walls |
t_0 | first timestep to be saved |
t_end | last timestep to be saved |
dt | timesteps between saves |
References CMPILCmdBuffer::broadcast(), and BasicCon::Debug().
add a wall to the sublattice
wname | the name of the wall |
ipos | initial position of the wall |
inorm | initial normal of the wall |
References BroadcastCommand::append(), BroadcastCommand::broadcast(), and BasicCon::Debug().
void CLatticeMaster::addWallIG | ( | const CEWallIGP & | param | ) |
add a elastic all interaction to model
param | the interaction parameters (name of the wall, name of the interaction, spring constant) |
References BroadcastCommand::broadcast(), BasicCon::Debug(), and BroadcastCommand::packInto().
void CLatticeMaster::addWallIG | ( | const CBWallIGP & | param | ) |
add a bonded wall interaction to model
param | the interaction parameters (name of the wall, name of the interaction, spring constant) |
References BroadcastCommand::broadcast(), BasicCon::Debug(), and BroadcastCommand::packInto().
void CLatticeMaster::addWallIG | ( | const CVWallIGP & | param | ) |
add a viscous wall interaction to model
param | the interaction parameters (name of the wall, name of the interaction, spring constant) |
References BroadcastCommand::broadcast(), BasicCon::Debug(), and BroadcastCommand::packInto().
void CLatticeMaster::addWallIG | ( | const CSoftBWallIGP & | param | ) |
add a bonded wall interaction with direction-dependent spring constant to model
param | the interaction parameters (name of the wall, name of the interaction, spring constant) |
References BroadcastCommand::broadcast(), BasicCon::Debug(), and BroadcastCommand::packInto().
void CLatticeMaster::applyForceToWall | ( | const std::string & | , |
const Vec3 & | |||
) |
apply a given force to a wall
id | the nr of the wall |
f | the force |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
bool CLatticeMaster::checkNeighbors | ( | ) |
Test if neighbor search is necessary.
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), CMPISGBufferRoot::gather(), CMPISGBufferRoot::pop_int(), and CMPIBarrier::wait().
void CLatticeMaster::createTriMesh | ( | const std::string & | meshName, |
const MeshNodeDataVector & | node_send_buffer, | ||
const MeshTriDataVector & | tri_send_buffer | ||
) |
create a triangle mesh from a vector of nodes and a vector of triangles
meshName | the name assigned to the triangle mesh |
node_send_buffer | the vector of nodes |
tri_send_buffer | the vector of triangles |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CMPIBarrier::wait(), and BasicCon::XDebug().
void CLatticeMaster::do2dCalculations | ( | bool | do2d | ) |
Enforces particles to be restricted to motion in the x-y plane.
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), and CVarMPIBuffer::broadcast().
int CLatticeMaster::findParticleNearestTo | ( | const Vec3 & | pos | ) |
Returns the id of the particle which is closest to the specified point.
Add a given tag to the particle closest to a given position. Only the bits set in the mask will be influenced, i.e. new_tag=(old_tag & !mask) | (tag & mask).
tag | the tag |
mask | the mask |
pos | the position |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
|
inline |
Returns vector of Runnable objects (which are run post-time-step).
|
inline |
Returns vector of Runnable objects (which are run post-time-step).
|
inline |
Returns vector of Runnable objects (which are run pre-time-step).
|
inline |
Returns vector of Runnable objects (which are run pre-time-step).
void CLatticeMaster::getSlaveSpatialDomains | ( | ) |
Gathers slave dimensions and coordinates.
References BasicCon::XDebug().
const std::string & CLatticeMaster::getTimingFileName | ( | ) | const |
Returns the name of the file to which timing results are written.
Vec3 CLatticeMaster::getWallForce | ( | const std::string & | WallName | ) |
Get force acting on a wall. Returns (0,0,0) for a non-existing wall.
WallName | the name of the wall |
References BroadcastCommand::append(), BroadcastCommand::broadcast(), and BasicCon::Debug().
Vec3 CLatticeMaster::getWallPosn | ( | const std::string & | WallName | ) |
Get position of a wall. Returns (0,0,0) for a non-existing wall.
WallName | the name of the wall |
References BroadcastCommand::append(), BroadcastCommand::broadcast(), and BasicCon::Debug().
bool CLatticeMaster::haveSetSpatialDomain | ( | ) | const |
Returns whether the setSpacialDomain method has been called with a non-zero volume bounding box.
void CLatticeMaster::initialiseGeometry | ( | const esys::lsm::GeometryInfo & | geoInfo | ) |
Initialises the bounding-box and circular boundary conditions of the lattice geometry.
geoInfo | Object containing bounding box of all particles. |
References esys::lsm::GeometryInfo::getBBoxCorners(), esys::lsm::GeometryInfo::getPeriodicDimensions(), and esys::lsm::GeometryInfo::hasAnyPeriodicDimensions().
void CLatticeMaster::initSnapShotController | ( | const std::string & | , |
int | , | ||
int | , | ||
int | |||
) |
Initialises parameters for performing model snapshots.
fileNamePrefix | Path prefix for checkpoint files. Multiple snapshot files may be generated for a single timestep snapshot. |
beginTime | Time to begin checkpointing. Time of first snapshot. |
endTime | End time for checkpointing. Time of last snapshot. |
timeInterval | Time interval between snapshot file generation. |
References BasicCon::Debug().
void CLatticeMaster::loadCheckPointData | ( | const std::string & | checkPointFileName | ) |
Reads particle and interaction configuration from a check-point summary file.
fileName | Name of file containing summary of check-point data. |
Load data from a save checkpoint in order to restart the simulation. Control flow: CLatticeMaster::loadCheckPointData() (i.e. here) -> CheckPointController::issueCheckPointLoadingCmd() -> [on worker] CheckPointer::loadCheckPoint() -> SubLattice::loadCheckPointData()
checkPointFileName | the name of the base file (*_0.txt) of the checkpoint |
void CLatticeMaster::makeLattice | ( | const char * | ptype, |
double | nrange, | ||
double | alpha | ||
) |
initialization functions
make a lattice from particles of the given type
ptype | the type of particle |
nrange | search range |
alpha | pair search cutoff |
dt | time step |
References CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and BasicCon::XDebug().
|
protected |
Generate a communicator excluding the master. Has to be done in the master too because the new communicator is derived from MPI_COMM_WORLD and MPI_Comm_create has to be executed by all members of the original communicator
void CLatticeMaster::moveParticleTo | ( | int | tag, |
const Vec3 & | d | ||
) |
Move all particles with a given tag to a given displacement relative to their original position.
id | the tag of the particles to be moved |
d | the displacement |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::moveSingleNodeBy | ( | const std::string & | , |
int | , | ||
const Vec3 & | |||
) |
Move a node in a TriMeshIG by a given amount.
tm_name | the name of the TriMeshIG |
id | the node id |
d | the displacement |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::moveTaggedNodesBy | ( | const std::string & | , |
int | , | ||
const Vec3 & | |||
) |
Move all nodes with a given tag in a TriMeshIG by a given amount.
tm_name | the name of the TriMeshIG |
tag | the tag |
d | the displacement |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::moveTaggedParticlesBy | ( | int | tag, |
const Vec3 & | d | ||
) |
Move all particles with a given tag by a given displacement relative to their current position.
tag | the tag of the particles to be moved |
d | the displacement |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::moveWallBy | ( | const std::string & | , |
const Vec3 & | |||
) |
move a wall to by given vector
id | the nr of the wall to be moved |
d | the movement |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::oneStep | ( | ) |
perform a single time step
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), BasicCon::Timing(), and CMPIBarrier::wait().
void CLatticeMaster::performCheckPoints | ( | const std::string & | fileNamePrefix, |
int | beginTime, | ||
int | endTime, | ||
int | timeInterval | ||
) |
Initialises parameters for performing model checkpointing.
fileNamePrefix | Path prefix for checkpoint files. Multiple checkpoint files may be generated for a single timestep snapshot. |
beginTime | Time to begin checkpointing. Time of first checkpoint. |
endTime | End time for checkpointing. Time of last checkpoint. |
timeInterval | Time interval between checkpoint file generation. |
void CLatticeMaster::performCheckPointsThroughMaster | ( | const std::string & | fileNamePrefix, |
int | beginTime, | ||
int | endTime, | ||
int | timeInterval | ||
) |
Initialises parameters for performing model checkpointing with writing done through master process.
fileNamePrefix | Path prefix for checkpoint files. Multiple checkpoint files may be generated for a single timestep snapshot. |
beginTime | Time to begin checkpointing. Time of first checkpoint. |
endTime | End time for checkpointing. Time of last checkpoint. |
timeInterval | Time interval between checkpoint file generation. |
|
protected |
read a 2D mesh from a file and distribute the data to the workers
meshfilename | the filename |
tag | the tag of the edges that are included into the mesh |
References esys::lsm::Mesh2DReader::getEdgeIterator(), esys::lsm::Mesh2DReader::getNodeIterator(), esys::lsm::IStreamIterator< TmplData >::hasNext(), esys::lsm::IStreamIterator< TmplData >::next(), CMPIBarrier::wait(), and BasicCon::XDebug().
void CLatticeMaster::readAndDistributeTriMesh | ( | const std::string & | meshName, |
const std::string & | meshFileName, | ||
int | tag | ||
) |
Read a triangle mesh from a file and distribute the data to the workers.
meshName | the name of the mesh |
meshFileName | the filename |
tag | the tag in the mesh data determining if a triangle belongs to this mesh or not |
void CLatticeMaster::readAndDistributeTriMesh | ( | const std::string & | meshName, |
const std::string & | meshFileName | ||
) |
Read a triangle mesh from a file and distribute the data to the workers. The tags on the mesh data are ignored, i.e. the whole file is read as a single mesh.
meshName | the name of the mesh |
meshFileName | the filename |
void CLatticeMaster::readGeometry | ( | const std::string & | fileName | ) |
Template method for reading geometry from a specified file. The template parameter is the type of particles created from the particle data contained in the geometry file.
fileName | the name of the file containing geometry info. |
References BasicCon::Debug(), esys::lsm::GeometryReader::getConnectionIterator(), esys::lsm::GeometryReader::getGeometryInfo(), esys::lsm::IStreamIterator< TmplData >::getNumRemaining(), esys::lsm::GeometryReader::getParticleIterator(), esys::lsm::GeometryReader::getParticleType(), esys::lsm::GeometryInfo::setBBox(), and BasicCon::XDebug().
void CLatticeMaster::readGeometryFile | ( | const std::string & | fileName | ) |
Reads an initial particle configuration from a geometry file.
fileName | Name of file containing geometry information. |
References BasicCon::Debug().
|
protected |
read a triangle mesh from a file and distribute the data to the workers
meshfilename | the filename |
tag | the tag in the mesh data determining if a triangle belongs to this mesh or not |
References esys::lsm::MeshReader::getNodeIterator(), esys::lsm::MeshReader::getTriIterator(), esys::lsm::IStreamIterator< TmplData >::hasNext(), esys::lsm::IStreamIterator< TmplData >::next(), and BasicCon::XDebug().
|
protected |
Read triangle mesh data from file and return data as <vector of nodes,vector of triangles> pair. Tags are ignored, i.e. the whole file is read as a single mesh.
meshfilename | the filename |
References esys::lsm::MeshReader::getNodeIterator(), esys::lsm::MeshReader::getTriIterator(), esys::lsm::IStreamIterator< TmplData >::hasNext(), esys::lsm::IStreamIterator< TmplData >::next(), and BasicCon::XDebug().
void CLatticeMaster::removeIG | ( | const std::string & | name | ) |
Remove interaction group. Send name of the interactiongroup to workers
name | the name of the interaction group which is to be removed |
References BroadcastCommand::append(), and BroadcastCommand::broadcast().
void CLatticeMaster::run | ( | ) |
run the simulation
void CLatticeMaster::runEnd | ( | ) |
Finalize after running the simulation
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
void CLatticeMaster::runInit | ( | ) |
Initialisation to run the simulation
References BasicCon::Debug().
void CLatticeMaster::runOneStep | ( | ) |
Perform a single time step of the simulation.
References CMPILCmdBuffer::broadcast(), BasicCon::Info(), BasicCon::Timing(), and CMPIBarrier::wait().
void CLatticeMaster::searchNeighbors | ( | bool | force | ) |
neighbor search. A check if the search is necessary is performed first
force | if true, force neighborsearch even if displacement is below threshold |
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and CMPIBarrier::wait().
Referenced by addConnections(), and addParticles().
void CLatticeMaster::setParticleAngVel | ( | int | id, |
const Vec3 & | A | ||
) |
Call the SubLattice function to set the angular velocity of a particle. If the SubLattice is not a RotSubLattice the called function is a NOP.
id | the id of the particle |
A | the angular velocity |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::setParticleDensity | ( | int | tag, |
int | mask, | ||
double | rho | ||
) |
set the density (i.e. adjust mass) of all particles with a given tag
tag | the tag |
mask | the tag mask |
rho | the density |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::setParticleNonDynamic | ( | int | tag | ) |
Set all particles with a given tag to be non-dynamic, i.e. to have infinite mass
tag | the tag |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::setParticleNonRot | ( | int | tag | ) |
Set all particles with a given tag to be non-rotational, i.e. to have infinite rotational inertia
tag | the tag |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::setParticleNonTrans | ( | int | tag | ) |
Set all particles with a given tag to be linear non-dynamic, i.e. switch off velocity updates
tag | the tag |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::setParticleVel | ( | int | id, |
const Vec3 & | V | ||
) |
set the velocity of a particle
id | the id of the particle to be moved |
V | the velocity |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::setProcessDims | ( | const esys::lsm::CLatticeParam::ProcessDims & | dims | ) |
Sets explicit process partitioning info for MPI_Dims_create.
dims | Dimension process partition vector. dims[0] x-partitioning, dims[1] y-partitioning and dims[2] z-partitioning. A zero value for a dimension is converted to a non-zero value using MPI_Dims_create |
Defines the bounding box in which particles may roam.
References CMPILCmdBuffer::broadcast(), and BasicCon::Debug().
void CLatticeMaster::setSpatialDomain | ( | const Vec3 & | minBBoxPt, |
const Vec3 & | maxBBoxPt, | ||
const esys::lsm::IntVector & | circDimVector | ||
) |
Defines the bounding box in which particles may roam.
References CMPILCmdBuffer::broadcast(), BasicCon::Debug(), and BasicCon::XDebug().
void CLatticeMaster::setTaggedParticleVel | ( | int | tag, |
const Vec3 & | V | ||
) |
set the velocity of all particles with a given tag
tag | the tag |
V | the velocity |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::setTimingFileName | ( | const std::string & | fileName | ) |
Specifies a file in which timing results are written.
fileName | Name of file, overwritten if it exists. |
void CLatticeMaster::setVelocityOfWall | ( | const std::string & | , |
const Vec3 & | |||
) |
set velocity of a wall. Only affects ViscWall, i.e. wall position doesn't get updatet !!
id | the nr of the wall |
v | the velocity |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::setVerbosity | ( | bool | verbose | ) |
Set local console verbosity and send command to workers to set console verbosity there
References BroadcastCommand::append(), BroadcastCommand::broadcast(), and BasicCon::SetVerbose().
void CLatticeMaster::setWallNormal | ( | const std::string & | , |
const Vec3 & | |||
) |
set a wall Normal by given vector
id | the nr of the wall normal to change |
d | the normal |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::spawnSlaves | ( | int | numWorkers | ) |
Set the command and command-line-arguments used to launch a slave process.
exe | Executable file name. |
argVector | vector of strings which are passed as command line arguments passed to exe. Return reference to SpawnCmd object which is used to spawn worker MPI processes. Spawns specified number of slave processes. |
void CLatticeMaster::tagParticleNearestTo | ( | int | tag, |
int | mask, | ||
const Vec3 & | pos | ||
) |
Add a given tag to the particle closest to a given position. Only the bits set in the mask will be influenced, i.e. new_tag=(old_tag & !mask) | (tag & mask).
tag | the tag |
mask | the mask |
pos | the position |
References CVarMPIBuffer::append(), CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), and CMPIBarrier::wait().
void CLatticeMaster::translateMeshBy | ( | const std::string & | , |
const Vec3 & | |||
) |
Move a whole mesh by a given amount.
meshName | the name of the mesh to be moved |
translation | the vector by which the mesh is translated |
References BroadcastCommand::append(), BroadcastCommand::broadcast(), and BasicCon::Debug().