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

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

#include <solver_ann_pw.hpp>

Inheritance diagram for netdem::SolverANNPW:
netdem::CollisionSolverPW

Public Member Functions

 SolverANNPW ()
 Default constructor for the SolverANNPW class.
 
 SolverANNPW (Particle *const p, Wall *const w)
 Constructor for the SolverANNPW class.
 
CollisionSolverPWClone () const override
 Creates a copy of the SolverANNPW 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 p, Wall *const w) override
 Initializes the collision solver with two particles.
 
bool Detect () override
 Detects collisions between the two particles.
 
void ResolveInit (ContactPW *const cnt, double timestep) override
 Resolves the collision at initialization time.
 
void ResolveUpdate (ContactPW *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::CollisionSolverPW
 CollisionSolverPW ()
 
 CollisionSolverPW (Particle *const p, Wall *const w)
 
virtual bool Detect (ContactPW *const cnt)
 
virtual ~CollisionSolverPW ()
 

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::CollisionSolverPW
Particleparticle {nullptr}
 
Wallwall {nullptr}
 

Additional Inherited Members

- Protected Member Functions inherited from netdem::CollisionSolverPW
void InitBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep)
 
void UpdateBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep, Vec3d const &dir_n_old)
 

Detailed Description

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

concrete geometric solver for sphere and sphere contacts.

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

Constructor & Destructor Documentation

◆ SolverANNPW() [1/2]

netdem::SolverANNPW::SolverANNPW ( )

Default constructor for the SolverANNPW class.

This function constructs a new SolverANNPW object with default values.

◆ SolverANNPW() [2/2]

netdem::SolverANNPW::SolverANNPW ( Particle *const p,
Wall *const w )

Constructor for the SolverANNPW class.

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

Parameters
pThe first particle.
wThe second particle.

Member Function Documentation

◆ Clone()

CollisionSolverPW * netdem::SolverANNPW::Clone ( ) const
overridevirtual

Creates a copy of the SolverANNPW object.

This function creates a copy of the SolverANNPW object.

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

Implements netdem::CollisionSolverPW.

◆ Detect()

bool netdem::SolverANNPW::Detect ( )
overridevirtual

Detects collisions between the two particles.

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

Returns
Whether or not a collision was detected.

Implements netdem::CollisionSolverPW.

◆ EvaluateContactForces()

tuple< Vec3d, Vec3d, Vec3d > netdem::SolverANNPW::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::SolverANNPW::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 the positions and orientations of the two particles.

Parameters
posThe position of the first particle.
quatThe orientation of the first particle.
Returns
A tuple containing the potential energy and contact position.

◆ Init() [1/2]

void netdem::SolverANNPW::Init ( Particle *const p,
Wall *const w )
overridevirtual

Initializes the collision solver with two particles.

This function initializes the collision solver with the provided particles.

Parameters
pThe first particle.
wThe second particle.

Reimplemented from netdem::CollisionSolverPW.

◆ Init() [2/2]

void netdem::SolverANNPW::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.

◆ ResolveInit()

void netdem::SolverANNPW::ResolveInit ( ContactPW *const cnt,
double timestep )
overridevirtual

Resolves the collision at initialization time.

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

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

Implements netdem::CollisionSolverPW.

◆ ResolveInit_LinearSpring()

void netdem::SolverANNPW::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 two 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::SolverANNPW::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 two 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::SolverANNPW::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 two 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::SolverANNPW::ResolveUpdate ( ContactPW *const cnt,
double timestep )
overridevirtual

Resolves the collision during update time.

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

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

Implements netdem::CollisionSolverPW.

◆ ResolveUpdate_LinearSpring()

void netdem::SolverANNPW::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 two 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::SolverANNPW::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 two 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::SolverANNPW::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 two 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::SolverANNPW::classifier

The neural network model used for classification.

◆ regressor

netdem::RegressionNet netdem::SolverANNPW::regressor

The neural network model used for regression.


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