Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
CartesianMeshPatch.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* CartesianMeshPatch.h (C) 2000-2026 */
9/* */
10/* Information about an AMR patch of a Cartesian mesh. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CARTESIANMESH_CARTESIANMESHPATCH_H
13#define ARCANE_CARTESIANMESH_CARTESIANMESHPATCH_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/cartesianmesh/internal/ICartesianMeshPatchInternal.h"
18#include "arcane/utils/TraceAccessor.h"
19
21#include "arcane/core/VariableTypes.h"
22
23#include "arcane/cartesianmesh/ICartesianMeshPatch.h"
24#include "arcane/cartesianmesh/CellDirectionMng.h"
25#include "arcane/cartesianmesh/FaceDirectionMng.h"
26#include "arcane/cartesianmesh/NodeDirectionMng.h"
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Arcane
32{
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
45class CartesianMeshPatch
46: public TraceAccessor
48{
49 friend CartesianMeshImpl;
50
51 class Impl
53 {
54 public:
55
56 explicit Impl(CartesianMeshPatch* m_patch)
57 : m_patch(m_patch)
58 {}
59 AMRPatchPosition& positionRef() override
60 {
61 return m_patch->m_position;
62 }
63 void setPosition(const AMRPatchPosition& position) override
64 {
65 m_patch->m_position = position;
66 }
67
68 private:
69
70 CartesianMeshPatch* m_patch;
71 };
72
73 public:
74
75 CartesianMeshPatch(ICartesianMesh* cmesh, Integer patch_index);
76 CartesianMeshPatch(ICartesianMesh* cmesh, Integer patch_index, const AMRPatchPosition& position);
77 ~CartesianMeshPatch() override;
78
79 public:
80
81 CellGroup cells() override;
82 CellGroup inPatchCells() override;
83 CellGroup overlapCells() override;
84 Integer index() override
85 {
86 return m_amr_patch_index;
87 }
89 {
90 return m_cell_directions[dir];
91 }
92
94 {
95 return m_cell_directions[idir];
96 }
97
99 {
100 return m_face_directions[dir];
101 }
102
104 {
105 return m_face_directions[idir];
106 }
107
109 {
110 return m_node_directions[dir];
111 }
112
114 {
115 return m_node_directions[idir];
116 }
117 void checkValid() const override;
118
119 AMRPatchPosition position() const override
120 {
121 return m_position;
122 }
123
124 ICartesianMeshPatchInternal* _internalApi() override
125 {
126 return &m_impl;
127 }
128
129 private:
130
131 void _internalComputeNodeCellInformations(Cell cell0, Real3 cell0_coord, VariableNodeReal3& nodes_coord);
132 void _internalComputeNodeCellInformations();
133 void _computeNodeCellInformations2D(Cell cell0, Real3 cell0_coord, VariableNodeReal3& nodes_coord);
134 void _computeNodeCellInformations3D(Cell cell0, Real3 cell0_coord, VariableNodeReal3& nodes_coord);
135
136 private:
137
138 ICartesianMesh* m_mesh;
139 AMRPatchPosition m_position;
140 CellDirectionMng m_cell_directions[3];
141 FaceDirectionMng m_face_directions[3];
142 NodeDirectionMng m_node_directions[3];
143 Integer m_amr_patch_index;
144 Impl m_impl;
145};
146
147/*---------------------------------------------------------------------------*/
148/*---------------------------------------------------------------------------*/
149
150} // End namespace Arcane
151
152/*---------------------------------------------------------------------------*/
153/*---------------------------------------------------------------------------*/
154
155#endif
Declarations of types on entities.
Class allowing the definition of a patch position in the Cartesian mesh.
FaceDirectionMng & faceDirection(Integer idir) override
List of faces in direction dir (0, 1 or 2).
Integer index() override
TODO.
FaceDirectionMng & faceDirection(eMeshDirection dir) override
List of faces in direction dir.
NodeDirectionMng & nodeDirection(Integer idir) override
List of nodes in direction dir (0, 1 or 2).
void checkValid() const override
Performs checks on the validity of the instance.
CellDirectionMng & cellDirection(eMeshDirection dir) override
List of cells in direction dir.
NodeDirectionMng & nodeDirection(eMeshDirection dir) override
List of nodes in direction dir.
CellGroup cells() override
Cell group of the patch.
CellDirectionMng & cellDirection(Integer idir) override
List of cells in direction dir (0, 1 or 2).
Info about the cells in a specific X, Y, or Z direction of a structured mesh.
Info on the faces of a specific direction X, Y, or Z of a structured mesh.
Interface of an AMR patch of a Cartesian mesh.
Info about nodes in a specific direction X, Y, or Z of a structured mesh.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
ItemGroupT< Cell > CellGroup
Group of cells.
Definition ItemTypes.h:184
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Coordinate type quantity at node.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
eMeshDirection
Direction type for a structured mesh.
@ Cell
The mesh is AMR by cell.
Definition MeshKind.h:53