NetDEM v1.0
|
A class representing a sphere bonded to other spheres through contact pairs. More...
#include <bonded_spheres.hpp>
Public Member Functions | |
BondedSpheres () | |
Default constructor for the BondedSpheres class. | |
BondedSpheres (BondedSpheres const &bp) | |
Copy constructor for the BondedSpheres class. | |
BondedSpheres (BondedSpheres const &&bp) | |
Move constructor for the BondedSpheres class. | |
BondedSpheres & | operator= (BondedSpheres const &bp) |
Copy assignment operator for the BondedSpheres class. | |
BondedSpheres & | operator= (BondedSpheres const &&bp) |
Move assignment operator for the BondedSpheres class. | |
void | SetBondModel (ContactModel *cnt_model) |
Set the contact model used to calculate the forces between particles. | |
void | SetBondMargin (double margin) |
Set the bond margin used to determine if two spheres are bonded. | |
void | Translate (double pos_x, double pos_y, double pos_z) |
Translate the sphere by a given amount. | |
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. | |
Vec3d | GetCentroid () |
Calculate the centroid of the sphere. | |
void | InitFromSTL (std::string const &filename, double sphere_size) |
Initialize the sphere from an STL file with the given sphere size. | |
void | InitFromSTL (STLModel const &stl_model, double sphere_size) |
Initialize the sphere from an STLModel object with the given sphere size. | |
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. | |
void | InitFromSpheres (std::string const &filename) |
Initialize the spheres from a file providing the x, y, z, and size. | |
void | AddSphere (double x, double y, double z, double sphere_size) |
Add a sphere to the list. | |
void | MakePorosity (double porosity) |
Make the particle porous by removing some spheres. | |
void | InitBonds () |
Initialize the bonded pairs between particles. | |
void | ImportToScene (Scene *const scene) const |
Import the BondedSpheres object to a Scene object. | |
Public Attributes | |
VecXT< Sphere > | sphere_list |
The list of base spheres. | |
VecXT< Particle > | particle_list |
The list of sphere particles. | |
VecXT< ContactPP > | contact_list |
The list of contact pairs between particles. | |
VecXT< Vec2i > | bond_pair_list |
The list of bonded pairs between particles. | |
ContactModel * | bond_model {nullptr} |
The contact model used to calculate the forces between particles. | |
double | bond_margin {1.0e-6} |
Two spheres are bonded if their surface distance is within the bond_margin. | |
A class representing a sphere bonded to other spheres through contact pairs.
BondedSpheres::BondedSpheres | ( | ) |
Default constructor for the BondedSpheres class.
BondedSpheres::BondedSpheres | ( | BondedSpheres const & | bp | ) |
Copy constructor for the BondedSpheres class.
bp | The BondedSpheres object to copy. |
BondedSpheres::BondedSpheres | ( | BondedSpheres const && | bp | ) |
Move constructor for the BondedSpheres class.
bp | The BondedSpheres object to move. |
void BondedSpheres::AddSphere | ( | double | x, |
double | y, | ||
double | z, | ||
double | sphere_size ) |
Add a sphere to the list.
x | coordinate x. |
y | coordinate y. |
z | coordinate z. |
sphere_size | size of the sphere. |
Vec3d BondedSpheres::GetCentroid | ( | ) |
Calculate the centroid of the sphere.
void BondedSpheres::ImportToScene | ( | Scene *const | scene | ) | const |
Import the BondedSpheres object to a Scene object.
scene | The Scene object to import to. |
void BondedSpheres::InitBonds | ( | ) |
Initialize the bonded pairs between particles.
void BondedSpheres::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.
corner_x | The x coordinate of the corner of the grid. |
corner_y | The y coordinate of the corner of the grid. |
corner_z | The z coordinate of the corner of the grid. |
len_x | The length of the grid in the x direction. |
len_y | The length of the grid in the y direction. |
len_z | The length of the grid in the z direction. |
sphere_size | The size of the spheres in the grid. |
void BondedSpheres::InitFromSpheres | ( | std::string const & | filename | ) |
Initialize the spheres from a file providing the x, y, z, and size.
filename | The a file providing the x, y, z, and size. |
void BondedSpheres::InitFromSTL | ( | std::string const & | filename, |
double | sphere_size ) |
Initialize the sphere from an STL file with the given sphere size.
filename | The path to the STL file to read. |
sphere_size | The size of the spheres in the mesh. |
void BondedSpheres::InitFromSTL | ( | STLModel const & | stl_model, |
double | sphere_size ) |
void BondedSpheres::MakePorosity | ( | double | porosity | ) |
Make the particle porous by removing some spheres.
porosity | The desired porosity of the particle as a fraction. |
BondedSpheres & BondedSpheres::operator= | ( | BondedSpheres const && | bp | ) |
Move assignment operator for the BondedSpheres class.
bp | The BondedSpheres object to move. |
BondedSpheres & BondedSpheres::operator= | ( | BondedSpheres const & | bp | ) |
Copy assignment operator for the BondedSpheres class.
bp | The BondedSpheres object to copy. |
void BondedSpheres::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.
rot_angle | The angle to rotate by. |
rot_axis_x | The x component of the rotation axis. |
rot_axis_y | The y component of the rotation axis. |
rot_axis_z | The z component of the rotation axis. |
void BondedSpheres::SetBondMargin | ( | double | margin | ) |
Set the bond margin used to determine if two spheres are bonded.
margin | The bond margin to use. |
void BondedSpheres::SetBondModel | ( | ContactModel * | cnt_model | ) |
Set the contact model used to calculate the forces between particles.
cnt_model | The contact model to use. |
void BondedSpheres::Translate | ( | double | pos_x, |
double | pos_y, | ||
double | pos_z ) |
Translate the sphere by a given amount.
pos_x | The amount to translate in the x direction. |
pos_y | The amount to translate in the y direction. |
pos_z | The amount to translate in the z direction. |
double netdem::BondedSpheres::bond_margin {1.0e-6} |
Two spheres are bonded if their surface distance is within the bond_margin.
ContactModel* netdem::BondedSpheres::bond_model {nullptr} |
The contact model used to calculate the forces between particles.