NetDEM v1.0
Loading...
Searching...
No Matches
solver_ann_pplane.hpp
Go to the documentation of this file.
1#pragma once
2
6#include "general_net.hpp"
7#include "particle.hpp"
8#include "regression_net.hpp"
9#include "shape.hpp"
10#include "shape_plane.hpp"
11#include "wall.hpp"
12#include <string>
13
14namespace netdem {
15
29public:
32
35
43
53 SolverANNPPlane(Particle *const p, Wall *const w);
54
55 CollisionSolverPW *Clone() const override;
68 void Init(std::string const &classifier_file,
69 std::string const &regressor_file);
79 void Init(Particle *const p, Wall *const w) override;
88 bool Detect() override;
89
90 void ResolveInit(ContactPW *const cnt, double timestep) override;
91 void ResolveUpdate(ContactPW *const cnt, double timestep) override;
92
94 double timestep);
96 double timestep);
106 void ResolveInit_VolumeBased(CollisionGeometries *const cnt_geoms,
107 double timestep);
119 double timestep);
131 double timestep);
132
144 double timestep);
157 // return: potential and cnt_pos
158 std::tuple<double, Vec3d> GetPotential(double dist, Vec3d const &nn);
167 // return: force, moment and pos
168 std::tuple<double, Vec3d, Vec3d> EvaluateContactForces();
169
170private:
171 double bound_sphere_radius_1, dist_pc_to_plane, scale;
172 Vec3d dir_n, dir_n_ref;
173};
174
175} // namespace netdem
A class representing the geometries associated with a collision.
Definition collision_geometries.hpp:15
An abstract class representing a collision solver for a particle and a wall.
Definition collision_solver_pw.hpp:20
A class representing a contact between a particle and a wall.
Definition contact_pw.hpp:22
A class representing a general neural network.
Definition general_net.hpp:19
Definition particle.hpp:26
A class that represents a feedforward neural network for regression.
Definition regression_net.hpp:21
A class that represents a collision solver between a particle and a plane using artificial neural net...
Definition solver_ann_pplane.hpp:28
void ResolveUpdate_VolumeBased(CollisionGeometries *const cnt_geoms, double timestep)
Resolves the collision using a volume-based method during update time.
Definition solver_ann_pplane.cpp:169
std::tuple< double, Vec3d, Vec3d > EvaluateContactForces()
Evaluates the contact forces for the collision.
Definition solver_ann_pplane.cpp:256
void ResolveUpdate_LinearSpring(CollisionGeometries *const cnt_geoms, double timestep)
Definition solver_ann_pplane.cpp:122
void ResolveInit_LinearSpring(CollisionGeometries *const cnt_geoms, double timestep)
Definition solver_ann_pplane.cpp:102
void Init(std::string const &classifier_file, std::string const &regressor_file)
Initializes the collision solver with neural network models from disk.
void ResolveInit_VolumeBased(CollisionGeometries *const cnt_geoms, double timestep)
Resolves the collision at initialization time.
Definition solver_ann_pplane.cpp:145
SolverANNPPlane()
Default constructor for the SolverANNPPlane class.
Definition solver_ann_pplane.cpp:9
void ResolveUpdate(ContactPW *const cnt, double timestep) override
Definition solver_ann_pplane.cpp:86
std::tuple< double, Vec3d > GetPotential(double dist, Vec3d const &nn)
Calculates the potential energy and contact position for the collision.
Definition solver_ann_pplane.cpp:237
netdem::GeneralNet classifier
The neural network model used for classification.
Definition solver_ann_pplane.hpp:31
void ResolveUpdate_PotentialBased(CollisionGeometries *const cnt_geoms, double timestep)
Resolves the collision using a potential-based method during update time.
Definition solver_ann_pplane.cpp:215
netdem::RegressionNet regressor
The neural network model used for regression.
Definition solver_ann_pplane.hpp:34
void ResolveInit_PotentialBased(CollisionGeometries *const cnt_geoms, double timestep)
Resolves the collision using a potential-based method at initialization time.
Definition solver_ann_pplane.cpp:195
void ResolveInit(ContactPW *const cnt, double timestep) override
Definition solver_ann_pplane.cpp:66
CollisionSolverPW * Clone() const override
Definition solver_ann_pplane.cpp:15
bool Detect() override
Detects collisions between the particle and the wall.
Definition solver_ann_pplane.cpp:49
A class representing a wall object in a physics simulation.
Definition wall.hpp:32
Definition bond_entry.hpp:7
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18