From 4d49d57d0982b36816f120eaa8bd46233e14a726 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Tue, 14 Feb 2017 10:52:11 +0100 Subject: [PATCH] Generalization of meshes without cells but only nodes --- src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx b/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx index 7adc0d57..69e1cba9 100644 --- a/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx +++ b/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx @@ -495,7 +495,14 @@ void AddNodeFields(MEDFileData *mfd, vtkDataSetAttributes *dsa) MEDFileUMesh *mmu(dynamic_cast(mm)); if(!mmu) throw MZCException("AddNodeFields : internal error 2 !"); - MCAuto mesh(mmu->getMeshAtLevel(0)); + MCAuto mesh; + if(!mmu->getNonEmptyLevels().empty()) + mesh=mmu->getMeshAtLevel(0); + else + { + mesh=MEDCouplingUMesh::Build0DMeshFromCoords(mmu->getCoords()); + mesh->setName(mmu->getName()); + } int nba(dsa->GetNumberOfArrays()); for(int i=0;igetMaxValue(dummy)); MCAuto levs(lev->getDifferentValues()); std::vector< MicroField > ms; vtkIdTypeArray *faces(ds->GetFaces()),*faceLoc(ds->GetFaceLocations()); -- 2.39.2