NetDEM v1.0
Loading...
Searching...
No Matches
collision_solver_pw.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "contact_model.hpp"
5#include "contact_pw.hpp"
6#include "particle.hpp"
7#include "wall.hpp"
8
9namespace netdem {
10
21public:
25 Particle *particle{nullptr};
26
30 Wall *wall{nullptr};
31
36
43 CollisionSolverPW(Particle *const p, Wall *const w) : particle(p), wall(w) {}
44
48 virtual CollisionSolverPW *Clone() const = 0;
49
56 virtual void Init(Particle *const p, Wall *const w) {
57 particle = p;
58 wall = w;
59 }
60
66 virtual bool Detect() = 0;
67
76 virtual bool Detect(ContactPW *const cnt) { return Detect(); }
77
85 virtual void ResolveInit(ContactPW *const cnt, double timestep) = 0;
86
95 virtual void ResolveUpdate(ContactPW *const cnt, double timestep) = 0;
96
101
102protected:
110 void InitBasicGeoms(CollisionGeometries *const cnt_geoms, double timestep);
111
120 void UpdateBasicGeoms(CollisionGeometries *const cnt_geoms, double timestep,
121 Vec3d const &dir_n_old);
122};
123
124} // 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
CollisionSolverPW()
Definition collision_solver_pw.hpp:35
virtual void ResolveInit(ContactPW *const cnt, double timestep)=0
virtual void ResolveUpdate(ContactPW *const cnt, double timestep)=0
virtual void Init(Particle *const p, Wall *const w)
Definition collision_solver_pw.hpp:56
virtual bool Detect()=0
void UpdateBasicGeoms(CollisionGeometries *const cnt_geoms, double timestep, Vec3d const &dir_n_old)
Definition collision_solver_pw.cpp:35
Particle * particle
Definition collision_solver_pw.hpp:25
CollisionSolverPW(Particle *const p, Wall *const w)
Definition collision_solver_pw.hpp:43
virtual CollisionSolverPW * Clone() const =0
void InitBasicGeoms(CollisionGeometries *const cnt_geoms, double timestep)
Definition collision_solver_pw.cpp:5
virtual ~CollisionSolverPW()
Definition collision_solver_pw.hpp:100
virtual bool Detect(ContactPW *const cnt)
Definition collision_solver_pw.hpp:76
Wall * wall
Definition collision_solver_pw.hpp:30
A class representing a contact between a particle and a wall.
Definition contact_pw.hpp:22
Definition particle.hpp:26
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