12#include <unordered_map>
13#include <unordered_set>
425 void SetBondModel(
int mat_type_1,
int mat_type_2, std::string
const &label);
448 std::string
const &label);
457 void SetGravity(
double gx,
double gy,
double gz);
514 int shape_info_case = 0, std::string filecase =
"vtk");
606 std::unordered_map<int, Shape *>
const &
GetShapeMap();
684 static const int max_num_particles{2000000};
695 static const int max_num_shapes{2000000};
698 int max_id_particles{-1};
701 int max_id_walls{-1};
704 int max_id_shapes{-1};
A class representing a sphere bonded to other spheres through contact pairs.
Definition bonded_spheres.hpp:18
A class representing a set of bonded Voronoi cells generated from an STL file.
Definition bonded_voronois.hpp:19
A solver class for performing discrete element method (DEM) simulations.
Definition dem_solver.hpp:23
Class for managing the simulation domain and particles that belong to it.
Definition domain.hpp:24
Manages the data exchange in a DEM simulation.
Definition mpi_manager.hpp:39
Definition mini_map.hpp:17
Definition particle.hpp:26
A class for managing the elements in a DEM simulation. Scene behaves as a std container:
Definition scene.hpp:56
VecXT< VecXT< ContactModel * > > collision_model_table
Definition scene.hpp:87
VecXT< Wall * > wall_ghost_list
A list of pointers to all walls that do not physically exist, but are introduced to provide well-defi...
Definition scene.hpp:122
std::unordered_map< int, Particle * > particle_map
A map from integer IDs to pointers to particles, used for MPI particle reconstruction.
Definition scene.hpp:131
void SetGravity(double gx, double gy, double gz)
Set the gravity acceleration vector for all particles in this scene.
Definition scene.cpp:426
void ClearParticle()
Clear all particles from this scene.
Definition scene.cpp:1148
ContactModel * InsertContactModel(const ContactModel *const cm_ptr)
Insert a contact model into this scene.
Definition scene.cpp:290
Particle * FindParticleWithProxy(int id)
Find the particle with the given ID in this scene.
Definition scene.cpp:1216
Vec3d gravity_coef
The gravity acceleration vector applied to all particles in this scene.
Definition scene.hpp:65
VecXT< Particle * > GetParticlesWithProxy()
Get the particles, along with the particle proxyes, in the scene. (for debugging only)
Definition scene.cpp:1081
void ReadRestartContactsJSON(std::string const &file)
Read in the contact model information from a restart file.
Definition scene.cpp:961
VecXT< ContactPP * > GetContactPPs()
Get all particle-particle contacts in this scene.
Definition scene.cpp:1089
VecXT< Particle * > particle_ghost_list
A list of pointers to all particles that do not physically exist, but are introduced to provide well-...
Definition scene.hpp:104
std::unordered_map< int, Shape * > shape_map
A map from shape IDs to pointers to shapes defined in this scene.
Definition scene.hpp:139
VecXT< Wall * > const & GetWalls()
Get the walls in the scene.
Definition scene.cpp:1079
void ReadRestartParticlesJSON(std::string const &file)
Read in the particle information from a restart file.
Definition scene.cpp:883
void SetNumberOfMaterials(int num)
Set the number of materials in this scene and initialize the contact lookup table accordingly.
Definition scene.cpp:346
Shape * InsertShape(const Shape *const s_ptr)
Insert a single shape into this scene.
Definition scene.cpp:19
~Scene()
Destroy this scene and free all associated memory.
Definition scene.cpp:1236
Particle * InsertDerivedParticle(Particle const *p_ptr)
Insert a derived particle into this scene by copying the given particle.
Definition scene.cpp:162
VecXT< VecXT< ContactModel * > > bond_model_table
A lookup table for contact models based on the two materials in contact.
Definition scene.hpp:86
Domain * GetDomain() const
Get the domain.
Definition scene.cpp:432
void ReadRestartShapesJSON(std::string const &file)
Read in the particle shape information from a restart file.
Definition scene.cpp:855
void ReadRestartShapesVTK(std::string const &file)
Read in the particle shape information from a restart file.
Definition scene.cpp:534
void ClearContactModels()
Clear all contact models from this scene.
Definition scene.cpp:1185
VecXT< Particle * > particle_list
A list of pointers to all particles that belong to this sub-domain (scene).
Definition scene.hpp:93
Wall * FindWall(int id)
Find the wall with the given ID in this scene.
Definition scene.cpp:1225
void ClearShape()
Clear all shapes from this scene.
Definition scene.cpp:1139
void SetCollisionModel(int mat_type_1, int mat_type_2, ContactModel *const cnt_model)
Set the collision model between two materials.
Definition scene.cpp:397
ContactModel * GetBondModel(Particle *p1, Particle *p2)
Get the bond model between two particles.
Definition scene.cpp:436
void ClearContacts()
Clear all contacts from this scene.
Definition scene.cpp:1196
ContactModel * GetCollisionModel(Particle *p1, Particle *p2)
Get the collision model between two particles.
Definition scene.cpp:444
void ReadRestartWallsVTK(std::string const &file)
Read in the wall information from a restart file.
Definition scene.cpp:709
void RemoveWall(Wall *w_ptr)
Remove the given wall from this scene.
Definition scene.cpp:262
bool InScene(const Shape *const s_ptr)
Check if the given shape is in this scene.
Definition scene.cpp:324
VecXT< Shape * > local_shape_list
A list of pointers to all shapes that have been generated locally and not yet synced with other sub-d...
Definition scene.hpp:145
void Init(Simulation *const sim)
Initialize this scene with pointers to its owning simulation object.
Definition scene.cpp:17
Particle * InsertParticle(const Particle *const p_ptr)
Insert a single particle into this scene.
Definition scene.cpp:76
VecXT< Shape * > GetShapes()
Return a vector of pointers to all shapes in this scene.
Definition scene.cpp:316
void ReadRestartParticlesVTK(std::string const &file)
Read in the particle information from a restart file.
Definition scene.cpp:538
void AutoReadRestart(std::string const &path, int mech_cyc, int shape_info_case=0, std::string filecase="vtk")
Restart the simulation using output files.
Definition scene.cpp:452
void SetBondModel(int mat_type_1, int mat_type_2, ContactModel *const cnt_model)
Set the bond model between two materials.
Definition scene.cpp:368
void RemoveShape(Shape *s_ptr)
Remove the given shape from this scene.
Definition scene.cpp:228
Particle * FindParticle(int id)
Find the particle with the given ID in this scene.
Definition scene.cpp:1205
std::unordered_map< int, Shape * > const & GetShapeMap()
Get the shape map in the scene.
Definition scene.cpp:1075
Wall * InsertWall(const Wall *const w_ptr)
Insert a single wall into this scene.
Definition scene.cpp:194
Scene()
Default constructor for the scene class.
Definition scene.cpp:15
VecXT< Particle * > particle_proxy_list
A list of pointers to all proxy particles that belong to other domains, but may come into contact wit...
Definition scene.hpp:113
void RemoveParticle(Particle *p_ptr)
Remove the given particle from this scene.
Definition scene.cpp:238
VecXT< Particle * > const & GetParticles()
Get the particles in the scene.
Definition scene.cpp:1077
VecXT< ContactPW * > GetContactPWs()
Get all particle-wall contacts in this scene.
Definition scene.cpp:1108
void ReadRestartWallsJSON(std::string const &file)
Read in the wall information from a restart file.
Definition scene.cpp:930
void ReadRestartContactsVTK(std::string const &file)
Read in the contact model information from a restart file.
Definition scene.cpp:851
void ClearWall()
Clear all walls from this scene.
Definition scene.cpp:1170
VecXT< Wall * > wall_list
A list of pointers to all walls assumed to exist in this scene. No MPI transfer is performed on wall ...
Definition scene.hpp:71
MiniMap< int, ContactModel * > contact_model_map
A map from integer IDs to pointers to contact models defined in this scene.
Definition scene.hpp:77
Particle * InsertParticleLocal(const Particle *const p_ptr)
Insert a single particle into this scene. The particle will be forced inserted no mather which sub-do...
Definition scene.cpp:48
This class represents different types of shapes and performs various calculations on them.
Definition shape.hpp:15
Class for managing a DEM simulation.
Definition simulation.hpp:21
A class representing a wall object in a physics simulation.
Definition wall.hpp:32
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18