From f0a70ddcec0f988ff9b751caaa4eba8593d39a2c Mon Sep 17 00:00:00 2001 From: karadaniz Date: Mon, 25 Mar 2024 16:16:09 +0100 Subject: [PATCH] [spns_40523]: extract only unique family names before using them in to iterate over cells --- src/MEDLoader/MeshFormatWriter.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MEDLoader/MeshFormatWriter.cxx b/src/MEDLoader/MeshFormatWriter.cxx index 447b84a22..a7c679d52 100644 --- a/src/MEDLoader/MeshFormatWriter.cxx +++ b/src/MEDLoader/MeshFormatWriter.cxx @@ -867,7 +867,8 @@ void MeshFormatWriter::linkFamilyToCells() int meshDimRelToMax = levs[iDim]; MEDCoupling::MCAuto< MEDCoupling::MEDCouplingMesh > mesh = _mesh->getMeshAtLevel( meshDimRelToMax); MEDCoupling::MCAuto< MEDCoupling::MEDCouplingUMesh > umesh0 = mesh->buildUnstructured(); - const MEDCoupling::DataArrayIdType * famIds = _mesh->getFamilyFieldAtLevel(meshDimRelToMax); + const MEDCoupling::DataArrayIdType * famIdsField = _mesh->getFamilyFieldAtLevel(meshDimRelToMax); + const MEDCoupling::DataArrayIdType * famIds = famIdsField->getDifferentValues(); const MEDCoupling::mcIdType * famID = famIds->begin(), *famIDEnd = famIds->end(); for (; famID < famIDEnd; ++famID) { -- 2.39.2