NetDEM v1.0
Loading...
Searching...
No Matches
solver_ann_pp.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_trimesh.hpp"
11#include "wall.hpp"
12#include <string>
13
14namespace netdem {
15
29public:
32
35
42
52 SolverANNPP(Particle *const p1, Particle *const p2);
53
61 CollisionSolverPP *Clone() const override;
62
75 void Init(std::string const &classifier_file,
76 std::string const &regressor_file);
77
86 void Init(Particle *const p1, Particle *const p2) override;
87
96 bool Detect() override;
97
107 void ResolveInit(ContactPP *const cnt, double timestep) override;
108
118 void ResolveUpdate(ContactPP *const cnt, double timestep) override;
119
130 void ResolveInit_LinearSpring(CollisionGeometries *const cnt_geoms,
131 double timestep);
132
144 double timestep);
145
156 void ResolveInit_VolumeBased(CollisionGeometries *const cnt_geoms,
157 double timestep);
158
170 double timestep);
171
183 double timestep);
184
196 double timestep);
197
211 std::tuple<double, Vec3d> GetPotential(Vec3d const &pos, Vec4d const &quat);
212
221 std::tuple<Vec3d, Vec3d, Vec3d> EvaluateContactForces();
222
223private:
225 Shape *shape_1{nullptr};
226
228 Shape *shape_2{nullptr};
229
231 double bound_sphere_radius_1;
232
234 double bound_sphere_radius_2;
235
237 double scale;
238
240 Vec3d dpos_12;
241
243 Vec3d dpos_12_ref;
244
246 Vec4d dquat_12;
247};
248} // namespace netdem
A class representing the geometries associated with a collision.
Definition collision_geometries.hpp:15
An abstract base class for particle-particle collision solvers.
Definition collision_solver_pp.hpp:18
A class representing a contact between two particles.
Definition contact_pp.hpp:20
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
This class represents different types of shapes and performs various calculations on them.
Definition shape.hpp:15
A class that represents a collision solver using artificial neural networks.
Definition solver_ann_pp.hpp:28
void Init(std::string const &classifier_file, std::string const &regressor_file)
Initializes the collision solver with neural network models from disk.
void ResolveUpdate(ContactPP *const cnt, double timestep) override
Resolves the collision during update time.
Definition solver_ann_pp.cpp:96
netdem::GeneralNet classifier
The neural network model used for classification.
Definition solver_ann_pp.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_pp.cpp:247
SolverANNPP()
Default constructor for the SolverANNPP class.
Definition solver_ann_pp.cpp:10
std::tuple< Vec3d, Vec3d, Vec3d > EvaluateContactForces()
Evaluates the contact forces for the collision.
Definition solver_ann_pp.cpp:292
void ResolveInit_PotentialBased(CollisionGeometries *const cnt_geoms, double timestep)
Resolves the collision using a potential-based method at initialization time.
Definition solver_ann_pp.cpp:226
netdem::RegressionNet regressor
The neural network model used for regression.
Definition solver_ann_pp.hpp:34
void ResolveInit_LinearSpring(CollisionGeometries *const cnt_geoms, double timestep)
Resolves the collision using a linear spring model at initialization time.
Definition solver_ann_pp.cpp:112
void ResolveInit(ContactPP *const cnt, double timestep) override
Resolves the collision at initialization time.
Definition solver_ann_pp.cpp:76
void ResolveUpdate_LinearSpring(CollisionGeometries *const cnt_geoms, double timestep)
Resolves the collision using a linear spring model during update time.
Definition solver_ann_pp.cpp:139
bool Detect() override
Detects collisions between the particles.
Definition solver_ann_pp.cpp:42
void ResolveUpdate_VolumeBased(CollisionGeometries *const cnt_geoms, double timestep)
Resolves the collision using a volume-based method during update time.
Definition solver_ann_pp.cpp:196
CollisionSolverPP * Clone() const override
Creates a copy of the SolverANNPP object.
Definition solver_ann_pp.cpp:16
void ResolveInit_VolumeBased(CollisionGeometries *const cnt_geoms, double timestep)
Resolves the collision using a volume-based method at initialization time.
Definition solver_ann_pp.cpp:167
std::tuple< double, Vec3d > GetPotential(Vec3d const &pos, Vec4d const &quat)
Calculates the potential energy and contact position for the collision.
Definition solver_ann_pp.cpp:270
Definition bond_entry.hpp:7
pos
Definition json_serilization.hpp:19
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18
std::array< double, 4 > Vec4d
Definition utils_macros.hpp:19