Arcane  v4.1.1.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
65 AMRPatchPosition& operator=(const AMRPatchPosition&) = default;
66
68
69 public:
70
75 Integer level() const;
76
82
89 Int64x3 minPoint() const;
90
96 void setMinPoint(Int64x3 min_point);
97
104 Int64x3 maxPoint() const;
105
111 void setMaxPoint(Int64x3 max_point);
112
120
126 void setOverlapLayerSize(Integer layer_size);
127
133 Int64x3 minPointWithOverlap() const;
134
140 Int64x3 maxPointWithOverlap() const;
141
154 Int64 nbCells() const;
155
164 std::pair<AMRPatchPosition, AMRPatchPosition> cut(Int64 cut_point, Integer dim) const;
165
173 bool canBeFusion(const AMRPatchPosition& other_patch) const;
174
186 bool fusion(const AMRPatchPosition& other_patch);
187
195 bool isNull() const;
196
205
227
234 Int64x3 length() const;
235
249 bool isIn(Int64 x, Int64 y, Int64 z) const;
250
261 bool isInWithOverlap(Int64 x, Int64 y, Int64 z) const;
262
273 bool isInWithOverlap(Int64 x, Int64 y, Int64 z, Integer overlap) const;
274
282 bool haveIntersection(const AMRPatchPosition& other) const;
283
284 private:
285
286 Integer m_level;
287 Int64x3 m_min_point;
288 Int64x3 m_max_point;
289 Integer m_overlap_layer_size;
290};
291
292/*---------------------------------------------------------------------------*/
293/*---------------------------------------------------------------------------*/
294
295} // End namespace Arcane
296
297/*---------------------------------------------------------------------------*/
298/*---------------------------------------------------------------------------*/
299
300#endif
301
bool isIn(Int64 x, Int64 y, Int64 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.
Int64x3 maxPointWithOverlap() const
Méthode permettant de récupérer la position max de la boite englobante en incluant la couche de maill...
void setOverlapLayerSize(Integer layer_size)
Méthode permettant de définir le nombre de couches de mailles de recouvrement du patch.
AMRPatchPosition patchDown(Integer dim) const
Méthode permettant de créer un AMRPatchPosition pour le niveau inférieur.
Int64x3 minPoint() const
Méthode permettant de récupérer la position min de la boite englobante.
void setLevel(Integer level)
Méthode permettant de définir le niveau du patch.
Int64x3 maxPoint() const
Méthode permettant de récupérer la position max de la boite englobante.
AMRPatchPosition()
Constructeur pour une position nulle. Une position nulle est définie par un level = -2.
bool isNull() const
Méthode permettant de savoir si la position du patch est nulle.
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.
Int64x3 minPointWithOverlap() const
Méthode permettant de récupérer la position min de la boite englobante en incluant la couche de maill...
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.
void setMinPoint(Int64x3 min_point)
Méthode permettant de définir la position min de la boite englobante.
Int64x3 length() const
Méthode permettant de connaitre la taille du patch (en nombre de mailles par direction).
std::pair< AMRPatchPosition, AMRPatchPosition > cut(Int64 cut_point, Integer dim) const
Méthode permettant de découper le patch en deux patchs selon un point de découpe.
void setMaxPoint(Int64x3 max_point)
Méthode permettant de définir la position max de la boite englobante.
Integer overlapLayerSize() const
Méthode permettant de récupérer le nombre de couches de mailles de recouvrement du patch.
bool isInWithOverlap(Int64 x, Int64 y, Int64 z) const
Méthode permettant de savoir si une maille de position x,y,z est incluse dans ce patch avec couche de...
Integer level() const
Méthode permettant de récupérer le niveau du patch.
-*- 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.