NetDEM v1.0
Loading...
Searching...
No Matches
netdem::BondedSpheres Class Reference

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.
 
BondedSpheresoperator= (BondedSpheres const &bp)
 Copy assignment operator for the BondedSpheres class.
 
BondedSpheresoperator= (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< Spheresphere_list
 The list of base spheres.
 
VecXT< Particleparticle_list
 The list of sphere particles.
 
VecXT< ContactPPcontact_list
 The list of contact pairs between particles.
 
VecXT< Vec2ibond_pair_list
 The list of bonded pairs between particles.
 
ContactModelbond_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.
 

Detailed Description

A class representing a sphere bonded to other spheres through contact pairs.

Constructor & Destructor Documentation

◆ BondedSpheres() [1/3]

BondedSpheres::BondedSpheres ( )

Default constructor for the BondedSpheres class.

◆ BondedSpheres() [2/3]

BondedSpheres::BondedSpheres ( BondedSpheres const & bp)

Copy constructor for the BondedSpheres class.

Parameters
bpThe BondedSpheres object to copy.

◆ BondedSpheres() [3/3]

BondedSpheres::BondedSpheres ( BondedSpheres const && bp)

Move constructor for the BondedSpheres class.

Parameters
bpThe BondedSpheres object to move.

Member Function Documentation

◆ AddSphere()

void BondedSpheres::AddSphere ( double x,
double y,
double z,
double sphere_size )

Add a sphere to the list.

Parameters
xcoordinate x.
ycoordinate y.
zcoordinate z.
sphere_sizesize of the sphere.

◆ GetCentroid()

Vec3d BondedSpheres::GetCentroid ( )

Calculate the centroid of the sphere.

Returns
The centroid of the sphere as a Vec3d object.

◆ ImportToScene()

void BondedSpheres::ImportToScene ( Scene *const scene) const

Import the BondedSpheres object to a Scene object.

Parameters
sceneThe Scene object to import to.

◆ InitBonds()

void BondedSpheres::InitBonds ( )

Initialize the bonded pairs between particles.

◆ InitFromGrid()

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.

Parameters
corner_xThe x coordinate of the corner of the grid.
corner_yThe y coordinate of the corner of the grid.
corner_zThe z coordinate of the corner of the grid.
len_xThe length of the grid in the x direction.
len_yThe length of the grid in the y direction.
len_zThe length of the grid in the z direction.
sphere_sizeThe size of the spheres in the grid.

◆ InitFromSpheres()

void BondedSpheres::InitFromSpheres ( std::string const & filename)

Initialize the spheres from a file providing the x, y, z, and size.

Parameters
filenameThe a file providing the x, y, z, and size.

◆ InitFromSTL() [1/2]

void BondedSpheres::InitFromSTL ( std::string const & filename,
double sphere_size )

Initialize the sphere from an STL file with the given sphere size.

Parameters
filenameThe path to the STL file to read.
sphere_sizeThe size of the spheres in the mesh.

◆ InitFromSTL() [2/2]

void BondedSpheres::InitFromSTL ( STLModel const & stl_model,
double sphere_size )

Initialize the sphere from an STLModel object with the given sphere size.

Parameters
stl_modelThe STLModel object to read from.
sphere_sizeThe size of the spheres in the mesh.

◆ MakePorosity()

void BondedSpheres::MakePorosity ( double porosity)

Make the particle porous by removing some spheres.

Parameters
porosityThe desired porosity of the particle as a fraction.

◆ operator=() [1/2]

BondedSpheres & BondedSpheres::operator= ( BondedSpheres const && bp)

Move assignment operator for the BondedSpheres class.

Parameters
bpThe BondedSpheres object to move.
Returns
A reference to the moved BondedSpheres object.

◆ operator=() [2/2]

BondedSpheres & BondedSpheres::operator= ( BondedSpheres const & bp)

Copy assignment operator for the BondedSpheres class.

Parameters
bpThe BondedSpheres object to copy.
Returns
A reference to the copied BondedSpheres object.

◆ RotateByRodrigues()

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.

Parameters
rot_angleThe angle to rotate by.
rot_axis_xThe x component of the rotation axis.
rot_axis_yThe y component of the rotation axis.
rot_axis_zThe z component of the rotation axis.

◆ SetBondMargin()

void BondedSpheres::SetBondMargin ( double margin)

Set the bond margin used to determine if two spheres are bonded.

Parameters
marginThe bond margin to use.

◆ SetBondModel()

void BondedSpheres::SetBondModel ( ContactModel * cnt_model)

Set the contact model used to calculate the forces between particles.

Parameters
cnt_modelThe contact model to use.

◆ Translate()

void BondedSpheres::Translate ( double pos_x,
double pos_y,
double pos_z )

Translate the sphere by a given amount.

Parameters
pos_xThe amount to translate in the x direction.
pos_yThe amount to translate in the y direction.
pos_zThe amount to translate in the z direction.

Member Data Documentation

◆ bond_margin

double netdem::BondedSpheres::bond_margin {1.0e-6}

Two spheres are bonded if their surface distance is within the bond_margin.

◆ bond_model

ContactModel* netdem::BondedSpheres::bond_model {nullptr}

The contact model used to calculate the forces between particles.

◆ bond_pair_list

VecXT<Vec2i> netdem::BondedSpheres::bond_pair_list

The list of bonded pairs between particles.

◆ contact_list

VecXT<ContactPP> netdem::BondedSpheres::contact_list

The list of contact pairs between particles.

◆ particle_list

VecXT<Particle> netdem::BondedSpheres::particle_list

The list of sphere particles.

◆ sphere_list

VecXT<Sphere> netdem::BondedSpheres::sphere_list

The list of base spheres.


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