From eb4b9a0f16f682485df7baf6c2eb5fed34c988f4 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 20 Feb 2017 08:49:25 +0100 Subject: [PATCH] [EDF7075] : Mixed Classical and structure elements --- src/MEDCoupling/MEDCouplingMemArray.hxx | 7 +- src/MEDCoupling/MEDCouplingMemArray.txx | 36 +++++ .../MEDCouplingBasicsTest5.py | 8 +- src/MEDCoupling_Swig/MEDCouplingCommon.i | 111 --------------- src/MEDCoupling_Swig/MEDCouplingMemArray.i | 130 ++++++++++++++++++ src/MEDLoader/MEDFileBlowStrEltUp.cxx | 25 +++- 6 files changed, 196 insertions(+), 121 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index aea13c23d..3dabb9e26 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -43,6 +43,8 @@ namespace MEDCoupling } MEDCouplingAxisType; // -- WARNING this enum must be synchronized with MEDCouplingCommon.i file ! -- + class PartDefinition; + template class MEDCouplingPointer { @@ -261,6 +263,7 @@ namespace MEDCoupling typename Traits::ArrayType *renumberAndReduce(const int *old2New, int newNbOfTuple) const; typename Traits::ArrayType *changeNbOfComponents(int newNbOfComp, T dftValue) const; typename Traits::ArrayType *subArray(int tupleIdBg, int tupleIdEnd=-1) const; + MCAuto::ArrayTypeCh> selectPartDef(const PartDefinition* pd) const; void circularPermutation(int nbOfShift=1); void circularPermutationPerTuple(int nbOfShift=1); void reversePerTuple(); @@ -331,7 +334,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } MEDCOUPLING_EXPORT DataArrayDouble *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafeSlice(int bg, int end2, int step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } - MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } + MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } MEDCOUPLING_EXPORT void meldWith(const DataArrayDouble *other); MEDCOUPLING_EXPORT bool areIncludedInMe(const DataArrayDouble *other, double prec, DataArrayInt *&tupleIds) const; MEDCOUPLING_EXPORT void findCommonTuples(double prec, int limitTupleId, DataArrayInt *&comm, DataArrayInt *&commIndex) const; @@ -536,7 +539,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT DataArrayInt *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const { return DataArrayTemplate::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); } MEDCOUPLING_EXPORT DataArrayInt *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } MEDCOUPLING_EXPORT DataArrayInt *selectByTupleIdSafeSlice(int bg, int end, int step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end,step); } - MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } + MEDCOUPLING_EXPORT DataArrayInt *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } MEDCOUPLING_EXPORT DataArrayInt *checkAndPreparePermutation() const; MEDCOUPLING_EXPORT static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2); MEDCOUPLING_EXPORT void changeSurjectiveFormat(int targetNb, DataArrayInt *&arr, DataArrayInt *&arrI) const; diff --git a/src/MEDCoupling/MEDCouplingMemArray.txx b/src/MEDCoupling/MEDCouplingMemArray.txx index cbf43aecd..5df4f7150 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.txx +++ b/src/MEDCoupling/MEDCouplingMemArray.txx @@ -25,6 +25,7 @@ #include "NormalizedUnstructuredMesh.hxx" #include "InterpKernelException.hxx" #include "InterpolationUtils.hxx" +#include "MEDCouplingPartDefinition.hxx" #include "InterpKernelAutoPtr.hxx" #include "MCAuto.hxx" @@ -1048,6 +1049,41 @@ namespace MEDCoupling { return DataArrayTemplate::mySelectByTupleId(di.begin(),di.end()); } + + template + MCAuto::ArrayTypeCh> DataArrayTemplate::selectPartDef(const PartDefinition *pd) const + { + if(!pd) + throw INTERP_KERNEL::Exception("DataArrayTemplate::selectPartDef : null input pointer !"); + MCAuto::ArrayTypeCh> ret(Traits::ArrayTypeCh::New()); + const SlicePartDefinition *spd(dynamic_cast(pd)); + if(spd) + { + int a,b,c; + spd->getSlice(a,b,c); + if(a==0 && b==getNumberOfTuples() && c==1) + { + DataArrayTemplate *directRet(const_cast *>(this)); + directRet->incrRef(); + MCAuto > ret(directRet); + return DynamicCastSafe,typename Traits::ArrayTypeCh>(ret); + } + else + { + MCAuto ret(selectByTupleIdSafeSlice(a,b,c)); + return DynamicCastSafe::ArrayTypeCh>(ret); + } + } + const DataArrayPartDefinition *dpd(dynamic_cast(pd)); + if(dpd) + { + MCAuto arr(dpd->toDAI()); + MCAuto ret(selectByTupleIdSafe(arr->begin(),arr->end())); + return DynamicCastSafe::ArrayTypeCh>(ret); + + } + throw INTERP_KERNEL::Exception("DataArrayTemplate::selectPartDef : unrecognized part def !"); + } /*! * Returns a shorten and permuted copy of \a this array. The new DataArrayDouble is diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py index 4bbfe6087..0a85ee51b 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py @@ -4138,19 +4138,19 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertEqual( 0, sla0.getLength() ) sla0.set( index, value ) self.assertTrue( index.isEqual( sla0.getIndexArray() )) - self.assertTrue( value.isEqual( sla0.getValueArray() )) + self.assertTrue( value.isEqual( sla0.getValuesArray() )) self.assertEqual( 4, sla0.getNumberOf() ) self.assertEqual( 6, sla0.getLength() ) sla1 = MEDCouplingSkyLineArray( index, value ) self.assertTrue( index.isEqual( sla1.getIndexArray() )) - self.assertTrue( value.isEqual( sla1.getValueArray() )) + self.assertTrue( value.isEqual( sla1.getValuesArray() )) self.assertEqual( 4, sla1.getNumberOf() ) self.assertEqual( 6, sla1.getLength() ) sla2 = MEDCouplingSkyLineArray( sla1 ) self.assertTrue( index.isEqual( sla2.getIndexArray() )) - self.assertTrue( value.isEqual( sla2.getValueArray() )) + self.assertTrue( value.isEqual( sla2.getValuesArray() )) self.assertEqual( 4, sla2.getNumberOf() ) self.assertEqual( 6, sla2.getLength() ) @@ -4160,7 +4160,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase): for i in value: valueVec.push_back( i[0] ) sla3 = MEDCouplingSkyLineArray( indexVec, valueVec ) self.assertTrue( index.isEqual( sla3.getIndexArray() )) - self.assertTrue( value.isEqual( sla3.getValueArray() )) + self.assertTrue( value.isEqual( sla3.getValuesArray() )) self.assertEqual( 4, sla3.getNumberOf() ) self.assertEqual( 6, sla3.getLength() ) diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index 90c5511a5..7fb5c2963 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -408,13 +408,6 @@ using namespace INTERP_KERNEL; %newobject MEDCoupling::DenseMatrix::__add__; %newobject MEDCoupling::DenseMatrix::__sub__; %newobject MEDCoupling::DenseMatrix::__mul__; -%newobject MEDCoupling::PartDefinition::New; -%newobject MEDCoupling::PartDefinition::toDAI; -%newobject MEDCoupling::PartDefinition::__add__; -%newobject MEDCoupling::PartDefinition::composeWith; -%newobject MEDCoupling::PartDefinition::tryToSimplify; -%newobject MEDCoupling::DataArrayPartDefinition::New; -%newobject MEDCoupling::SlicePartDefinition::New; %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell; %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell; @@ -447,9 +440,6 @@ using namespace INTERP_KERNEL; %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();" %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();" %feature("unref") DenseMatrix "$this->decrRef();" -%feature("unref") PartDefinition "$this->decrRef();" -%feature("unref") DataArrayPartDefinition "$this->decrRef();" -%feature("unref") SlicePartDefinition "$this->decrRef();" %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();" %rename(assign) *::operator=; @@ -5953,107 +5943,6 @@ namespace MEDCoupling #endif } }; - - class PartDefinition : public RefCountObject, public TimeLabel - { - public: - static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception); - static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception); - virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception); - virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception); - virtual std::string getRepr() const throw(INTERP_KERNEL::Exception); - virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception); - virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception); - virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception); - %extend - { - virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception) - { - return (*self)+other; - } - - virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception) - { - std::string ret1; - bool ret0(self->isEqual(other,ret1)); - PyObject *ret=PyTuple_New(2); - PyObject *ret0Py=ret0?Py_True:Py_False; - Py_XINCREF(ret0Py); - PyTuple_SetItem(ret,0,ret0Py); - PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str())); - return ret; - } - - virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception) - { - return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0); - } - } - protected: - virtual ~PartDefinition(); - }; - - class DataArrayPartDefinition : public PartDefinition - { - public: - static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception); - %extend - { - DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception) - { - return DataArrayPartDefinition::New(listOfIds); - } - - std::string __str__() const throw(INTERP_KERNEL::Exception) - { - return self->getRepr(); - } - - std::string __repr__() const throw(INTERP_KERNEL::Exception) - { - std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl; - oss << self->getRepr(); - return oss.str(); - } - } - protected: - virtual ~DataArrayPartDefinition(); - }; - - class SlicePartDefinition : public PartDefinition - { - public: - static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception); - int getEffectiveStop() const throw(INTERP_KERNEL::Exception); - %extend - { - SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception) - { - return SlicePartDefinition::New(start,stop,step); - } - - PyObject *getSlice() const throw(INTERP_KERNEL::Exception) - { - int a,b,c; - self->getSlice(a,b,c); - return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c)); - } - - std::string __str__() const throw(INTERP_KERNEL::Exception) - { - return self->getRepr(); - } - - std::string __repr__() const throw(INTERP_KERNEL::Exception) - { - std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl; - oss << self->getRepr(); - return oss.str(); - } - } - protected: - virtual ~SlicePartDefinition(); - }; } %pythoncode %{ diff --git a/src/MEDCoupling_Swig/MEDCouplingMemArray.i b/src/MEDCoupling_Swig/MEDCouplingMemArray.i index 2396c3cb3..397712f5d 100644 --- a/src/MEDCoupling_Swig/MEDCouplingMemArray.i +++ b/src/MEDCoupling_Swig/MEDCouplingMemArray.i @@ -51,6 +51,7 @@ %newobject MEDCoupling::DataArray::Aggregate; %newobject MEDCoupling::DataArrayInt::New; %newobject MEDCoupling::DataArrayInt::__iter__; +%newobject MEDCoupling::DataArrayInt::selectPartDef; %newobject MEDCoupling::DataArrayInt::convertToDblArr; %newobject MEDCoupling::DataArrayInt::performCopyOrIncrRef; %newobject MEDCoupling::DataArrayInt::subArray; @@ -141,6 +142,7 @@ %newobject MEDCoupling::DataArrayAsciiCharTuple::buildDAAsciiChar; %newobject MEDCoupling::DataArrayDouble::New; %newobject MEDCoupling::DataArrayDouble::__iter__; +%newobject MEDCoupling::DataArrayDouble::selectPartDef; %newobject MEDCoupling::DataArrayDouble::convertToIntArr; %newobject MEDCoupling::DataArrayDouble::performCopyOrIncrRef; %newobject MEDCoupling::DataArrayDouble::Aggregate; @@ -202,6 +204,15 @@ %newobject MEDCoupling::DataArrayDouble::__rpow__; %newobject MEDCoupling::DataArrayDoubleTuple::buildDADouble; +%newobject MEDCoupling::PartDefinition::New; +%newobject MEDCoupling::PartDefinition::toDAI; +%newobject MEDCoupling::PartDefinition::__add__; +%newobject MEDCoupling::PartDefinition::composeWith; +%newobject MEDCoupling::PartDefinition::tryToSimplify; +%newobject MEDCoupling::DataArrayPartDefinition::New; +%newobject MEDCoupling::SlicePartDefinition::New; + + %feature("unref") DataArray "$this->decrRef();" %feature("unref") DataArrayDouble "$this->decrRef();" %feature("unref") DataArrayInt "$this->decrRef();" @@ -209,6 +220,10 @@ %feature("unref") DataArrayAsciiChar "$this->decrRef();" %feature("unref") DataArrayByte "$this->decrRef();" +%feature("unref") PartDefinition "$this->decrRef();" +%feature("unref") DataArrayPartDefinition "$this->decrRef();" +%feature("unref") SlicePartDefinition "$this->decrRef();" + namespace MEDCoupling { typedef enum @@ -218,6 +233,109 @@ namespace MEDCoupling AX_SPHER = 5 } MEDCouplingAxisType; + class DataArrayInt; + + class PartDefinition : public RefCountObject, public TimeLabel + { + public: + static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception); + static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception); + virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception); + virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception); + virtual std::string getRepr() const throw(INTERP_KERNEL::Exception); + virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception); + virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception); + virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception); + %extend + { + virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception) + { + return (*self)+other; + } + + virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception) + { + std::string ret1; + bool ret0(self->isEqual(other,ret1)); + PyObject *ret=PyTuple_New(2); + PyObject *ret0Py=ret0?Py_True:Py_False; + Py_XINCREF(ret0Py); + PyTuple_SetItem(ret,0,ret0Py); + PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str())); + return ret; + } + + virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception) + { + return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0); + } + } + protected: + virtual ~PartDefinition(); + }; + + class DataArrayPartDefinition : public PartDefinition + { + public: + static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception); + %extend + { + DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception) + { + return DataArrayPartDefinition::New(listOfIds); + } + + std::string __str__() const throw(INTERP_KERNEL::Exception) + { + return self->getRepr(); + } + + std::string __repr__() const throw(INTERP_KERNEL::Exception) + { + std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl; + oss << self->getRepr(); + return oss.str(); + } + } + protected: + virtual ~DataArrayPartDefinition(); + }; + + class SlicePartDefinition : public PartDefinition + { + public: + static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception); + int getEffectiveStop() const throw(INTERP_KERNEL::Exception); + %extend + { + SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception) + { + return SlicePartDefinition::New(start,stop,step); + } + + PyObject *getSlice() const throw(INTERP_KERNEL::Exception) + { + int a,b,c; + self->getSlice(a,b,c); + return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c)); + } + + std::string __str__() const throw(INTERP_KERNEL::Exception) + { + return self->getRepr(); + } + + std::string __repr__() const throw(INTERP_KERNEL::Exception) + { + std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl; + oss << self->getRepr(); + return oss.str(); + } + } + protected: + virtual ~SlicePartDefinition(); + }; + class DataArray : public RefCountObject, public TimeLabel { public: @@ -759,6 +877,12 @@ namespace MEDCoupling return MEDCoupling_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2); } + DataArrayDouble *selectPartDef(const PartDefinition* pd) const throw(INTERP_KERNEL::Exception) + { + MCAuto ret(self->selectPartDef(pd)); + return ret.retn(); + } + void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception) { double val; @@ -2882,6 +3006,12 @@ namespace MEDCoupling { return self->iterator(); } + + DataArrayInt *selectPartDef(const PartDefinition* pd) const throw(INTERP_KERNEL::Exception) + { + MCAuto ret(self->selectPartDef(pd)); + return ret.retn(); + } PyObject *accumulate() const throw(INTERP_KERNEL::Exception) { diff --git a/src/MEDLoader/MEDFileBlowStrEltUp.cxx b/src/MEDLoader/MEDFileBlowStrEltUp.cxx index 9e6ee4f45..0d614de1d 100644 --- a/src/MEDLoader/MEDFileBlowStrEltUp.cxx +++ b/src/MEDLoader/MEDFileBlowStrEltUp.cxx @@ -21,6 +21,7 @@ #include "MEDFileBlowStrEltUp.hxx" #include "MEDCouplingFieldDouble.hxx" #include "MEDFileFieldVisitor.hxx" +#include "MEDCouplingPartDefinition.hxx" #include "MCAuto.txx" using namespace MEDCoupling; @@ -315,10 +316,12 @@ public: bool isClassic() const { return _is_classic; } bool operator!=(const FieldWalker2& other) const; bool operator==(const FieldWalker2& other) const; + const SlicePartDefinition *getPartDef() const { return _pd; } private: std::string _loc; std::string _pfl; bool _is_classic; + MCAuto _pd; }; class LocInfo @@ -329,6 +332,7 @@ public: bool operator==(const LocInfo& other) const { return _locs==other._locs && _pfl==other._pfl; } void push(const std::string& loc, const std::string& pfl) { checkUniqueLoc(loc); _locs.push_back(loc); _pfl.push_back(pfl); } MCAuto generateNonClassicalData(int zePos, const MEDFileUMesh *mesh, const MEDFileFieldGlobsReal *globs) const; + const PartDefinition *getPartDef() const { return _pd; } private: void checkUniqueLoc(const std::string& loc) const; static MCAuto BuildMeshFromAngleVrille(INTERP_KERNEL::NormalizedCellType gt, const DataArrayDouble *angleDeVrille, const std::string& pfl, const MEDFileFieldLoc& loc, const MEDFileEltStruct4Mesh *zeStr, const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileFieldGlobsReal *globs); @@ -338,6 +342,7 @@ public: private: std::vector _locs; std::vector _pfl; + MCAuto _pd; }; const char LocInfo::ANGLE_DE_VRILLE[]="ANGLE DE VRILLE"; @@ -346,10 +351,14 @@ LocInfo::LocInfo(const std::vector& fw) { std::size_t sz(fw.size()); _locs.resize(sz); _pfl.resize(sz); + if(sz>0) + _pd=fw[0].getPartDef()->deepCopy(); for(std::size_t i=0;i0) + _pd=(*_pd)+(*(fw[i].getPartDef())); } } @@ -505,17 +514,22 @@ FieldWalker2::FieldWalker2(const MEDFileFieldPerMeshPerTypePerDisc *pmptpd) _loc=pmptpd->getLocalization(); _pfl=pmptpd->getProfile(); _is_classic=pmptpd->getType()!=ON_GAUSS_PT; + _pd=SlicePartDefinition::New(pmptpd->getStart(),pmptpd->getEnd(),1); } bool FieldWalker2::operator!=(const FieldWalker2& other) const { - bool ret(_loc==other._loc && _pfl==other._pfl && _is_classic==other._is_classic); - return !ret; + return !((*this)==other); } bool FieldWalker2::operator==(const FieldWalker2& other) const { - bool ret(_loc==other._loc && _pfl==other._pfl && _is_classic==other._is_classic); + bool ret2(false); + { + std::string tmp; + ret2=_pd->isEqual(other._pd,tmp); + } + bool ret(_loc==other._loc && _pfl==other._pfl && _is_classic==other._is_classic && ret2); return ret; } @@ -755,7 +769,10 @@ void LocSpliter::generateNonClassicalData(const MEDFileUMesh *mesh, std::vector< int t2,t3; double t1(f1ts->getTime(t2,t3)); MCAuto mcf(MEDCouplingFieldDouble::New(ON_NODES)); - mcf->setArray(f1ts->getUndergroundDataArray()); + MCAuto arr,arr2; + arr.takeRef(f1ts->getUndergroundDataArray()); + arr2=arr->selectPartDef((*it).getPartDef()); + mcf->setArray(arr2); mcf->setTime(t1,t2,t3); mcf->setName(f1ts->getName()); mcf->setMesh(mcm); -- 2.39.2