From: ageay Date: Wed, 15 Jan 2014 15:46:38 +0000 (+0000) Subject: MEDLoader.WriteFieldUsingAlreadyWrittenMesh works with mesh not unstructured. X-Git-Tag: V7_3_1b1^2~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b0bdaaec5ec5135b021521f8f5d01f3eef4be826;p=modules%2Fmed.git MEDLoader.WriteFieldUsingAlreadyWrittenMesh works with mesh not unstructured. --- diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index 75c9acc1a..802903ef2 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -1597,12 +1597,15 @@ void MEDLoader::WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const Pa } MEDCouplingAutoRefCountObjectPtr f1ts(MEDFileField1TS::New()); AssignStaticWritePropertiesTo(*f1ts); - MEDCouplingUMesh *m=dynamic_cast(const_cast(f->getMesh())); - if(!m) - throw INTERP_KERNEL::Exception("MEDLoader::WriteFieldUsingAlreadyWrittenMesh : only umesh in input field supported !"); - MEDCouplingAutoRefCountObjectPtr o2n=m->getRenumArrForMEDFileFrmt(); - MEDCouplingAutoRefCountObjectPtr f2(f->deepCpy()); - f2->renumberCells(o2n->begin(),false); - f1ts->setFieldNoProfileSBT(f2); + MEDCouplingUMesh *m(dynamic_cast(const_cast(f->getMesh()))); + if(m) + { + MEDCouplingAutoRefCountObjectPtr o2n(m->getRenumArrForMEDFileFrmt()); + MEDCouplingAutoRefCountObjectPtr f2(f->deepCpy()); + f2->renumberCells(o2n->begin(),false); + f1ts->setFieldNoProfileSBT(f2); + } + else + f1ts->setFieldNoProfileSBT(f); f1ts->write(fileName,0); }