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)
{