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

A class that represents a collision solver using artificial neural networks. More...

#include <solver_ann_pp.hpp>

Inheritance diagram for netdem::SolverANNPP:
netdem::CollisionSolverPP

Public Member Functions

 SolverANNPP ()
 Default constructor for the SolverANNPP class.
 
 SolverANNPP (Particle *const p1, Particle *const p2)
 Constructor for the SolverANNPP class.
 
CollisionSolverPPClone () const override
 Creates a copy of the SolverANNPP object.
 
void Init (std::string const &classifier_file, std::string const &regressor_file)
 Initializes the collision solver with neural network models from disk.
 
void Init (Particle *const p1, Particle *const p2) override
 Initializes the collision solver with particles.
 
bool Detect () override
 Detects collisions between the particles.
 
void ResolveInit (ContactPP *const cnt, double timestep) override
 Resolves the collision at initialization time.
 
void ResolveUpdate (ContactPP *const cnt, double timestep) override
 Resolves the collision during update time.
 
void ResolveInit_LinearSpring (CollisionGeometries *const cnt_geoms, double timestep)
 Resolves the collision using a linear spring model at initialization time.
 
void ResolveUpdate_LinearSpring (CollisionGeometries *const cnt_geoms, double timestep)
 Resolves the collision using a linear spring model during update time.
 
void ResolveInit_VolumeBased (CollisionGeometries *const cnt_geoms, double timestep)
 Resolves the collision using a volume-based method at initialization time.
 
void ResolveUpdate_VolumeBased (CollisionGeometries *const cnt_geoms, double timestep)
 Resolves the collision using a volume-based method during update time.
 
void ResolveInit_PotentialBased (CollisionGeometries *const cnt_geoms, double timestep)
 Resolves the collision using a potential-based method at initialization time.
 
void ResolveUpdate_PotentialBased (CollisionGeometries *const cnt_geoms, double timestep)
 Resolves the collision using a potential-based method during update time.
 
std::tuple< double, Vec3dGetPotential (Vec3d const &pos, Vec4d const &quat)
 Calculates the potential energy and contact position for the collision.
 
std::tuple< Vec3d, Vec3d, Vec3dEvaluateContactForces ()
 Evaluates the contact forces for the collision.
 
- Public Member Functions inherited from netdem::CollisionSolverPP
 CollisionSolverPP ()
 
 CollisionSolverPP (Particle *const p1, Particle *const p2)
 
virtual bool Detect (ContactPP *const cnt)
 
virtual ~CollisionSolverPP ()
 

Public Attributes

netdem::GeneralNet classifier
 The neural network model used for classification.
 
netdem::RegressionNet regressor
 The neural network model used for regression.
 
- Public Attributes inherited from netdem::CollisionSolverPP
Particleparticle_1 {nullptr}
 
Particleparticle_2 {nullptr}
 

Additional Inherited Members

- Protected Member Functions inherited from netdem::CollisionSolverPP
void InitBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep)
 
void UpdateBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep, Vec3d const &dir_n_old)
 Update the basic contact geometries associated with a collision.
 

Detailed Description

A class that represents a collision solver using artificial neural networks.

concrete geometric solver for sphere and sphere contacts.

The SolverANNPP class is a specific implementation of a collision solver using artificial neural networks. It provides functionality to detect and resolve collisions between two particles, as well as calculate potential energies and contact forces.

Examples
90_random_packing_trimesh.cpp, 91_triaixal_comp.cpp, 92_angle_of_repose.cpp, and 96_random_packing_ellipsoid.cpp.

Constructor & Destructor Documentation

◆ SolverANNPP() [1/2]

netdem::SolverANNPP::SolverANNPP ( )

Default constructor for the SolverANNPP class.

This function constructs a new SolverANNPP object with default values.

◆ SolverANNPP() [2/2]

netdem::SolverANNPP::SolverANNPP ( Particle *const p1,
Particle *const p2 )

Constructor for the SolverANNPP class.

This function constructs a new SolverANNPP object with the provided particles.

Parameters
p1The first particle.
p2The second particle.

Member Function Documentation

◆ Clone()

CollisionSolverPP * netdem::SolverANNPP::Clone ( ) const
overridevirtual

Creates a copy of the SolverANNPP object.

This function creates a copy of the SolverANNPP object.

Returns
A pointer to the newly created copy of the SolverANNPP object.

Implements netdem::CollisionSolverPP.

◆ Detect()

bool netdem::SolverANNPP::Detect ( )
overridevirtual

Detects collisions between the particles.

This function detects collisions between the particles using the neural network classification model.

Returns
Whether or not a collision was detected.

Implements netdem::CollisionSolverPP.

◆ EvaluateContactForces()

tuple< Vec3d, Vec3d, Vec3d > netdem::SolverANNPP::EvaluateContactForces ( )

Evaluates the contact forces for the collision.

