NetDEM v1.0
Loading...
Searching...
No Matches
bonded_spheres.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "bond_solver_pp.hpp"
4#include "contact_model.hpp"
5#include "contact_pp.hpp"
6#include "particle.hpp"
7#include "shape_sphere.hpp"
8#include <string>
9
10namespace netdem {
11
12class Scene;
13
19public:
24
29
34
39
44
49 double bond_margin{1.0e-6};
50
55
62
68 BondedSpheres(BondedSpheres const &&bp);
69
77
85
92 void SetBondModel(ContactModel *cnt_model);
93
99 void SetBondMargin(double margin);
100
108 void Translate(double pos_x, double pos_y, double pos_z);
109
119 void RotateByRodrigues(double rot_angle, double rot_axis_x, double rot_axis_y,
120 double rot_axis_z);
121
128
135 void InitFromSTL(std::string const &filename, double sphere_size);
136
144 void InitFromSTL(STLModel const &stl_model, double sphere_size);
145
158 void InitFromGrid(double corner_x, double corner_y, double corner_z,
159 double len_x, double len_y, double len_z,
160 double sphere_size);
161
167 void InitFromSpheres(std::string const &filename);
168
177 void AddSphere(double x, double y, double z, double sphere_size);
178
184 void MakePorosity(double porosity);
185
189 void InitBonds();
190
196 void ImportToScene(Scene *const scene) const;
197
198private:
203 void RefreshPointers();
204};
205
206} // namespace netdem
A class representing a sphere bonded to other spheres through contact pairs.
Definition bonded_spheres.hpp:18
double bond_margin
Two spheres are bonded if their surface distance is within the bond_margin.
Definition bonded_spheres.hpp:49
ContactModel * bond_model
The contact model used to calculate the forces between particles.
Definition bonded_spheres.hpp:43
BondedSpheres & operator=(BondedSpheres const &bp)
Copy assignment operator for the BondedSpheres class.
Definition bonded_spheres.cpp:33
void Translate(double pos_x, double pos_y, double pos_z)
Translate the sphere by a given amount.
Definition bonded_spheres.cpp:72
void SetBondMargin(double margin)
Set the bond margin used to determine if two spheres are bonded.
Definition bonded_spheres.cpp:67
void AddSphere(double x, double y, double z, double sphere_size)
Add a sphere to the list.
Definition bonded_spheres.cpp:237
void InitFromSpheres(std::string const &filename)
Initialize the spheres from a file providing the x, y, z, and size.
Definition bonded_spheres.cpp:224
VecXT< Vec2i > bond_pair_list
The list of bonded pairs between particles.
Definition bonded_spheres.hpp:38
BondedSpheres()
Default constructor for the BondedSpheres class.
Definition bonded_spheres.cpp:11
void InitFromSTL(std::string const &filename, double sphere_size)
Initialize the sphere from an STL file with the given sphere size.
Definition bonded_spheres.cpp:142
void MakePorosity(double porosity)
Make the particle porous by removing some spheres.
Definition bonded_spheres.cpp:261
void RotateByRodrigues(double rot_angle, double rot_axis_x, double rot_axis_y, double rot_axis_z)
Rotate the sphere by a given angle around a given axis using the Rodrigues formula.
Definition bonded_spheres.cpp:92
Vec3d GetCentroid()
Calculate the centroid of the sphere.
Definition bonded_spheres.cpp:126
void ImportToScene(Scene *const scene) const
Import the BondedSpheres object to a Scene object.
Definition bonded_spheres.cpp:314
void InitBonds()
Initialize the bonded pairs between particles.
Definition bonded_spheres.cpp:275
void InitFromGrid(double corner_x, double corner_y, double corner_z, double len_x, double len_y, double len_z, double sphere_size)
Initialize a cubic grid of spheres with the given corner position, dimensions, and sphere size.
Definition bonded_spheres.cpp:191
VecXT< Particle > particle_list
The list of sphere particles.
Definition bonded_spheres.hpp:28
VecXT< Sphere > sphere_list
The list of base spheres.
Definition bonded_spheres.hpp:23
void SetBondModel(ContactModel *cnt_model)
Set the contact model used to calculate the forces between particles.
Definition bonded_spheres.cpp:57
VecXT< ContactPP > contact_list
The list of contact pairs between particles.
Definition bonded_spheres.hpp:33
An abstract base class for contact models.
Definition contact_model.hpp:25
Class for working with STL models.
Definition stl_model.hpp:17
A class for managing the elements in a DEM simulation. Scene behaves as a std container:
Definition scene.hpp:56
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18