NetDEM v1.0
Loading...
Searching...
No Matches
collision_solver_pp.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "contact_model.hpp"
5#include "contact_pp.hpp"
6#include "particle.hpp"
7
8namespace netdem {
9
19public:
24
29
34
41 CollisionSolverPP(Particle *const p1, Particle *const p2)
42 : particle_1(p1), particle_2(p2) {}
43
52 virtual CollisionSolverPP *Clone() const = 0;
53
63 virtual void Init(Particle *const p1, Particle *const p2) {
64 particle_1 = p1;
65 particle_2 = p2;
66 }
67
76 virtual bool Detect() = 0;
77
89 virtual bool Detect(ContactPP *const cnt) { return Detect(); }
90
102 virtual void ResolveInit(ContactPP *const cnt, double timestep) = 0;
103
115 virtual void ResolveUpdate(ContactPP *const cnt, double timestep) = 0;
116
121
122protected:
135 void InitBasicGeoms(CollisionGeometries *const cnt_geoms, double timestep);
136
150 void UpdateBasicGeoms(CollisionGeometries *const cnt_geoms, double timestep,
151 Vec3d const &dir_n_old);
152};
153
154} // 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
virtual bool Detect(ContactPP *const cnt)
Definition collision_solver_pp.hpp:89
Particle * particle_2
Definition collision_solver_pp.hpp:28
void InitBasicGeoms(CollisionGeometries *const cnt_geoms, double timestep)
Definition collision_solver_pp.cpp:5
CollisionSolverPP()
Definition collision_solver_pp.hpp:33
virtual void ResolveInit(ContactPP *const cnt, double timestep)=0
Particle * particle_1
Definition collision_solver_pp.hpp:23
virtual void Init(Particle *const p1, Particle *const p2)
Definition collision_solver_pp.hpp:63
virtual bool Detect()=0
virtual void ResolveUpdate(ContactPP *const cnt, double timestep)=0
CollisionSolverPP(Particle *const p1, Particle *const p2)
Definition collision_solver_pp.hpp:41
virtual CollisionSolverPP * Clone() const =0
void UpdateBasicGeoms(CollisionGeometries *const cnt_geoms, double timestep, Vec3d const &dir_n_old)
Update the basic contact geometries associated with a collision.
Definition collision_solver_pp.cpp:35
virtual ~CollisionSolverPP()
Definition collision_solver_pp.hpp:120
A class representing a contact between two particles.
Definition contact_pp.hpp:20
Definition particle.hpp:26
Definition bond_entry.hpp:7
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18