NetDEM v1.0
Loading...
Searching...
No Matches
deformation_analysis.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "modifier.hpp"
5#include "particle_group.hpp"
6#include <unordered_map>
7
8namespace netdem {
9
16private:
20 enum SolveBy { cycles, time };
21
22 // 0: cycles, 1: time
23 SolveBy solve_by{SolveBy::cycles};
24
25 int solve_cycle_interval{0};
26 double solve_time_interval{0};
27
28 int solve_cycle_previous{0};
29 double solve_time_previous{0};
30
34 using SaveBy = SolveBy;
35
36 SaveBy save_by{SaveBy::cycles};
37
38 int save_cycle_interval{0};
39 double save_time_interval{0};
40
41 int save_cycle_previous{0};
42 double save_time_previous{0};
43
44public:
45 double neo_k{6.94e5}, neo_mu{5.21e5}, density{500.0};
46 double damp_coef{0.7};
47
48 Vec3d gravity_coef{0.0, 0.0, -9.81};
49 double timestep{1.0e-4};
50 int mesh_res{20};
51
52 std::string root_path{"tmp/out/deformation_analysis/"};
53
55 std::unordered_map<Particle *, std::pair<bool, DeformableParticle>>
57
58public:
63
69 Modifier *Clone() const override;
70
76 void Init(Simulation *sim) override;
77
83 void SetSolveByTime(double interval);
84
90 void SetSolveByCycles(double interval);
91
97 void SetSaveByTime(double interval);
98
104 void SetSaveByCycles(double interval);
105
109 void Execute() override;
110
114 void Update() override;
115
116private:
120 void SolveDeformation();
121
125 void SaveFEMAsVTK();
126
134 void EvaluateBCForce(DeformableParticle *const p_deformable_ptr,
135 ContactPP *const cnt);
136
144 void EvaluateBCForce(DeformableParticle *const p_deformable_ptr,
145 ContactPW *const cnt);
146
153 void SetSettings(FEMSimulator *const fem_sim);
154
162 std::string GetFEMResultFileName(Particle *const p_ptr);
163
171 bool CheckIfToExecute();
172};
173
174} // namespace netdem
A class representing a contact between two particles.
Definition contact_pp.hpp:20
A class representing a contact between a particle and a wall.
Definition contact_pw.hpp:22
A class representing a deformable particle simulated using the Finite Element Method (FEM).
Definition deformable_particle.hpp:21
A class used to perform deformation analysis on particles in a DEM simulation. This is a post-modifie...
Definition deformation_analysis.hpp:15
double damp_coef
Definition deformation_analysis.hpp:46
Vec3d gravity_coef
Definition deformation_analysis.hpp:48
double timestep
Definition deformation_analysis.hpp:49
void SetSolveByTime(double interval)
Sets the interval for solving FEM by time.
Definition deformation_analysis.cpp:24
double density
Definition deformation_analysis.hpp:45
std::unordered_map< Particle *, std::pair< bool, DeformableParticle > > particle_map
reference of the particles in the dem simulation
Definition deformation_analysis.hpp:56
std::string root_path
Definition deformation_analysis.hpp:52
int mesh_res
Definition deformation_analysis.hpp:50
void SetSolveByCycles(double interval)
Sets the interval for solving FEM by cycles.
Definition deformation_analysis.cpp:29
void SetSaveByTime(double interval)
Sets the interval for saving data by time.
Definition deformation_analysis.cpp:34
void SetSaveByCycles(double interval)
Sets the interval for saving data by cyles.
Definition deformation_analysis.cpp:39
void Init(Simulation *sim) override
Initializes the DeformationAnalysis instance.
Definition deformation_analysis.cpp:22
void Execute() override
Executes the DeformationAnalysis instance.
Definition deformation_analysis.cpp:44
double neo_k
Definition deformation_analysis.hpp:45
double neo_mu
Definition deformation_analysis.hpp:45
Modifier * Clone() const override
Clones the current DeformationAnalysis instance.
Definition deformation_analysis.cpp:18
DeformationAnalysis()
Default constructor for DeformationAnalysis class.
Definition deformation_analysis.cpp:11
void Update() override
Updates the DeformationAnalysis instance.
Definition deformation_analysis.cpp:68
A Finite Element Method (FEM) simulator used for simulating the deformation of objects.
Definition fem_simulator.hpp:18
An interface class used to modify a DEM simulation.
Definition modifier.hpp:18
Simulation * sim
Definition modifier.hpp:23
A class used to group particles in a DEM simulation.
Definition particle_group.hpp:16
Definition particle.hpp:26
Class for managing a DEM simulation.
Definition simulation.hpp:21
Definition bond_entry.hpp:7
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18