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~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=163037796ce3c270705878bdf1613f9ff21135be;p=tools%2Fmedcoupling.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); }