Skip to content

Commit

Permalink
[arcane,mesh] Lors du raffinement, force le recalcul des constituants…
Browse files Browse the repository at this point in the history
… avant de mettre à jour les mailles fantômes.

Sans cela, l'appel à 'IMeshModifier::updateGhostLayerFromParent()' est
fait alors que les matériaux ne sont pas à jour ce qui peut provoquer
des plantages.
  • Loading branch information
grospelliergilles committed Dec 3, 2024
1 parent 2cacd83 commit 304d069
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions arcane/src/arcane/mesh/MeshRefinement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
#include "arcane/core/ItemRefinementPattern.h"
#include "arcane/core/Properties.h"
#include "arcane/core/IGhostLayerMng.h"
#include "arcane/core/ItemVector.h"

#include "arcane/mesh/DynamicMesh.h"
#include "arcane/mesh/ItemRefinement.h"
#include "arcane/mesh/MeshRefinement.h"

#include "arcane/mesh/ParallelAMRConsistency.h"
#include "arcane/mesh/FaceReorienter.h"

#include "arcane/mesh/NodeFamily.h"
#include "arcane/mesh/EdgeFamily.h"
#include "arcane/core/ItemVector.h"

#include "arcane/core/materials/IMeshMaterialMng.h"

#include <vector>

Expand Down Expand Up @@ -739,6 +739,14 @@ coarsenItemsV2(bool update_parent_flag)
UniqueArray<Int64> ghost_cell_to_refine;
UniqueArray<Int64> ghost_cell_to_coarsen;

if (!update_parent_flag) {
// Si les matériaux sont actifs, il faut forcer un recalcul des matériaux car les groupes
// de mailles ont été modifiés et donc la liste des constituants aussi
Materials::IMeshMaterialMng* mm = Materials::IMeshMaterialMng::getReference(m_mesh, false);
if (mm)
mm->forceRecompute();

Check warning on line 747 in arcane/src/arcane/mesh/MeshRefinement.cc

View check run for this annotation

Codecov / codecov/patch

arcane/src/arcane/mesh/MeshRefinement.cc#L747

Added line #L747 was not covered by tests
}

m_mesh->modifier()->updateGhostLayerFromParent(ghost_cell_to_refine, ghost_cell_to_coarsen, true);

return m_mesh->parallelMng()->reduce(Parallel::ReduceMax, (!to_coarse.empty()));
Expand Down

0 comments on commit 304d069

Please sign in to comment.