NetDEM v1.0
Loading...
Searching...
No Matches
particle_motion_control.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "modifier.hpp"
4#include "particle.hpp"
5#include "utils_math.hpp"
6#include <unordered_map>
7#include <unordered_set>
8
9namespace netdem {
10
18private:
20 enum Type { fixed, fix_rotation, linear_spin, linear_vel, sin_vel, num_motions };
21
23 std::unordered_set<int> particle_id_list;
24
26 VecXT<Particle *> particle_list;
27
29 VecXT<Type> motion_type_list;
30
32 VecXT<VecNd<9>> params_list;
33
34public:
39
45 void SetFixed(int id);
46
52 void SetFixRotation(int id);
53
54
55 void SetLinearSpin(int id, double spin_x,double spin_y, double spin_z);
56
68 void SetLinearVelocity(int id, double xa, double xb, double ya, double yb,
69 double za, double zb);
70
88 void SetSinVelocity(int id, double x_amplit, double x_freq, double x_phase,
89 double y_amplit, double y_freq, double y_phase,
90 double z_amplit, double z_freq, double z_phase);
91
97
101 void Clear();
102
108 Modifier *Clone() const override;
109
114 void Execute() override;
115
122 void Update() override;
123
124private:
125 std::unordered_map<int, VecNd<10>> id_params_map;
126};
127
128} // namespace netdem
An interface class used to modify a DEM simulation.
Definition modifier.hpp:18
A class used to add motion control to particles in a DEM simulation.
Definition particle_motion_control.hpp:17
void SetFixed(int id)
Sets the particle to have a fixed position.
Definition particle_motion_control.cpp:18
void Clear()
Clears all particles from the ParticleMotionControl instance.
Definition particle_motion_control.cpp:139
ParticleMotionControl()
Default constructor for ParticleMotionControl class.
Definition particle_motion_control.cpp:12
void SetFixRotation(int id)
Sets the particle to have a fixed rotation.
Definition particle_motion_control.cpp:23
Modifier * Clone() const override
Clones the current ParticleMotionControl instance.
Definition particle_motion_control.cpp:146
void SyncToAllProcessors()
Synchronizes the particle motion across all processors in the simulation.
Definition particle_motion_control.cpp:74
void Update() override
Updates the ParticleMotionControl instance.
Definition particle_motion_control.cpp:214
void Execute() override
Executes the ParticleMotionControl instance at the beginning of a DEM cycle.
Definition particle_motion_control.cpp:150
void SetLinearVelocity(int id, double xa, double xb, double ya, double yb, double za, double zb)
Sets the particle to have a linear velocity.
Definition particle_motion_control.cpp:36
void SetSinVelocity(int id, double x_amplit, double x_freq, double x_phase, double y_amplit, double y_freq, double y_phase, double z_amplit, double z_freq, double z_phase)
Sets the particle to have a sinusoidal velocity.
Definition particle_motion_control.cpp:53
void SetLinearSpin(int id, double spin_x, double spin_y, double spin_z)
Definition particle_motion_control.cpp:28
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31