From 0408fb771e9b2d93672c80d3fe7b1ec715eddf38 Mon Sep 17 00:00:00 2001 From: abn Date: Wed, 16 Sep 2015 17:00:45 +0200 Subject: [PATCH] buildInnerBoundaryAlongM1Group(): family ID creation was buggy. --- src/MEDLoader/MEDFileMesh.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index b77e3416d..d94dda94b 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -3650,7 +3650,13 @@ void MEDFileUMesh::buildInnerBoundaryAlongM1Group(const std::string& grpNameM1, throw INTERP_KERNEL::Exception("MEDFileUMesh::buildInnerBoundaryAlongM1Group : internal problem !"); MEDCouplingAutoRefCountObjectPtr newFam=DataArrayInt::New(); newFam->alloc(newm1->getNumberOfCells(),1); - int idd=getMaxFamilyId()+1; + // Get a new family ID: care must be taken if we need a positive ID or a negative one: + // Positive ID for family of nodes, negative for all the rest. + int idd; + if (m1->getMeshDimension() == 0) + idd=getMaxFamilyId()+1; + else + idd=getMinFamilyId()-1; int globStart=0,start=0,end,globEnd; int nbOfChunks=szOfCellGrpOfSameType->getNumberOfTuples(); for(int i=0;i