return arrC;
}
+MEDFileIntField1TS *MEDFileIntField1TS::extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const
+{
+ throw INTERP_KERNEL::Exception("MEDFileIntField1TS::extractPart : not implemented yet !");
+}
+
/*!
* Returns a new MEDCouplingFieldDouble of a given type lying on
* the top level cells of the first mesh in MED file. If \a this field
return nts;
}
+/*!
+ * Return an extraction of \a this using \a extractDef map to specify the extraction.
+ * The keys of \a extractDef is level relative to max ext of \a mm mesh.
+ *
+ * \return A new object that the caller is responsible to deallocate.
+ */
+MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const
+{
+ if(!mm)
+ throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::extractPart : mesh is null !");
+ MCAuto<MEDFileAnyTypeFieldMultiTS> fmtsOut(buildNewEmpty());
+ int nbTS(getNumberOfTS());
+ for(int i=0;i<nbTS;i++)
+ {
+ MCAuto<MEDFileAnyTypeField1TS> f1ts(getTimeStepAtPos(i));
+ MCAuto<MEDFileAnyTypeField1TS> f1tsOut(f1ts->extractPart(extractDef,mm));
+ fmtsOut->pushBackTimeStep(f1tsOut);
+ }
+ return fmtsOut.retn();
+}
+
MEDFileAnyTypeFieldMultiTSIterator *MEDFileAnyTypeFieldMultiTS::iterator()
{
return new MEDFileAnyTypeFieldMultiTSIterator(this);
return static_cast<DataArrayDouble *>(contentNotNull()->getUndergroundDataArrayExt(iteration,order,entries));
}
-/*!
- * Return an extraction of \a this using \a extractDef map to specify the extraction.
- * The keys of \a extractDef is level relative to max ext of \a mm mesh.
- *
- * \return A new object that the caller is responsible to deallocate.
- */
-MEDFileFieldMultiTS *MEDFileFieldMultiTS::extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const
+MEDFileFieldMultiTS *MEDFileFieldMultiTS::buildNewEmpty() const
{
- if(!mm)
- throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::extractPart : mesh is null !");
- MCAuto<MEDFileFieldMultiTS> fmtsOut(MEDFileFieldMultiTS::New());
- int nbTS(getNumberOfTS());
- for(int i=0;i<nbTS;i++)
- {
- MCAuto<MEDFileField1TS> f1ts(getTimeStepAtPos(i));
- MCAuto<MEDFileField1TS> f1tsOut(f1ts->extractPart(extractDef,mm));
- fmtsOut->pushBackTimeStep(f1tsOut);
- }
- return fmtsOut.retn();
+ return MEDFileFieldMultiTS::New();
}
//= MEDFileAnyTypeFieldMultiTSIterator
return static_cast<DataArrayInt *>(contentNotNull()->getUndergroundDataArray(iteration,order));
}
-MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const
+MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::buildNewEmpty() const
{
- throw INTERP_KERNEL::Exception("*MEDFileIntFieldMultiTS::extractPart : not implemented yet for int !");
+ return MEDFileIntFieldMultiTS::New();
}
//= MEDFileFields
int nbFields(getNumberOfFields());
for(int i=0;i<nbFields;i++)
{
- MEDFileAnyTypeFieldMultiTS *fmts(getFieldAtPos(i));
+ MCAuto<MEDFileAnyTypeFieldMultiTS> fmts(getFieldAtPos(i));
if(!fmts)
{
std::ostringstream oss; oss << "MEDFileFields::extractPart : at pos #" << i << " field is null !";
public:
MEDLOADER_EXPORT static int LocateField2(med_idt fid, const std::string& fileName, int fieldIdCFormat, bool checkFieldId, std::string& fieldName, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
MEDLOADER_EXPORT static int LocateField(med_idt fid, const std::string& fileName, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut);
+ public:
+ MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const = 0;
public:
MEDLOADER_EXPORT virtual med_field_type getMEDFileFieldType() const = 0;
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase();
MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray() const;
public:
MEDLOADER_EXPORT static DataArrayInt *ReturnSafelyDataArrayInt(MCAuto<DataArray>& arr);
+ public:
+ MEDLOADER_EXPORT MEDFileIntField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
private:
med_field_type getMEDFileFieldType() const { return MED_INT32; }
const MEDFileIntField1TSWithoutSDA *contentNotNull() const;
MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
MEDLOADER_EXPORT MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
public:
- MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const = 0;
+ MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const = 0;
+ MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
public:
MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray(int iteration, int order) const;
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
public:
- MEDLOADER_EXPORT MEDFileFieldMultiTS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
+ MEDLOADER_EXPORT MEDFileFieldMultiTS *buildNewEmpty() const;
private:
const MEDFileFieldMultiTSWithoutSDA *contentNotNull() const;
MEDFileFieldMultiTSWithoutSDA *contentNotNull();
//
MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray(int iteration, int order) const;
public:
- MEDLOADER_EXPORT MEDFileIntFieldMultiTS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
+ MEDLOADER_EXPORT MEDFileIntFieldMultiTS *buildNewEmpty() const;
private:
const MEDFileIntFieldMultiTSWithoutSDA *contentNotNull() const;
MEDFileIntFieldMultiTSWithoutSDA *contentNotNull();
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
%newobject MEDCoupling::MEDFileFieldMultiTS::New;
%newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
+%newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
%newobject MEDCoupling::MEDFileField1TS::New;
%newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
%newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
%newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
%newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileField1TS::convertToInt;
-%newobject MEDCoupling::MEDFileField1TS::extractPart;
%newobject MEDCoupling::MEDFileIntField1TS::New;
%newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
return retPy;
}
+
+ MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
+ {
+ std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
+ convertToMapIntDataArrayInt(extractDef,extractDefCpp);
+ return self->extractPart(extractDefCpp,mm);
+ }
}
};
PyTuple_SetItem(ret,1,elt);
return ret;
}
-
- MEDFileField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
- {
- std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
- convertToMapIntDataArrayInt(extractDef,extractDefCpp);
- return self->extractPart(extractDefCpp,mm);
- }
}
};
MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception);
void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts) throw(INTERP_KERNEL::Exception);
void synchronizeNameScope() throw(INTERP_KERNEL::Exception);
+ MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const throw(INTERP_KERNEL::Exception);
%extend
{
int __len__() const throw(INTERP_KERNEL::Exception)
}
}
- MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
+ MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const throw(INTERP_KERNEL::Exception)
{
std::map<int, MCAuto<DataArrayInt> > extractDefCpp;
convertToMapIntDataArrayInt(extractDef,extractDefCpp);