NuTo
Numerics Tool
Public Member Functions | List of all members
NuTo::ParticleHandler Class Reference

handles the particle list More...

#include <ParticleHandler.h>

Public Member Functions

 ParticleHandler (int rNumParticles, Eigen::MatrixXd rParticleBoundingBox, double rVelocityRange, double rGrowthRate, int rSeed=0)
 constructor, builds rNumParticles equal particles More...
 
 ParticleHandler (Eigen::MatrixXd rSpheres, double rVelocityRange, double rRelativeGrowthRate, double rAbsoluteGrowthRate, int rSeed=0)
 constructor, uses rSpheres More...
 
 ParticleHandler (const std::string &rFileName, double rVelocityRange, double rRelativeGrowthRate, double rAbsoluteGrowthRate, int rSeed=0)
 constructor, builds particles from external file More...
 
 ~ParticleHandler ()
 destructor, deletes all particles More...
 
void Sync (const double rTime)
 updates all particles to the same time global time rTime More...
 
double GetKineticEnergy () const
 getter for the kinetic energy of all particles More...
 
double GetVolume () const
 getter for the volume of all particles More...
 
void ExportParticlesToVTU3D (std::string rOutputDirectory, int rTimeStep, double rGlobalTime, bool rFinal) const
 writes a sphere visualization file More...
 
void ExportParticlesToVTU2D (std::string rOutputFile, double rZCoord) const
 writes a sphere visualization file More...
 
void ExportParticlesToGmsh3D (std::string rOutputFile, Specimen &rSpecimen, double rMeshSize) const
 writes a gmsh .geo file 3D More...
 
void ExportParticlesToGmsh2D (std::string rOutputFile, Specimen &rSpecimen, double rMeshSize, double rZCoord, double rMinRadius) const
 writes a gmsh .geo file 3D More...
 
void ResetVelocities ()
 resets all velocities More...
 
Eigen::MatrixXd GetParticles (bool rInitialRadius=false) const
 converts the particle list to a Nx4-matrix More...
 
Eigen::MatrixXd GetParticles2D (double rZCoord, double rMinRadius) const
 cut spheres at a given z-coordinate to create circles (in 2D) More...
 
void ExportParticlesToFile (const std::string &rExportFileName, bool rInitialRadius) const
 exports the particle list to a file More...
 
CollidableParticleSphereGetParticle (const int rIndex) const
 get a single particle from the particle list More...
 
int GetNumParticles () const
 getter for the particle list size More...
 
double GetAbsoluteMininimalDistance (Specimen &rSpecimen)
 calculates the minimal distance between all particles using sub boxes More...
 
void SetVisualizationFileName (const std::string &rVisualizationFileName)
 optional: change the file name, default: "spheres_" More...
 
Eigen::VectorXi GetSubBoxDivisions (Specimen &rSpecimen, const int rParticlesPerBox)
 calculates approximate sub box length, based on box size and the number of particles per sub box More...
 

Detailed Description

handles the particle list

Constructor & Destructor Documentation

NuTo::ParticleHandler::ParticleHandler ( int  rNumParticles,
Eigen::MatrixXd  rParticleBoundingBox,
double  rVelocityRange,
double  rGrowthRate,
int  rSeed = 0 
)

constructor, builds rNumParticles equal particles

NuTo::ParticleHandler::ParticleHandler ( Eigen::MatrixXd  rSpheres,
double  rVelocityRange,
double  rRelativeGrowthRate,
double  rAbsoluteGrowthRate,
int  rSeed = 0 
)

constructor, uses rSpheres

NuTo::ParticleHandler::ParticleHandler ( const std::string &  rFileName,
double  rVelocityRange,
double  rRelativeGrowthRate,
double  rAbsoluteGrowthRate,
int  rSeed = 0 
)

constructor, builds particles from external file

NuTo::ParticleHandler::~ParticleHandler ( )

destructor, deletes all particles

Member Function Documentation

void NuTo::ParticleHandler::ExportParticlesToFile ( const std::string &  rExportFileName,
bool  rInitialRadius 
) const

exports the particle list to a file

void NuTo::ParticleHandler::ExportParticlesToGmsh2D ( std::string  rOutputFile,
Specimen rSpecimen,
double  rMeshSize,
double  rZCoord,
double  rMinRadius 
) const

writes a gmsh .geo file 3D

Parameters
rOutputFile.geo-file name
rSpecimenspecimen
rMeshSizemesh size
rZCoordz coordinate (where to cut)
rMinRadiusminimal radius of the circle
void NuTo::ParticleHandler::ExportParticlesToGmsh3D ( std::string  rOutputFile,
Specimen rSpecimen,
double  rMeshSize 
) const

writes a gmsh .geo file 3D

Parameters
rOutputFile.geo-file name
rSpecimenspecimen
rMeshSizemesh size
void NuTo::ParticleHandler::ExportParticlesToVTU2D ( std::string  rOutputFile,
double  rZCoord 
) const

writes a sphere visualization file

Parameters
rOutputFileoutput file name
void NuTo::ParticleHandler::ExportParticlesToVTU3D ( std::string  rOutputDirectory,
int  rTimeStep,
double  rGlobalTime,
bool  rFinal 
) const

writes a sphere visualization file

Parameters
rOutputDirectoryworkdir
rTimeStepcurrent timestep of the simulation
rGlobalTimecurrent global time != wall time
rFinalfalse: use current radius, true: use initial radius
double NuTo::ParticleHandler::GetAbsoluteMininimalDistance ( Specimen rSpecimen)

calculates the minimal distance between all particles using sub boxes

double NuTo::ParticleHandler::GetKineticEnergy ( ) const

getter for the kinetic energy of all particles

int NuTo::ParticleHandler::GetNumParticles ( ) const

getter for the particle list size

NuTo::CollidableParticleSphere * NuTo::ParticleHandler::GetParticle ( const int  rIndex) const

get a single particle from the particle list

Eigen::MatrixXd NuTo::ParticleHandler::GetParticles ( bool  rInitialRadius = false) const

converts the particle list to a Nx4-matrix

Eigen::MatrixXd NuTo::ParticleHandler::GetParticles2D ( double  rZCoord,
double  rMinRadius 
) const

cut spheres at a given z-coordinate to create circles (in 2D)

Parameters
rZCoordz coordinate (where to cut)
rMinRadiusminimal radius of the circle
Returns
matrix with the circles (x,y,r)
Eigen::VectorXi NuTo::ParticleHandler::GetSubBoxDivisions ( Specimen rSpecimen,
const int  rParticlesPerBox 
)

calculates approximate sub box length, based on box size and the number of particles per sub box

double NuTo::ParticleHandler::GetVolume ( ) const

getter for the volume of all particles

void NuTo::ParticleHandler::ResetVelocities ( )

resets all velocities

void NuTo::ParticleHandler::SetVisualizationFileName ( const std::string &  rVisualizationFileName)

optional: change the file name, default: "spheres_"

void NuTo::ParticleHandler::Sync ( const double  rTime)

updates all particles to the same time global time rTime


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