From 52a25e319a0985323cd5f51e24f73a698f8e10a3 Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 12 Apr 2010 12:38:34 +0000 Subject: [PATCH] *** empty log message *** --- src/MEDLoader/MEDLoader.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index 5d3be43c3..f3209e176 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -1253,6 +1253,12 @@ void MEDLoaderNS::prepareCellFieldDoubleForWriting(const ParaMEDMEM::MEDCoupling void MEDLoaderNS::writeFieldAndMeshDirectly(const char *fileName, ParaMEDMEM::MEDCouplingFieldDouble *f, bool forceFromScratch) { + std::string meshName(f->getMesh()->getName()); + if(meshName.empty()) + throw INTERP_KERNEL::Exception("Trying to write a mesh (f->getMesh()) with no name ! MED file format needs a not empty mesh name !"); + std::string fieldName(f->getName()); + if(fieldName.empty()) + throw INTERP_KERNEL::Exception("Trying to write a field with no name ! MED file format needs a not empty field name !"); MEDCouplingUMesh *mesh=dynamic_cast((MEDCouplingMesh *)f->getMesh()); writeUMeshDirectly(fileName,mesh,forceFromScratch); appendFieldDirectly(fileName,f); @@ -1260,6 +1266,9 @@ void MEDLoaderNS::writeFieldAndMeshDirectly(const char *fileName, ParaMEDMEM::ME void MEDLoader::WriteUMesh(const char *fileName, ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) { + std::string meshName(mesh->getName()); + if(meshName.empty()) + throw INTERP_KERNEL::Exception("Trying to write a unstructured mesh with no name ! MED file format needs a not empty mesh name !"); int status=MEDLoaderBase::getStatusOfFile(fileName); if(status!=MEDLoaderBase::EXIST_RW && status!=MEDLoaderBase::NOT_EXIST) { @@ -1293,7 +1302,6 @@ void MEDLoader::WriteUMesh(const char *fileName, ParaMEDMEM::MEDCouplingUMesh *m void MEDLoader::WriteField(const char *fileName, ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) { - f->checkCoherency(); int status=MEDLoaderBase::getStatusOfFile(fileName); if(status!=MEDLoaderBase::EXIST_RW && status!=MEDLoaderBase::NOT_EXIST) { -- 2.39.2