From b54e0f1a814039bfa7fddb3a30be4ab71b2e8812 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 Sep 2013 09:04:57 +0000 Subject: [PATCH] 22321: [CEA 933] Bug when reading a sauve file containing field on Gauss Pt Fix SauvWriter::makeProfileIDs() for a sole cell type and no profile --- src/MEDLoader/SauvWriter.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/MEDLoader/SauvWriter.cxx b/src/MEDLoader/SauvWriter.cxx index 0ff5777aa..697847bb6 100644 --- a/src/MEDLoader/SauvWriter.cxx +++ b/src/MEDLoader/SauvWriter.cxx @@ -578,7 +578,16 @@ void SauvWriter::makeProfileIDs( SubMesh* sm, vector idsPerType( 1, profile ); MEDCouplingAutoRefCountObjectPtr resIDs = uMesh->checkTypeConsistencyAndContig( code, idsPerType ); - ids.assign( resIDs->begin(), resIDs->end() ); + if (( const DataArrayInt *) resIDs ) + { + ids.assign( resIDs->begin(), resIDs->end() ); + } + else // mesh includes only one type + { + int nbE = code[1]; + for ( ids.resize( nbE ); nbE; --nbE ) + ids[ nbE-1 ] = nbE-1; + } } } -- 2.39.2