From f8c7a434ba8797c580c2fe4c532a4cbac580d309 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 24 Aug 2016 16:54:11 +0200 Subject: [PATCH] Porting to new API of MEDFileIntField --- src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx b/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx index 8fd42052..d268f5e4 100644 --- a/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx +++ b/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx @@ -60,6 +60,7 @@ #include "MEDFileField.hxx" #include "MEDFileData.hxx" #include "MEDCouplingMemArray.hxx" +#include "MEDCouplingFieldInt.hxx" #include "MEDCouplingFieldDouble.hxx" #include "MEDCouplingRefCountObject.hxx" @@ -86,6 +87,7 @@ using MEDCoupling::MEDCouplingMesh; using MEDCoupling::MEDCouplingUMesh; using MEDCoupling::MEDCouplingCMesh; using MEDCoupling::MEDCouplingFieldDouble; +using MEDCoupling::MEDCouplingFieldInt; using MEDCoupling::MCAuto; vtkStandardNewMacro(vtkMEDWriter); @@ -343,17 +345,21 @@ void AppendMCFieldFrom(MEDCoupling::TypeOfField tf, MEDCouplingMesh *mesh, MEDFi fieldName=daiPtr->getName(); if((fieldName!=FAMFIELD_FOR_CELLS || tf!=MEDCoupling::ON_CELLS) && (fieldName!=FAMFIELD_FOR_NODES || tf!=MEDCoupling::ON_NODES)) { - MCAuto f(MEDCouplingFieldDouble::New(tf)); + MCAuto f(MEDCouplingFieldInt::New(tf)); f->setName(fieldName); f->setMesh(mesh); MCAuto fmts(MEDFileIntFieldMultiTS::New()); MCAuto f1ts(MEDFileIntField1TS::New()); if(!n2oPtr) - f1ts->setFieldNoProfileSBT(f,daiPtr); + { + f->setArray(dai); + f1ts->setFieldNoProfileSBT(f); + } else { MCAuto dai2(daiPtr->selectByTupleId(n2oPtr->begin(),n2oPtr->end())); - f1ts->setFieldNoProfileSBT(f,dai2); + f->setArray(dai2); + f1ts->setFieldNoProfileSBT(f); } fmts->pushBackTimeStep(f1ts); fs->pushField(fmts); -- 2.39.2