Arcane  v4.1.4.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-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/* AMRPatchPosition.h (C) 2000-2026 */
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
51class ARCANE_CARTESIANMESH_EXPORT AMRPatchPosition
52{
53 public:
54
60 AMRPatchPosition(Int32 level, CartCoord3 min_point, CartCoord3 max_point, Int32 overlap_layer_size);
61
67 AMRPatchPosition& operator=(const AMRPatchPosition&) = default;
68
70
71 public:
72
73 bool operator==(const AMRPatchPosition& other) const = default;
74
75 public:
76
81 Int32 level() const;
82
87 void setLevel(Int32 level);
88
95 CartCoord3 minPoint() const;
96
102 void setMinPoint(CartCoord3 min_point);
103
110 CartCoord3 maxPoint() const;
111
117 void setMaxPoint(CartCoord3 max_point);
118
125 Int32 overlapLayerSize() const;
126
132 void setOverlapLayerSize(Int32 layer_size);
133
140
147
160 Int64 nbCells() const;
161
170 std::pair<AMRPatchPosition, AMRPatchPosition> cut(CartCoord cut_point, Integer dim) const;
171
179 bool canBeFusion(const AMRPatchPosition& other_patch) const;
180
193 bool fusion(AMRPatchPosition& other_patch);
194
202 bool isNull() const;
203
214 AMRPatchPosition patchUp(Integer dim, Int32 higher_level, Int32 overlap_layer_size_top_level) const;
215
239 AMRPatchPosition patchDown(Integer dim, Int32 higher_level, Int32 overlap_layer_size_top_level) const;
240
247 CartCoord3 length() const;
248
262 bool isIn(CartCoord x, CartCoord y, CartCoord z) const;
263
275 bool isIn(CartCoord3 coord) const;
276
287 bool isInWithOverlap(CartCoord x, CartCoord y, CartCoord z) const;
288
297 bool isInWithOverlap(CartCoord3 coord) const;
298
310 bool isInWithOverlap(CartCoord x, CartCoord y, CartCoord z, Integer overlap) const;
311
321 bool isInWithOverlap(CartCoord3 coord, Integer overlap) const;
322
330 bool haveIntersection(const AMRPatchPosition& other) const;
331
343 static Int32 computeOverlapLayerSize(Int32 level, Int32 higher_level, Int32 overlap_layer_size_top_level);
344
353 void computeOverlapLayerSize(Int32 higher_level, Int32 overlap_layer_size_top_level);
354
355 private:
356
357 Int32 m_level;
358 CartCoord3 m_min_point;
359 CartCoord3 m_max_point;
360 Int32 m_overlap_layer_size;
361};
362
363/*---------------------------------------------------------------------------*/
364/*---------------------------------------------------------------------------*/
365
366} // End namespace Arcane
367
368/*---------------------------------------------------------------------------*/
369/*---------------------------------------------------------------------------*/
370
371#endif
372
AMRPatchPosition patchUp(Integer dim, Int32 higher_level, Int32 overlap_layer_size_top_level) const
Méthode permettant de créer un AMRPatchPosition pour le niveau supérieur.
bool isInWithOverlap(CartCoord x, CartCoord y, CartCoord z) const
Méthode permettant de savoir si une maille de position x,y,z est incluse dans ce patch avec couche de...
CartCoord3 minPointWithOverlap() const
Méthode permettant de récupérer la position min de la boite englobante en incluant la couche de maill...
AMRPatchPosition patchDown(Integer dim, Int32 higher_level, Int32 overlap_layer_size_top_level) const
Méthode permettant de créer un AMRPatchPosition pour le niveau inférieur.
bool isIn(CartCoord x, CartCoord y, CartCoord z) const
Méthode permettant de savoir si une maille de position x,y,z est incluse dans ce patch.
bool canBeFusion(const AMRPatchPosition &other_patch) const
Méthode permettant de savoir si notre patch peut être fusionné avec other_patch.
static Int32 computeOverlapLayerSize(Int32 level, Int32 higher_level, Int32 overlap_layer_size_top_level)
Méthode permettant de calculer le nombre de couches de mailles de recouvrement pour un niveau donné.
bool fusion(AMRPatchPosition &other_patch)
Méthode permettant de fusionner other_patch avec le nôtre.
CartCoord3 minPoint() const
Méthode permettant de récupérer la position min de la boite englobante.
void setMinPoint(CartCoord3 min_point)
Méthode permettant de définir la position min de la boite englobante.
CartCoord3 length() const
Méthode permettant de connaitre la taille du patch (en nombre de mailles par direction).
AMRPatchPosition()
Constructeur pour une position nulle. Une position nulle est définie par un level = -2.
void setLevel(Int32 level)
Méthode permettant de définir le niveau du patch.
bool isNull() const
Méthode permettant de savoir si la position du patch est nulle.
CartCoord3 maxPointWithOverlap() const
Méthode permettant de récupérer la position max de la boite englobante en incluant la couche de maill...
CartCoord3 maxPoint() const
Méthode permettant de récupérer la position max de la boite englobante.
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.
void setOverlapLayerSize(Int32 layer_size)
Méthode permettant de définir le nombre de couches de mailles de recouvrement du patch.
Int32 level() const
Méthode permettant de récupérer le niveau du patch.
std::pair< AMRPatchPosition, AMRPatchPosition > cut(CartCoord cut_point, Integer dim) const
Méthode permettant de découper le patch en deux patchs selon un point de découpe.
void setMaxPoint(CartCoord3 max_point)
Méthode permettant de définir la position max de la boite englobante.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 CartCoord
Représente une coordonnée d'un élément dans la grille cartésienne (en X ou en Y ou en Z).
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.
Int32x3 CartCoord3
Représente les coordonnées 3D d'un élément dans la grille cartésienne {x, y, z}.