![]() |
MechSys
1.0
Computing library for simulations in continuum and discrete mechanics
|
#include <domain.h>
Public Types | |
typedef void(* | ptFun_t )(Domain &Dom, void *UserData) |
Public Member Functions | |
Domain (void *UserData=NULL) | |
~Domain () | |
void | GenSpheres (int Tag, double L, size_t N, double rho, char const *Type, size_t Randomseed, double fraction, double RminFraction=1.0) |
General spheres. | |
void | GenRice (int Tag, double L, size_t N, double R, double rho, size_t Randomseed, double fraction) |
General rices. | |
void | GenBox (int InitialTag, double Lx, double Ly, double Lz, double R, double Cf, bool Cohesion=false) |
Generate six walls with successive tags. Cf is a coefficient to make walls bigger than specified in order to avoid gaps. | |
void | GenOpenBox (int InitialTag, double Lx, double Ly, double Lz, double R, double Cf) |
Generate five walls with successive tags. Cf is a coefficient to make walls bigger than specified in order to avoid gaps. | |
void | GenBoundingBox (int InitialTag, double R, double Cf, bool Cohesion=false) |
Generate o bounding box enclosing the previous included particles. | |
void | GenBoundingPlane (int InitialTag, double R, double Cf, bool Cohesion=false) |
Same as GenBounding but only generates one pair of planes. | |
void | GenFromMesh (Mesh::Generic &M, double R, double rho, bool cohesion=false, bool MC=true, double thickness=0.0) |
Generate particles from a FEM mesh generator. | |
void | AddVoroPack (int Tag, double R, double Lx, double Ly, double Lz, size_t nx, size_t ny, size_t nz, double rho, bool Cohesion, bool Periodic, size_t Randomseed, double fraction, Vec3_t q=OrthoSys::O) |
Generate a Voronoi Packing with dimensions Li and polihedra per side ni. | |
void | AddSphere (int Tag, Vec3_t const &X, double R, double rho) |
Add sphere. | |
void | AddCube (int Tag, Vec3_t const &X, double R, double L, double rho, double Angle=0, Vec3_t *Axis=NULL) |
Add a cube at position X with spheroradius R, side of length L and density rho. | |
void | AddTetra (int Tag, Vec3_t const &X, double R, double L, double rho, double Angle=0, Vec3_t *Axis=NULL) |
Add a tetrahedron at position X with spheroradius R, side of length L and density rho. | |
void | AddDrill (int Tag, Vec3_t const &X, double R, double Lt, double Ll, double rho) |
A drill made as a combination of a cube and a pyramid. | |
void | AddRice (int Tag, Vec3_t const &X, double R, double L, double rho, double Angle=0, Vec3_t *Axis=NULL) |
Add a rice at position X with spheroradius R, side of length L and density rho. | |
void | AddPlane (int Tag, Vec3_t const &X, double R, double Lx, double Ly, double rho, double Angle=0, Vec3_t *Axis=NULL) |
Add a cube at position X with spheroradius R, side of length L and density rho. | |
void | AddVoroCell (int Tag, voronoicell_neighbor &VC, double R, double rho, bool Erode, iVec3_t nv=iVec3_t(1, 1, 1)) |
Add a single voronoi cell, it should be built before tough. | |
void | AddTorus (int Tag, Vec3_t const &X, Vec3_t const &N, double Rmax, double R, double rho) |
Add a single torus at position X with a normal N, circunference Rmax and spheroradius R. | |
void | AddCylinder (int Tag, Vec3_t const &X0, double R0, Vec3_t const &X1, double R1, double R, double rho) |
Add a cylinder formed by the connection of two circles at positions X0 and X1 and radii R0 and R1. | |
void | SetProps (Dict &D) |
Set the properties of individual grains by dictionaries. | |
void | Initialize (double dt=0.0) |
Set the particles to a initial state and asign the possible insteractions. | |
void | Solve (double tf, double dt, double dtOut, ptFun_t ptSetup=NULL, ptFun_t ptReport=NULL, char const *FileKey=NULL, bool RenderVideo=true, size_t Nproc=1) |
Run simulation. | |
void | WritePOV (char const *FileKey) |
Write POV file. | |
void | WriteBPY (char const *FileKey) |
Write BPY (Blender) file. | |
void | BoundingBox (Vec3_t &minX, Vec3_t &maxX) |
Defines the rectangular box that encloses the particles. | |
void | Center (Vec3_t C=Vec3_t(0.0, 0.0, 0.0)) |
Centers the domain around C. | |
void | ResetInteractons () |
Reset the interactons. | |
void | ResetDisplacements () |
Reset the displacements. | |
double | MaxDisplacement () |
Calculate maximun displacement. | |
void | ResetContacts () |
Reset the displacements. | |
void | EnergyOutput (size_t IdxOut, std::ostream &OutFile) |
Output of the energy variables. | |
void | GetGSD (Array< double > &X, Array< double > &Y, Array< double > &D, size_t NDiv=10) const |
Get the Grain Size Distribution. | |
void | Clusters () |
Check the bounded particles in the domain and how many connected clusters are still present. | |
void | DelParticles (Array< int > const &Tags) |
Delete particle. | |
Particle * | GetParticle (int Tag, bool Check=true) |
Find first particle with Tag. Check => check if there are more than one particle with tag=Tag. | |
Particle const & | GetParticle (int Tag, bool Check=true) const |
Find first particle with Tag. Check => check if there are more than one particle with tag=Tag. | |
void | GetParticles (int Tag, Array< Particle * > &P) |
Find all particles with Tag. | |
void | LinearMomentum (Vec3_t &L) |
Return total momentum of the system. | |
void | AngularMomentum (Vec3_t &L) |
Return total angular momentum of the system. | |
double | CalcEnergy (double &Ekin, double &Epot) |
Return total energy of the system. | |
Public Attributes | |
bool | Initialized |
System (particles and interactons) initialized ? | |
bool | Finished |
Has the simulation finished. | |
Array< Particle * > | Particles |
All particles in domain. | |
Array< Interacton * > | Interactons |
All interactons. | |
Array< CInteracton * > | CInteractons |
Contact interactons. | |
Array< BInteracton * > | BInteractons |
Cohesion interactons. | |
Vec3_t | CamPos |
Camera position for POV. | |
double | Time |
Current time. | |
double | Evis |
Energy dissipated by the viscosity of the grains. | |
double | Efric |
Energy dissipated by friction. | |
double | Wext |
Work done by external forces. | |
double | Vs |
Volume occupied by the grains. | |
double | Ms |
Total mass of the particles. | |
double | Alpha |
Verlet distance. | |
void * | UserData |
Some user data. | |
String | FileKey |
File Key for output files. | |
size_t | idx_out |
Index of output. | |
set< pair< Particle *, Particle * > > | Listofpairs |
List of pair of particles associated per interacton for memory optimization. | |
Array< Array< int > > | Listofclusters |
List of particles belonging to bounded clusters (applies only for cohesion simulations) |
typedef void(* DEM::Domain::ptFun_t)(Domain &Dom, void *UserData) |
DEM::Domain::Domain | ( | void * | UserData = NULL | ) | [inline] |
DEM::Domain::~Domain | ( | ) | [inline] |
void DEM::Domain::AddCube | ( | int | Tag, |
Vec3_t const & | X, | ||
double | R, | ||
double | L, | ||
double | rho, | ||
double | Angle = 0 , |
||
Vec3_t * | Axis = NULL |
||
) | [inline] |
Add a cube at position X with spheroradius R, side of length L and density rho.
void DEM::Domain::AddCylinder | ( | int | Tag, |
Vec3_t const & | X0, | ||
double | R0, | ||
Vec3_t const & | X1, | ||
double | R1, | ||
double | R, | ||
double | rho | ||
) | [inline] |
Add a cylinder formed by the connection of two circles at positions X0 and X1 and radii R0 and R1.
void DEM::Domain::AddDrill | ( | int | Tag, |
Vec3_t const & | X, | ||
double | R, | ||
double | Lt, | ||
double | Ll, | ||
double | rho | ||
) | [inline] |
A drill made as a combination of a cube and a pyramid.
void DEM::Domain::AddPlane | ( | int | Tag, |
Vec3_t const & | X, | ||
double | R, | ||
double | Lx, | ||
double | Ly, | ||
double | rho, | ||
double | Angle = 0 , |
||
Vec3_t * | Axis = NULL |
||
) | [inline] |
Add a cube at position X with spheroradius R, side of length L and density rho.
void DEM::Domain::AddRice | ( | int | Tag, |
Vec3_t const & | X, | ||
double | R, | ||
double | L, | ||
double | rho, | ||
double | Angle = 0 , |
||
Vec3_t * | Axis = NULL |
||
) | [inline] |
Add a rice at position X with spheroradius R, side of length L and density rho.
void DEM::Domain::AddSphere | ( | int | Tag, |
Vec3_t const & | X, | ||
double | R, | ||
double | rho | ||
) | [inline] |
Add sphere.
void DEM::Domain::AddTetra | ( | int | Tag, |
Vec3_t const & | X, | ||
double | R, | ||
double | L, | ||
double | rho, | ||
double | Angle = 0 , |
||
Vec3_t * | Axis = NULL |
||
) | [inline] |
Add a tetrahedron at position X with spheroradius R, side of length L and density rho.
void DEM::Domain::AddTorus | ( | int | Tag, |
Vec3_t const & | X, | ||
Vec3_t const & | N, | ||
double | Rmax, | ||
double | R, | ||
double | rho | ||
) | [inline] |
Add a single torus at position X with a normal N, circunference Rmax and spheroradius R.
void DEM::Domain::AddVoroCell | ( | int | Tag, |
voronoicell_neighbor & | VC, | ||
double | R, | ||
double | rho, | ||
bool | Erode, | ||
iVec3_t | nv = iVec3_t(1,1,1) |
||
) | [inline] |
Add a single voronoi cell, it should be built before tough.
void DEM::Domain::AddVoroPack | ( | int | Tag, |
double | R, | ||
double | Lx, | ||
double | Ly, | ||
double | Lz, | ||
size_t | nx, | ||
size_t | ny, | ||
size_t | nz, | ||
double | rho, | ||
bool | Cohesion, | ||
bool | Periodic, | ||
size_t | Randomseed, | ||
double | fraction, | ||
Vec3_t | q = OrthoSys::O |
||
) | [inline] |
Generate a Voronoi Packing with dimensions Li and polihedra per side ni.
void DEM::Domain::AngularMomentum | ( | Vec3_t & | L | ) | [inline] |
Return total angular momentum of the system.
void DEM::Domain::BoundingBox | ( | Vec3_t & | minX, |
Vec3_t & | maxX | ||
) | [inline] |
Defines the rectangular box that encloses the particles.
double DEM::Domain::CalcEnergy | ( | double & | Ekin, |
double & | Epot | ||
) | [inline] |
Return total energy of the system.
void DEM::Domain::Center | ( | Vec3_t | C = Vec3_t(0.0,0.0,0.0) | ) | [inline] |
Centers the domain around C.
void DEM::Domain::Clusters | ( | ) | [inline] |
Check the bounded particles in the domain and how many connected clusters are still present.
void DEM::Domain::DelParticles | ( | Array< int > const & | Tags | ) | [inline] |
Delete particle.
void DEM::Domain::EnergyOutput | ( | size_t | IdxOut, |
std::ostream & | OutFile | ||
) | [inline] |
Output of the energy variables.
void DEM::Domain::GenBoundingBox | ( | int | InitialTag, |
double | R, | ||
double | Cf, | ||
bool | Cohesion = false |
||
) | [inline] |
Generate o bounding box enclosing the previous included particles.
void DEM::Domain::GenBoundingPlane | ( | int | InitialTag, |
double | R, | ||
double | Cf, | ||
bool | Cohesion = false |
||
) | [inline] |
Same as GenBounding but only generates one pair of planes.
void DEM::Domain::GenBox | ( | int | InitialTag, |
double | Lx, | ||
double | Ly, | ||
double | Lz, | ||
double | R, | ||
double | Cf, | ||
bool | Cohesion = false |
||
) | [inline] |
Generate six walls with successive tags. Cf is a coefficient to make walls bigger than specified in order to avoid gaps.
void DEM::Domain::GenFromMesh | ( | Mesh::Generic & | M, |
double | R, | ||
double | rho, | ||
bool | cohesion = false , |
||
bool | MC = true , |
||
double | thickness = 0.0 |
||
) | [inline] |
Generate particles from a FEM mesh generator.
void DEM::Domain::GenOpenBox | ( | int | InitialTag, |
double | Lx, | ||
double | Ly, | ||
double | Lz, | ||
double | R, | ||
double | Cf | ||
) | [inline] |
Generate five walls with successive tags. Cf is a coefficient to make walls bigger than specified in order to avoid gaps.
void DEM::Domain::GenRice | ( | int | Tag, |
double | L, | ||
size_t | N, | ||
double | R, | ||
double | rho, | ||
size_t | Randomseed, | ||
double | fraction | ||
) | [inline] |
General rices.
void DEM::Domain::GenSpheres | ( | int | Tag, |
double | L, | ||
size_t | N, | ||
double | rho, | ||
char const * | Type, | ||
size_t | Randomseed, | ||
double | fraction, | ||
double | RminFraction = 1.0 |
||
) | [inline] |
General spheres.
void DEM::Domain::GetGSD | ( | Array< double > & | X, |
Array< double > & | Y, | ||
Array< double > & | D, | ||
size_t | NDiv = 10 |
||
) | const [inline] |
Get the Grain Size Distribution.
Particle * DEM::Domain::GetParticle | ( | int | Tag, |
bool | Check = true |
||
) | [inline] |
Find first particle with Tag. Check => check if there are more than one particle with tag=Tag.
Particle const & DEM::Domain::GetParticle | ( | int | Tag, |
bool | Check = true |
||
) | const [inline] |
Find first particle with Tag. Check => check if there are more than one particle with tag=Tag.
void DEM::Domain::GetParticles | ( | int | Tag, |
Array< Particle * > & | P | ||
) | [inline] |
Find all particles with Tag.
void DEM::Domain::Initialize | ( | double | dt = 0.0 | ) | [inline] |
Set the particles to a initial state and asign the possible insteractions.
void DEM::Domain::LinearMomentum | ( | Vec3_t & | L | ) | [inline] |
Return total momentum of the system.
double DEM::Domain::MaxDisplacement | ( | ) | [inline] |
Calculate maximun displacement.
void DEM::Domain::ResetContacts | ( | ) | [inline] |
Reset the displacements.
void DEM::Domain::ResetDisplacements | ( | ) | [inline] |
Reset the displacements.
void DEM::Domain::ResetInteractons | ( | ) | [inline] |
Reset the interactons.
void DEM::Domain::SetProps | ( | Dict & | D | ) | [inline] |
Set the properties of individual grains by dictionaries.
void DEM::Domain::Solve | ( | double | tf, |
double | dt, | ||
double | dtOut, | ||
ptFun_t | ptSetup = NULL , |
||
ptFun_t | ptReport = NULL , |
||
char const * | FileKey = NULL , |
||
bool | RenderVideo = true , |
||
size_t | Nproc = 1 |
||
) | [inline] |
Run simulation.
void DEM::Domain::WriteBPY | ( | char const * | FileKey | ) | [inline] |
Write BPY (Blender) file.
void DEM::Domain::WritePOV | ( | char const * | FileKey | ) | [inline] |
Write POV file.
double DEM::Domain::Alpha |
Verlet distance.
Cohesion interactons.
Camera position for POV.
Contact interactons.
double DEM::Domain::Efric |
Energy dissipated by friction.
double DEM::Domain::Evis |
Energy dissipated by the viscosity of the grains.
File Key for output files.
Has the simulation finished.
size_t DEM::Domain::idx_out |
Index of output.
System (particles and interactons) initialized ?
All interactons.
Array<Array <int> > DEM::Domain::Listofclusters |
List of particles belonging to bounded clusters (applies only for cohesion simulations)
set<pair<Particle *, Particle *> > DEM::Domain::Listofpairs |
List of pair of particles associated per interacton for memory optimization.
double DEM::Domain::Ms |
Total mass of the particles.
All particles in domain.
double DEM::Domain::Time |
Current time.
void* DEM::Domain::UserData |
Some user data.
double DEM::Domain::Vs |
Volume occupied by the grains.
double DEM::Domain::Wext |
Work done by external forces.