14#include "arcane/cartesianmesh/internal/AMRPatchPositionLevelGroup.h"
16#include "arcane/cartesianmesh/AMRPatchPosition.h"
29AMRPatchPositionLevelGroup::
30AMRPatchPositionLevelGroup(
Int32 max_level)
31: m_max_level(max_level)
32, m_patches(max_level+1)
38AMRPatchPositionLevelGroup::
39~AMRPatchPositionLevelGroup()
45Int32 AMRPatchPositionLevelGroup::
54ConstArrayView<AMRPatchPosition> AMRPatchPositionLevelGroup::
57 return m_patches[level];
63void AMRPatchPositionLevelGroup::
64addPatch(
const AMRPatchPosition& patch)
66 m_patches[patch.level()].add(patch);
72void AMRPatchPositionLevelGroup::
73fusionPatches(
Int32 level)
81void AMRPatchPositionLevelGroup::
95 std::stable_sort(patch_position.
begin(), patch_position.
end(),
97 return a.nbCells() < b.nbCells();
100 for (
Integer p0 = 0; p0 < patch_position.
size(); ++p0) {
102 if (patch_fusion_0.
isNull())
105 for (
Integer p1 = p0 + 1; p1 < patch_position.
size(); ++p1) {
107 if (patch_fusion_1.
isNull())
123 if (patch_fusion_0.
fusion(patch_fusion_1)) {
136 for (
Integer i = 0; i < patch_position.
size(); ++i) {
137 if (patch_position[i].isNull()) {
void fusionPatches(Int32 level)
Méthode permettant de fusionner tous les patchs d'un certain niveau qui peuvent l'être.
Classe permettant de définir la position d'un patch dans le maillage cartésien.
bool fusion(AMRPatchPosition &other_patch)
Méthode permettant de fusionner other_patch avec le nôtre.
bool isNull() const
Méthode permettant de savoir si la position du patch est nulle.
Integer size() const
Nombre d'éléments du vecteur.
iterator end()
Itérateur sur le premier élément après la fin du tableau.
void remove(Int64 index)
Supprime l'entité ayant l'indice index.
iterator begin()
Itérateur sur le premier élément du tableau.
Vecteur 1D de données avec sémantique par valeur (style STL).
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
std::int32_t Int32
Type entier signé sur 32 bits.