NetDEM v1.0
Loading...
Searching...
No Matches
peridigm_dem_coupler.hpp
Go to the documentation of this file.
1// Originates from Fan Zhu (HKUST). Modified by Zhengshou Lai to be coupled with
2// NetDEM by Sep 12, 2021
3
4#pragma once
5
6#include "dem_fragment.hpp"
7#include "particle.hpp"
10#include "simulation.hpp"
11#include <string>
12
13namespace netdem {
14
25public:
29 std::string base_dir{"tmp/out/"};
30
35
39 Particle *particle{nullptr};
40
45
50
54 int mesh_res{20};
55
59 double node_size_ave{0.0};
60
65
71
77
83
89
95
99 double contact_force_max{0.0};
100
105
111
115 double loading_rate{1.0e5};
116
120 int loading_steps{1000};
121
125 double mech_time{0.0};
126
130 bool is_broken{false};
131
137
142 double fragment_vol_limit{0.001};
143
148 bool ignore_fines{true};
149
153 bool use_alpha_shape{true};
154
159 double fragment_alpha{0.0};
160
165
170
175
183 void Init(Particle *p);
184
190 void Solve();
191
202 void ApplyBoundaryForce(Vec3d const &pos, Vec3d const &force);
203
212 bool CheckBreakage();
213
225
226private:
234 double damage_limit{0.5};
235
242 VecXT<VecXT<double>> damage_data;
243
251 void UpdateMaterials();
252
259 void UpdateMechTime();
260
269 void UpdateCriticalStretch();
270
279 std::string GetResultDirectory();
280
294 VecXT<int> SeperateFragments(const VecXT<Vec2i> &bond_list);
295
311 VecXT<int> GetFragmentNodeIndices(const VecXT<Vec2i> &bond_list,
312 const VecXT<int> &frag_id_list,
313 int frag_id);
314
328 VecXT<Vec3d> GetFragmentNodes(const VecXT<Vec3d> &node_list,
329 const VecXT<int> &node_ids);
330
344 VecXT<Vec3d> GetFragmentNodeVelocities(const VecXT<Vec3d> &velocity_list,
345 const VecXT<int> &node_ids);
346
360 VecXT<double> GetFragmentNodevolumes(const VecXT<double> &node_vol_list,
361 const VecXT<int> &node_ids);
362
375 STLModel GetAlphaShape(const VecXT<Vec3d> &point_list, double alpha);
376
388 void ResolveFragmentOverlap(VecXT<DEMFragment> *const frag_list);
389
402 DEMFragment GetFragmentCombined(const VecXT<DEMFragment> &frag_list);
403
412 void WriteLogFileDEM();
413};
414
415} // namespace netdem
A class representing a fragment in a discrete element method simulation.
Definition dem_fragment.hpp:17
Definition particle.hpp:26
A class representing a coupling between a discrete element method (DEM) simulation and a peridynamic ...
Definition peridigm_dem_coupler.hpp:24
bool is_broken
Whether the material is currently broken.
Definition peridigm_dem_coupler.hpp:130
PeriDigmMaterial material_params
The material parameters of the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:169
PeriDigmSimulator pd_sim
The peridynamic simulator.
Definition peridigm_dem_coupler.hpp:44
VecXT< int > unbalanced_force_nodes
The indices of the nodes on which unbalanced forces are applied in the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:88
double mech_time
The current mechanical time.
Definition peridigm_dem_coupler.hpp:125
bool use_alpha_shape
Whether to use alpha shapes in the fragment reconstruction routine.
Definition peridigm_dem_coupler.hpp:153
Particle * particle
A pointer to the particle.
Definition peridigm_dem_coupler.hpp:39
bool use_customized_loading_rate
Whether to use a customized loading rate in the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:110
double node_size_ave
The average size of the nodes.
Definition peridigm_dem_coupler.hpp:59
PeriDigmDEMCoupler()
Default constructor.
Definition peridigm_dem_coupler.cpp:17
int loading_steps
The number of loading steps used in the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:120
bool ignore_fines
Whether to ignore spherical fines during the fragment reconstruction routine.
Definition peridigm_dem_coupler.hpp:148
Vec3d unbalanced_force_values
The values of the unbalanced forces applied to the nodes in the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:94
void Init(Particle *p)
Initializes the coupler with the given particle.
Definition peridigm_dem_coupler.cpp:19
std::string base_dir
The working directory.
Definition peridigm_dem_coupler.hpp:29
bool CheckBreakage()
Checks if particle breakage has occurred.
Definition peridigm_dem_coupler.cpp:188
VecXT< DEMFragment > GetFragments()
Gets the fragments resulting from the fragment reconstruction routine.
Definition peridigm_dem_coupler.cpp:205
void Solve()
Solves the coupled DEM and peridynamic simulations.
Definition peridigm_dem_coupler.cpp:161
VecXT< int > boundary_force_nodes
The indices of the nodes on which boundary forces are applied in the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:70
VecXT< int > fixed_nodes
The indices of the fixed nodes in the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:64
double damage_fraction_limit
The limit for the fraction of damaged bonds above which the fragment reconstruction routine is invoke...
Definition peridigm_dem_coupler.hpp:136
int mesh_res
The resolution of the mesh.
Definition peridigm_dem_coupler.hpp:54
PeriDigmStrength strength_params
The strength parameters of the particles.
Definition peridigm_dem_coupler.hpp:164
VecXT< Vec3d > boundary_force_values
The values of the boundary forces applied to the nodes in the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:82
double fragment_alpha
The value of alpha used in the alpha shape computation for the fragment reconstruction routine.
Definition peridigm_dem_coupler.hpp:159
double fragment_vol_limit
The limit for the volume of a fragment below which it will be considered a spherical fine rather than...
Definition peridigm_dem_coupler.hpp:142
double loading_rate
The loading rate used in the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:115
double contact_force_max
The maximum contact force.
Definition peridigm_dem_coupler.hpp:99
void ApplyBoundaryForce(Vec3d const &pos, Vec3d const &force)
Applies a boundary force to the peridynamic simulation at the given position.
Definition peridigm_dem_coupler.cpp:166
int sub_dir_index
The index of the subdirectory.
Definition peridigm_dem_coupler.hpp:34
VecXT< double > boundary_force_node_vols
The volumes of the nodes on which boundary forces are applied in the peridynamic simulation.
Definition peridigm_dem_coupler.hpp:76
STLModel surface_stl
The STL model of the surface.
Definition peridigm_dem_coupler.hpp:49
VecXT< double > contact_force_list
A list of contact forces.
Definition peridigm_dem_coupler.hpp:104
A class representing the material properties used in a peridynamic simulation.
Definition peridigm_material.hpp:16
A class representing a simulator for peridynamic simulations.
Definition peridigm_simulator.hpp:24
Definition peridigm_strength.hpp:7
Class for working with STL models.
Definition stl_model.hpp:17
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
pos
Definition json_serilization.hpp:19
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18