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

A class representing a set of bonded Voronoi cells generated from an STL file. More...

#include <bonded_voronois.hpp>

Public Member Functions

 BondedVoronois ()
 Default constructor for the BondedVoronois class.
 
 BondedVoronois (BondedVoronois const &bp)
 Copy constructor for the BondedVoronois class.
 
 BondedVoronois (BondedVoronois const &&bp)
 Move constructor for the BondedVoronois class.
 
BondedVoronoisoperator= (BondedVoronois const &bp)
 Copy assignment operator for the BondedVoronois class.
 
BondedVoronoisoperator= (BondedVoronois const &&bp)
 Move assignment operator for the BondedVoronois class.
 
void SetBondModel (ContactModel *cnt_model)
 Set the contact model used to calculate the forces between particles.
 
void Translate (double pos_x, double pos_y, double pos_z)
 Translate the Voronoi cells by a given amount.
 
void RotateByRodrigues (double rot_angle, double rot_axis_x, double rot_axis_y, double rot_axis_z)
 Rotate the Voronoi cells by a given angle around a given axis using the Rodrigues formula.
 
Vec3d GetCentroid ()
 Calculate the centroid of the Voronoi cells.
 
void InitFromSTL (std::string const &filename, int num_voros)
 Initialize the Voronoi cells from an STL file with the given number of cells.
 
void InitFromSTL (STLModel const &stl_model, int num_voros)
 Initialize the Voronoi cells from an STLModel object with the given number of cells.
 
void MakePorosity (double porosity)
 Make the Voronoi cells porous by adding gaps between particles.
 
void InitBonds ()
 Initialize the bonded pairs between particles.
 
void SaveAsVTK (std::string const &file_name)
 Save the Voronoi cells as a VTK file.
 
void ImportToScene (Scene *const scene) const
 Import the BondedVoronois object to a Scene object.
 

Public Attributes

VecXT< TriMeshtrimesh_list
 The list of TriMesh objects representing the Voronoi cells.
 
VecXT< Particleparticle_list
 The list of particles in the Voronoi cells.
 
VecXT< ContactPPcontact_list
 The list of contact pairs between particles.
 
VecXT< Vec2ibond_pair_list
 The list of bonded pairs between particles.
 
int cvt_max_iters {1000}
 The maximum number of iterations for the CVT algorithm.
 
double cvt_tol {1.0e-3}
 The tolerance for convergence of the CVT algorithm.
 
ContactModelbond_model {nullptr}
 The contact model used to calculate the forces between particles.
 

Detailed Description

A class representing a set of bonded Voronoi cells generated from an STL file.

Constructor & Destructor Documentation

◆ BondedVoronois() [1/3]

BondedVoronois::BondedVoronois ( )

Default constructor for the BondedVoronois class.

◆ BondedVoronois() [2/3]

BondedVoronois::BondedVoronois ( BondedVoronois const & bp)

Copy constructor for the BondedVoronois class.

Parameters
bpThe BondedVoronois object to copy.

◆ BondedVoronois() [3/3]

BondedVoronois::BondedVoronois ( BondedVoronois const && bp)

Move constructor for the BondedVoronois class.

Parameters
bpThe BondedVoronois object to move.

Member Function Documentation

◆ GetCentroid()

Vec3d BondedVoronois::GetCentroid ( )

Calculate the centroid of the Voronoi cells.

Returns
The centroid of the Voronoi cells as a Vec3d object.

◆ ImportToScene()

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

Import the BondedVoronois object to a Scene object.

Parameters
sceneThe Scene object to import to.

◆ InitBonds()

void BondedVoronois::InitBonds ( )

Initialize the bonded pairs between particles.

◆ InitFromSTL() [1/2]

void netdem::BondedVoronois::InitFromSTL ( std::string const & filename,
int num_voros )

Initialize the Voronoi cells from an STL file with the given number of cells.

Parameters
filenameThe path to the STL file to read.
num_vorosThe number of Voronoi cells to generate.

◆ InitFromSTL() [2/2]

void BondedVoronois::InitFromSTL ( STLModel const & stl_model,
int num_voros )

Initialize the Voronoi cells from an STLModel object with the given number of cells.

Parameters
stl_modelThe STLModel object to read from.
num_vorosThe number of Voronoi cells to generate.

◆ MakePorosity()

void BondedVoronois::MakePorosity ( double porosity)

Make the Voronoi cells porous by adding gaps between particles.

Parameters
porosityThe desired porosity of the cells as a fraction.

◆ operator=() [1/2]

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

Move assignment operator for the BondedVoronois class.

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

◆ operator=() [2/2]

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

Copy assignment operator for the BondedVoronois class.

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

◆ RotateByRodrigues()

void BondedVoronois::RotateByRodrigues ( double rot_angle,
double rot_axis_x,
double rot_axis_y,
double rot_axis_z )

Rotate the Voronoi cells 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.

◆ SaveAsVTK()

void BondedVoronois::SaveAsVTK ( std::string const & file_name)

Save the Voronoi cells as a VTK file.

Parameters
file_nameThe path and name of the VTK file to save.

◆ SetBondModel()

void BondedVoronois::SetBondModel ( ContactModel * cnt_model)

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

Parameters
cnt_modelThe contact model to use.

◆ Translate()

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

Translate the Voronoi cells 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_model

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

The contact model used to calculate the forces between particles.

◆ bond_pair_list

VecXT<Vec2i> netdem::BondedVoronois::bond_pair_list

The list of bonded pairs between particles.

◆ contact_list

VecXT<ContactPP> netdem::BondedVoronois::contact_list

The list of contact pairs between particles.

◆ cvt_max_iters

int netdem::BondedVoronois::cvt_max_iters {1000}

The maximum number of iterations for the CVT algorithm.

◆ cvt_tol

double netdem::BondedVoronois::cvt_tol {1.0e-3}

The tolerance for convergence of the CVT algorithm.

◆ particle_list

VecXT<Particle> netdem::BondedVoronois::particle_list

The list of particles in the Voronoi cells.

◆ trimesh_list

VecXT<TriMesh> netdem::BondedVoronois::trimesh_list

The list of TriMesh objects representing the Voronoi cells.


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