49 friend mesh::DynamicMeshCartesian2DBuilder;
50 friend mesh::DynamicMeshCartesian3DBuilder;
51 friend mesh::CartesianFaceUniqueIdBuilder;
52 friend class CartesianMeshUniqueIdRenumbering;
62 class NodeUniqueIdComputer2D
73 Int64 compute(Int64 x, Int64 y)
75 return m_base_offset + x + y * m_nb_node_x;
78 std::array<Int64, 4> computeForCell(Int64 x, Int64 y)
98 class CellUniqueIdComputer2D
109 Int64 compute(Int64 x, Int64 y)
111 return m_base_offset + x + y * m_all_nb_cell_x;
116 const Int64 y =
uid / m_all_nb_cell_x;
117 const Int64 x =
uid % m_all_nb_cell_x;
124 Int64 m_all_nb_cell_x;
131 class FaceUniqueIdComputer2D
145 std::array<Int64, 4> computeForCell(Int64 x, Int64 y)
150 face_uids[0] = m_base_offset + (x + 0) + ((y + 0) * m_nb_cell_x) + m_nb_face_dir_x;
151 face_uids[2] = m_base_offset + (x + 0) + ((y + 1) * m_nb_cell_x) + m_nb_face_dir_x;
154 face_uids[1] = m_base_offset + (x + 1) + (y + 0) * m_nb_face_x;
155 face_uids[3] = m_base_offset + (x + 0) + (y + 0) * m_nb_face_x;
165 Int64 m_nb_face_dir_x;
172 class NodeUniqueIdComputer3D
184 Int64 compute(Int64 x, Int64 y, Int64 z)
186 return m_base_offset + x + y * m_nb_node_x + z * m_nb_node_xy;
189 std::array<Int64, 8> computeForCell(Int64 x, Int64 y, Int64 z)
192 node_uids[0] = compute(x + 0, y + 0, z + 0);
193 node_uids[1] = compute(x + 1, y + 0, z + 0);
194 node_uids[2] = compute(x + 1, y + 1, z + 0);
195 node_uids[3] = compute(x + 0, y + 1, z + 0);
196 node_uids[4] = compute(x + 0, y + 0, z + 1);
197 node_uids[5] = compute(x + 1, y + 0, z + 1);
198 node_uids[6] = compute(x + 1, y + 1, z + 1);
199 node_uids[7] = compute(x + 0, y + 1, z + 1);
214 class CellUniqueIdComputer3D
227 Int64 compute(Int64 x, Int64 y, Int64 z)
229 return m_base_offset + x + y * m_all_nb_cell_x + z * m_all_nb_cell_xy;
235 Int64 z =
uid / m_all_nb_cell_xy;
236 Int64 v =
uid - (z * m_all_nb_cell_xy);
237 Int64 y = v / m_all_nb_cell_x;
238 Int64 x = v % m_all_nb_cell_x;
245 Int64 m_all_nb_cell_x;
246 Int64 m_all_nb_cell_xy;
253 class FaceUniqueIdComputer3D
270 std::array<Int64, 6> computeForCell(Int64 x, Int64 y, Int64 z)
275 face_uids[0] = (x + 0) + ((y + 0) * m_nb_cell_x) + ((z + 0) * m_nb_face_dir.z) + m_total_nb_face_xy;
276 face_uids[3] = (x + 0) + ((y + 0) * m_nb_cell_x) + ((z + 1) * m_nb_face_dir.z) + m_total_nb_face_xy;
279 face_uids[1] = (x + 0) + ((y + 0) * m_nb_face_x) + ((z + 0) * m_nb_face_dir.x);
280 face_uids[4] = (x + 1) + ((y + 0) * m_nb_face_x) + ((z + 0) * m_nb_face_dir.x);
283 face_uids[2] = (x + 0) + ((y + 0) * m_nb_cell_x) + ((z + 0) * m_nb_face_dir.y) + m_total_nb_face_x;
284 face_uids[5] = (x + 0) + ((y + 1) * m_nb_cell_x) + ((z + 0) * m_nb_face_dir.y) + m_total_nb_face_x;
286 for (Int32 i = 0; i < 6; ++i)
298 Int64 m_total_nb_face_xy;
299 Int64 m_total_nb_face_x;
338 NodeUniqueIdComputer2D getNodeComputer2D(Int64 offset)
const
340 return { offset, m_nb_node.x };
343 NodeUniqueIdComputer3D getNodeComputer3D(Int64 offset)
const
345 return { offset, m_nb_node.x, m_nb_node.x * m_nb_node.y };
348 CellUniqueIdComputer2D getCellComputer2D(Int64 offset)
const
350 return { offset, m_nb_cell.x };
353 CellUniqueIdComputer3D getCellComputer3D(Int64 offset)
const
355 return { offset, m_nb_cell.x, m_nb_cell.x * m_nb_cell.y };
358 FaceUniqueIdComputer2D getFaceComputer2D(Int64 offset)
const
360 Int64x3 nb_face_dir = nbFaceParallelToDirection();
361 return { offset, m_nb_cell.x, m_nb_face.x, nb_face_dir.x };
364 FaceUniqueIdComputer3D getFaceComputer3D(Int64 offset)
const
366 Int64x3 nb_face_dir = nbFaceParallelToDirection();
367 Int64 total_nb_face_xy = (nb_face_dir.x + nb_face_dir.y) * m_nb_cell.z;
368 Int64 total_nb_face_x = (nb_face_dir.x * m_nb_cell.z);
369 return { offset, m_nb_cell.x, m_nb_face.x, nb_face_dir, total_nb_face_xy, total_nb_face_x };
381 Int64x3 m_nb_face_oriented;
383 Int64 m_nb_cell_xy = 0;
384 Int64 m_total_nb_cell = 0;