Arcane  v4.1.2.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
AMRPatchPosition.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* AMRPatchPosition.h (C) 2000-2025 */
9/* */
10/* Position d'un patch AMR d'un maillage cartésien. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CARTESIANMESH_AMRPATCHPOSITION_H
13#define ARCANE_CARTESIANMESH_AMRPATCHPOSITION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/cartesianmesh/CartesianMeshGlobal.h"
18#include "arcane/utils/Vector3.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
50class ARCANE_CARTESIANMESH_EXPORT AMRPatchPosition
51{
52 public:
53
59 AMRPatchPosition(Int32 level, CartCoord3Type min_point, CartCoord3Type max_point, Int32 overlap_layer_size);
60
66 AMRPatchPosition& operator=(const AMRPatchPosition&) = default;
67
69
70 public:
71
76 Int32 level() const;
77
82 void setLevel(Int32 level);
83
90 CartCoord3Type minPoint() const;
91
97 void setMinPoint(CartCoord3Type min_point);
98
105 CartCoord3Type maxPoint() const;
106
112 void setMaxPoint(CartCoord3Type max_point);
113
120 Int32 overlapLayerSize() const;
121
127 void setOverlapLayerSize(Int32 layer_size);
128
134 CartCoord3Type minPointWithOverlap() const;
135
141 CartCoord3Type maxPointWithOverlap() const;
142
155 Int64 nbCells() const;
156
165 std::pair<AMRPatchPosition, AMRPatchPosition> cut(CartCoordType cut_point, Integer dim) const;
166
174 bool canBeFusion(const AMRPatchPosition& other_patch) const;
175
187 bool fusion(const AMRPatchPosition& other_patch);
188
196 bool isNull() const;
197
206
228
235 CartCoord3Type length() const;
236
250 bool isIn(CartCoordType x, CartCoordType y, CartCoordType z) const;
251
263 bool isIn(CartCoord3Type coord) const;
264
275 bool isInWithOverlap(CartCoordType x, CartCoordType y, CartCoordType z) const;
276
285 bool isInWithOverlap(CartCoord3Type coord) const;
286
298 bool isInWithOverlap(CartCoordType x, CartCoordType y, CartCoordType z, Integer overlap) const;
299
309 bool isInWithOverlap(CartCoord3Type coord, Integer overlap) const;
310
318 bool haveIntersection(const AMRPatchPosition& other) const;
319
320 private:
321
322 Int32 m_level;
323 CartCoord3Type m_min_point;
324 CartCoord3Type m_max_point;
325 Int32 m_overlap_layer_size;
326};
327
328/*---------------------------------------------------------------------------*/
329/*---------------------------------------------------------------------------*/
330
331} // End namespace Arcane
332
333/*---------------------------------------------------------------------------*/
334/*---------------------------------------------------------------------------*/
335
336#endif
337
CartCoord3Type minPointWithOverlap() const
Méthode permettant de récupérer la position min de la boite englobante en incluant la couche de maill...
CartCoord3Type length() const
Méthode permettant de connaitre la taille du patch (en nombre de mailles par direction).
void setMaxPoint(CartCoord3Type max_point)
Méthode permettant de définir la position max de la boite englobante.
bool canBeFusion(const AMRPatchPosition &other_patch) const
Méthode permettant de savoir si notre patch peut être fusionné avec other_patch.
AMRPatchPosition patchDown(Integer dim) const
Méthode permettant de créer un AMRPatchPosition pour le niveau inférieur.
AMRPatchPosition()
Constructeur pour une position nulle. Une position nulle est définie par un level = -2.
std::pair< AMRPatchPosition, AMRPatchPosition > cut(CartCoordType cut_point, Integer dim) const
Méthode permettant de découper le patch en deux patchs selon un point de découpe.
void setLevel(Int32 level)
Méthode permettant de définir le niveau du patch.
CartCoord3Type maxPoint() const
Méthode permettant de récupérer la position max de la boite englobante.
bool isNull() const
Méthode permettant de savoir si la position du patch est nulle.
void setMinPoint(CartCoord3Type min_point)
Méthode permettant de définir la position min de la boite englobante.
bool fusion(const AMRPatchPosition &other_patch)
Méthode permettant de fusionner other_patch avec le nôtre.
AMRPatchPosition patchUp(Integer dim) const
Méthode permettant de créer un AMRPatchPosition pour le niveau supérieur.
bool haveIntersection(const AMRPatchPosition &other) const
Méthode permettant de savoir si notre patch est en contact avec le patch other.
Int64 nbCells() const
Méthode permettant de connaitre le nombre de mailles du patch selon sa position.
Int32 overlapLayerSize() const
Méthode permettant de récupérer le nombre de couches de mailles de recouvrement du patch.
bool isIn(CartCoordType x, CartCoordType y, CartCoordType z) const
Méthode permettant de savoir si une maille de position x,y,z est incluse dans ce patch.
void setOverlapLayerSize(Int32 layer_size)
Méthode permettant de définir le nombre de couches de mailles de recouvrement du patch.
bool isInWithOverlap(CartCoordType x, CartCoordType y, CartCoordType z) const
Méthode permettant de savoir si une maille de position x,y,z est incluse dans ce patch avec couche de...
Int32 level() const
Méthode permettant de récupérer le niveau du patch.
CartCoord3Type maxPointWithOverlap() const
Méthode permettant de récupérer la position max de la boite englobante en incluant la couche de maill...
CartCoord3Type minPoint() const
Méthode permettant de récupérer la position min de la boite englobante.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.
Int32 Integer
Type représentant un entier.
std::int32_t Int32
Type entier signé sur 32 bits.