Arcane  v4.1.3.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
50class ARCANE_CARTESIANMESH_EXPORT AMRPatchPosition
51{
52 public:
53
59 AMRPatchPosition(Int32 level, CartCoord3 min_point, CartCoord3 max_point, Int32 overlap_layer_size);
60
66 AMRPatchPosition& operator=(const AMRPatchPosition&) = default;
67
69
70 public:
71
72 bool operator==(const AMRPatchPosition& other) const = default;
73
74 public:
75
80 Int32 level() const;
81
86 void setLevel(Int32 level);
87
94 CartCoord3 minPoint() const;
95
101 void setMinPoint(CartCoord3 min_point);
102
109 CartCoord3 maxPoint() const;
110
116 void setMaxPoint(CartCoord3 max_point);
117
124 Int32 overlapLayerSize() const;
125
131 void setOverlapLayerSize(Int32 layer_size);
132
139
146
159 Int64 nbCells() const;
160
169 std::pair<AMRPatchPosition, AMRPatchPosition> cut(CartCoord cut_point, Integer dim) const;
170
178 bool canBeFusion(const AMRPatchPosition& other_patch) const;
179
192 bool fusion(AMRPatchPosition& other_patch);
193
201 bool isNull() const;
202
213 AMRPatchPosition patchUp(Integer dim, Int32 higher_level, Int32 overlap_layer_size_top_level) const;
214
238 AMRPatchPosition patchDown(Integer dim, Int32 higher_level, Int32 overlap_layer_size_top_level) const;
239
246 CartCoord3 length() const;
247
261 bool isIn(CartCoord x, CartCoord y, CartCoord z) const;
262
274 bool isIn(CartCoord3 coord) const;
275
286 bool isInWithOverlap(CartCoord x, CartCoord y, CartCoord z) const;
287
296 bool isInWithOverlap(CartCoord3 coord) const;
297
309 bool isInWithOverlap(CartCoord x, CartCoord y, CartCoord z, Integer overlap) const;
310
320 bool isInWithOverlap(CartCoord3 coord, Integer overlap) const;
321
329 bool haveIntersection(const AMRPatchPosition& other) const;
330
342 static Int32 computeOverlapLayerSize(Int32 level, Int32 higher_level, Int32 overlap_layer_size_top_level);
343
352 void computeOverlapLayerSize(Int32 higher_level, Int32 overlap_layer_size_top_level);
353
354 private:
355
356 Int32 m_level;
357 CartCoord3 m_min_point;
358 CartCoord3 m_max_point;
359 Int32 m_overlap_layer_size;
360};
361
362/*---------------------------------------------------------------------------*/
363/*---------------------------------------------------------------------------*/
364
365} // End namespace Arcane
366
367/*---------------------------------------------------------------------------*/
368/*---------------------------------------------------------------------------*/
369
370#endif
371
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}.