19 Wall w_mx, w_px, w_my, w_py, w_mz, w_pz;
32 WallBoxPlate(
double len_x,
double len_y,
double len_z,
double center_x,
33 double center_y,
double center_z) {
34 double t_factor = 0.1;
35 double len_factor = 1 + 2 * t_factor;
36 double pan_factor = 0.5 * (1 + t_factor);
38 p_x0 = GetBox(len_x * t_factor, len_y * len_factor, len_z * len_factor);
39 w_mx = w_px =
Wall(&p_x0);
40 w_mx.
SetPosition(center_x - pan_factor * len_x, center_y, center_z);
41 w_px.
SetPosition(center_x + pan_factor * len_x, center_y, center_z);
43 p_y0 = GetBox(len_x * len_factor, len_y * t_factor, len_z * len_factor);
44 w_my = w_py =
Wall(&p_y0);
45 w_my.
SetPosition(center_x, center_y - pan_factor * len_y, center_z);
46 w_py.
SetPosition(center_x, center_y + pan_factor * len_y, center_z);
48 p_z0 = GetBox(len_x * len_factor, len_y * len_factor, len_z * t_factor);
49 w_mz = w_pz =
Wall(&p_z0);
50 w_mz.
SetPosition(center_x, center_y, center_z - pan_factor * len_z);
51 w_pz.
SetPosition(center_x, center_y, center_z + pan_factor * len_z);
62 plate_list.emplace_back(&p_x0);
63 plate_list.emplace_back(&p_y0);
64 plate_list.emplace_back(&p_z0);
75 wall_list.emplace_back(&w_mx);
76 wall_list.emplace_back(&w_px);
77 wall_list.emplace_back(&w_my);
78 wall_list.emplace_back(&w_py);
79 wall_list.emplace_back(&w_mz);
80 wall_list.emplace_back(&w_pz);
91 auto wall_ptr_list_local =
GetWall();
93 auto shape_ptr_list = scene->
InsertShape(shape_ptr_list_local);
95 for (
int i = 0; i < 6; i++) {
96 wall_ptr_list_local[i]->SetShape(shape_ptr_list[i / 2]);
98 wall_ptr_list_local[i]->
SetShape(shape_ptr_list_local[i / 2]);
116 TriMesh GetBox(
double len_x,
double len_y,
double len_z) {
119 box_ref.
facets.resize(12);
121 box_ref.
vertices[0][0] = -0.5 * len_x;
122 box_ref.
vertices[0][1] = -0.5 * len_y;
123 box_ref.
vertices[0][2] = -0.5 * len_z;
125 box_ref.
vertices[1][0] = -0.5 * len_x;
126 box_ref.
vertices[1][1] = 0.5 * len_y;
127 box_ref.
vertices[1][2] = -0.5 * len_z;
129 box_ref.
vertices[2][0] = -0.5 * len_x;
130 box_ref.
vertices[2][1] = 0.5 * len_y;
131 box_ref.
vertices[2][2] = 0.5 * len_z;
133 box_ref.
vertices[3][0] = -0.5 * len_x;
134 box_ref.
vertices[3][1] = -0.5 * len_y;
135 box_ref.
vertices[3][2] = 0.5 * len_z;
137 box_ref.
vertices[4][0] = 0.5 * len_x;
138 box_ref.
vertices[4][1] = -0.5 * len_y;
139 box_ref.
vertices[4][2] = -0.5 * len_z;
141 box_ref.
vertices[5][0] = 0.5 * len_x;
142 box_ref.
vertices[5][1] = 0.5 * len_y;
143 box_ref.
vertices[5][2] = -0.5 * len_z;
145 box_ref.
vertices[6][0] = 0.5 * len_x;
146 box_ref.
vertices[6][1] = 0.5 * len_y;
147 box_ref.
vertices[6][2] = 0.5 * len_z;
149 box_ref.
vertices[7][0] = 0.5 * len_x;
150 box_ref.
vertices[7][1] = -0.5 * len_y;
151 box_ref.
vertices[7][2] = 0.5 * len_z;
193 box_ref.
facets[10][0] = 7;
194 box_ref.
facets[10][1] = 6;
195 box_ref.
facets[10][2] = 2;
197 box_ref.
facets[11][0] = 7;
198 box_ref.
facets[11][1] = 2;
199 box_ref.
facets[11][2] = 3;
A class for managing the elements in a DEM simulation. Scene behaves as a std container:
Definition scene.hpp:56
Shape * InsertShape(const Shape *const s_ptr)
Insert a single shape into this scene.
Definition scene.cpp:19
Wall * InsertWall(const Wall *const w_ptr)
Insert a single wall into this scene.
Definition scene.cpp:194
A class representing a triangular mesh in 3D space.
Definition shape_trimesh.hpp:23
void UpdateShapeProperties() override
Update the shape properties of the TriMesh object.
Definition shape_trimesh.cpp:158
VecXT< Vec3i > facets
The faces (triangles) of the triangular mesh.
Definition shape_trimesh.hpp:33
VecXT< Vec3d > vertices
The vertices of the triangular mesh.
Definition shape_trimesh.hpp:28
A class for generating a box of six walls with plates.
Definition gen_wall_box_plate.hpp:16
VecXT< Shape * > GetShapes()
Gets the list of shapes generated by the wall box.
Definition gen_wall_box_plate.hpp:60
void ImportToScene(Scene *scene)
Imports the shapes and walls generated by the wall box into a scene.
Definition gen_wall_box_plate.hpp:89
WallBoxPlate(double len_x, double len_y, double len_z, double center_x, double center_y, double center_z)
Generates a box of six walls with plates.
Definition gen_wall_box_plate.hpp:32
VecXT< Wall * > GetWall()
Gets the list of walls generated by the wall box.
Definition gen_wall_box_plate.hpp:73
A class representing a wall object in a physics simulation.
Definition wall.hpp:32
void SetShape(Shape *const shape)
Sets the shape of the wall.
Definition wall.cpp:27
void SetPosition(double pos_x, double pos_y, double pos_z)
Sets the position of the wall.
Definition wall.cpp:41
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31