13#include "arcane/cartesianmesh/AMRZonePosition.h"
15#include "arcane/utils/FixedArray.h"
16#include "arcane/utils/ITraceMng.h"
18#include "arcane/core/IMesh.h"
19#include "arcane/core/MeshKind.h"
20#include "arcane/core/IParallelMng.h"
22#include "arcane/cartesianmesh/AMRPatchPosition.h"
23#include "arcane/cartesianmesh/ICartesianMesh.h"
25#include "arcane/cartesianmesh/internal/ICartesianMeshInternal.h"
42 Real3 min_pos = m_position;
43 Real3 max_pos = min_pos + m_length;
45 cells_local_id.
clear();
50 center += nodes_coord[node];
52 bool is_inside_x = center.
x > min_pos.
x && center.
x < max_pos.
x;
53 bool is_inside_y = center.
y > min_pos.
y && center.
y < max_pos.
y;
54 bool is_inside_z = (center.
z > min_pos.
z && center.
z < max_pos.
z) || !m_is_3d;
55 if (is_inside_x && is_inside_y && is_inside_z) {
58 cells_local_id.
add(icell.itemLocalId());
73 auto numbering =
mesh->_internalApi()->cartesianMeshNumberingMngInternal();
76 min_n_max[0] = INT32_MAX;
77 min_n_max[1] = INT32_MAX;
78 min_n_max[2] = INT32_MAX;
89 Real3 min_pos = m_position;
90 Real3 max_pos = min_pos + m_length;
92 cells_local_id.
clear();
108 center += nodes_coord[node];
110 bool is_inside_x = center.
x > min_pos.
x && center.
x < max_pos.
x;
111 bool is_inside_y = center.
y > min_pos.
y && center.
y < max_pos.
y;
112 bool is_inside_z = (center.
z > min_pos.
z && center.
z < max_pos.
z) || !m_is_3d;
113 if (is_inside_x && is_inside_y && is_inside_z) {
115 level = cell.
level();
116 else if (level != cell.
level())
117 ARCANE_FATAL(
"Level pb -- Level recorded before : {0} -- Cell Level : {1} -- CellUID : {2}", level, cell.
level(), cell.
uniqueId());
118 cells_local_id.
add(icell.itemLocalId());
123 CartCoord3 pos = numbering->cellUniqueIdToCoord(cell);
145 if (level != -1 && level != level_r) {
155 if (nb_cells != nb_cells_patch) {
175 auto numbering =
mesh->_internalApi()->cartesianMeshNumberingMngInternal();
178 min_n_max[0] = INT32_MAX;
179 min_n_max[1] = INT32_MAX;
180 min_n_max[2] = INT32_MAX;
191 const Real3 min_pos = m_position;
192 const Real3 max_pos = min_pos + m_length;
194 Int64 d_cell_level = -1;
210 center += nodes_coord[node];
212 bool is_inside_x = center.
x > min_pos.
x && center.
x < max_pos.
x;
213 bool is_inside_y = center.
y > min_pos.
y && center.
y < max_pos.
y;
214 bool is_inside_z = (center.
z > min_pos.
z && center.
z < max_pos.
z) || !m_is_3d;
215 if (is_inside_x && is_inside_y && is_inside_z) {
217 level = cell.
level();
220 else if (level != cell.
level())
221 ARCANE_FATAL(
"Level pb -- Level recorded before : {0} -- CellUID before : {1} -- Cell Level : {2} -- CellUID : {3}", level, d_cell_level, cell.
level(), cell.
uniqueId());
226 const CartCoord3 pos = numbering->cellUniqueIdToCoord(cell);
248 if (level != -1 && level != level_r) {
259 if (nb_cells != nb_cells_patch) {
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Class allowing the definition of a patch position in the Cartesian mesh.
void cellsInPatch(IMesh *mesh, UniqueArray< Int32 > &cells_local_id) const
Method allowing retrieval of the cells included in the zone.
Real3 position() const
Method allowing retrieval of the zone's position.
AMRPatchPosition toAMRPatchPosition(ICartesianMesh *mesh) const
Method allowing conversion of this AMRZonePosition into AMRPatchPosition.
Modifiable view of an array of type T.
void clear()
Removes the elements from the array.
void add(ConstReferenceType val)
Adds element val to the end of the array.
Cell hChild(Int32 i) const
i-th AMR child
bool hasHChildren() const
constexpr __host__ __device__ ArrayView< T > view()
Modifiable view of the array.
Interface of a Cartesian mesh.
@ II_InPatch
[AMR Patch] The entity is marked as being in an AMR patch.
NodeConnectedListViewType nodes() const
List of nodes of the entity.
Int32 nbNode() const
Number of nodes of the entity.
constexpr bool hasFlags(Int32 flags) const
Returns if the flags are set for the entity.
ItemUniqueId uniqueId() const
Unique identifier across all domains.
Class managing a 3-dimensional real vector.
1D data vector with value semantics (STL style).
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Coordinate type quantity at node.
@ ReduceSum
Sum of values.
@ ReduceMin
Minimum of values.
@ ReduceMax
Maximum of values.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
@ PatchCartesianMeshOnly
The mesh is AMR by Cartesian patch (rectangular).
std::int32_t Int32
Signed integer type of 32 bits.
Int32x3 CartCoord3
Represents the 3D coordinates of an element in the Cartesian grid {x, y, z}.
Real y
second component of the triplet
Real z
third component of the triplet
Real x
first component of the triplet