This function evaluates the contact forces for the collision and returns them as a tuple containing the force, moment, and position vectors.

Returns
A tuple containing the force, moment, and position vectors.

◆ GetPotential()

tuple< double, Vec3d > netdem::SolverANNPP::GetPotential ( Vec3d const & pos,
Vec4d const & quat )

Calculates the potential energy and contact position for the collision.

This function calculates the potential energy and contact position for the collision given a position and quaternion representing the particles' orientations.

Parameters
posThe position of the particles relative to each other.
quatThe quaternion representing the particles' orientations relative to each other.
Returns
A tuple containing the potential energy and contact position.

◆ Init() [1/2]

void netdem::SolverANNPP::Init ( Particle *const p1,
Particle *const p2 )
overridevirtual

Initializes the collision solver with particles.

This function initializes the collision solver with the provided particles.

Parameters
p1The first particle.
p2The second particle.

Reimplemented from netdem::CollisionSolverPP.

◆ Init() [2/2]

void netdem::SolverANNPP::Init ( std::string const & classifier_file,
std::string const & regressor_file )

Initializes the collision solver with neural network models from disk.

This function initializes the collision solver with neural network models loaded from disk.

Parameters
classifier_fileThe name of the file containing the classification model data.
regressor_fileThe name of the file containing the regression model data.
Examples
90_random_packing_trimesh.cpp, 91_triaixal_comp.cpp, 92_angle_of_repose.cpp, and 96_random_packing_ellipsoid.cpp.

◆ ResolveInit()

void netdem::SolverANNPP::ResolveInit ( ContactPP *const cnt,
double timestep )
overridevirtual

Resolves the collision at initialization time.

This function resolves the collision between the particles at initialization time using one of several methods.

Parameters
cntThe contact point representing the collision.
timestepThe timestep used for the simulation.

Implements netdem::CollisionSolverPP.

◆ ResolveInit_LinearSpring()

void netdem::SolverANNPP::ResolveInit_LinearSpring ( CollisionGeometries *const cnt_geoms,
double timestep )

Resolves the collision using a linear spring model at initialization time.

This function resolves the collision between the particles at initialization time using a linear spring model.

Parameters
cnt_geomsThe collision geometries used to resolve the collision.
timestepThe timestep used for the simulation.

◆ ResolveInit_PotentialBased()

void netdem::SolverANNPP::ResolveInit_PotentialBased ( CollisionGeometries *const cnt_geoms,
double timestep )

Resolves the collision using a potential-based method at initialization time.

This function resolves the collision between the particles at initialization time using a potential-based method.

Parameters
cnt_geomsThe collision geometries used to resolve the collision.
timestepThe timestep used for the simulation.

◆ ResolveInit_VolumeBased()

void netdem::SolverANNPP::ResolveInit_VolumeBased ( CollisionGeometries *const cnt_geoms,
double timestep )

Resolves the collision using a volume-based method at initialization time.

This function resolves the collision between the particles at initialization time using a volume-based method.

Parameters
cnt_geomsThe collision geometries used to resolve the collision.
timestepThe timestep used for the simulation.

◆ ResolveUpdate()

void netdem::SolverANNPP::ResolveUpdate ( ContactPP *const cnt,
double timestep )
overridevirtual

Resolves the collision during update time.

This function resolves the collision between the particles during update time using one of several methods.

Parameters
cntThe contact point representing the collision.
timestepThe timestep used for the simulation.

Implements netdem::CollisionSolverPP.

◆ ResolveUpdate_LinearSpring()

void netdem::SolverANNPP::ResolveUpdate_LinearSpring ( CollisionGeometries *const cnt_geoms,
double timestep )

Resolves the collision using a linear spring model during update time.

This function resolves the collision between the particles during update time using a linear spring model.

Parameters
cnt_geomsThe collision geometries used to resolve the collision.
timestepThe timestep used for the simulation.

◆ ResolveUpdate_PotentialBased()

void netdem::SolverANNPP::ResolveUpdate_PotentialBased ( CollisionGeometries *const cnt_geoms,
double timestep )

Resolves the collision using a potential-based method during update time.

This function resolves the collision between the particles during update time using a potential-based method.

Parameters
cnt_geomsThe collision geometries used to resolve the collision.
timestepThe timestep used for the simulation.

◆ ResolveUpdate_VolumeBased()

void netdem::SolverANNPP::ResolveUpdate_VolumeBased ( CollisionGeometries *const cnt_geoms,
double timestep )

Resolves the collision using a volume-based method during update time.

This function resolves the collision between the particles during update time using a volume-based method.

Parameters
cnt_geomsThe collision geometries used to resolve the collision.
timestepThe timestep used for the simulation.

Member Data Documentation

◆ classifier

netdem::GeneralNet netdem::SolverANNPP::classifier

The neural network model used for classification.

◆ regressor

netdem::RegressionNet netdem::SolverANNPP::regressor

The neural network model used for regression.


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