void MEDCouplingFieldDouble::copyTinyStringsFrom(const MEDCouplingField *other)
{
MEDCouplingField::copyTinyStringsFrom(other);
- const MEDCouplingFieldDouble *otherC=dynamic_cast<const MEDCouplingFieldDouble *>(other);
+ const MEDCouplingFieldDouble *otherC(dynamic_cast<const MEDCouplingFieldDouble *>(other));
if(otherC)
{
_time_discr->copyTinyStringsFrom(*otherC->_time_discr);
{
if(!other)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::isEqualIfNotWhy : other instance is NULL !");
- const MEDCouplingFieldDouble *otherC=dynamic_cast<const MEDCouplingFieldDouble *>(other);
+ const MEDCouplingFieldDouble *otherC(dynamic_cast<const MEDCouplingFieldDouble *>(other));
if(!otherC)
{
reason="field given in input is not castable in MEDCouplingFieldDouble !";
*/
bool MEDCouplingFieldDouble::isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const
{
- const MEDCouplingFieldDouble *otherC=dynamic_cast<const MEDCouplingFieldDouble *>(other);
+ const MEDCouplingFieldDouble *otherC(dynamic_cast<const MEDCouplingFieldDouble *>(other));
if(!otherC)
return false;
if(!MEDCouplingField::isEqualWithoutConsideringStr(other,meshPrec,valsPrec))
{
if(!MEDCouplingField::areCompatibleForMerge(other))
return false;
- const MEDCouplingFieldDouble *otherC=dynamic_cast<const MEDCouplingFieldDouble *>(other);
+ const MEDCouplingFieldDouble *otherC(dynamic_cast<const MEDCouplingFieldDouble *>(other));
if(!otherC)
return false;
if(!_time_discr->areCompatible(otherC->_time_discr))
std::string tmp;
if(!MEDCouplingField::areStrictlyCompatible(other))
return false;
- const MEDCouplingFieldDouble *otherC=dynamic_cast<const MEDCouplingFieldDouble *>(other);
+ const MEDCouplingFieldDouble *otherC(dynamic_cast<const MEDCouplingFieldDouble *>(other));
if(!otherC)
return false;
if(!_time_discr->areStrictlyCompatible(otherC->_time_discr,tmp))
{
if(!MEDCouplingField::areStrictlyCompatibleForMulDiv(other))
return false;
- const MEDCouplingFieldDouble *otherC=dynamic_cast<const MEDCouplingFieldDouble *>(other);
+ const MEDCouplingFieldDouble *otherC(dynamic_cast<const MEDCouplingFieldDouble *>(other));
if(!otherC)
return false;
if(!_time_discr->areStrictlyCompatibleForDiv(otherC->_time_discr))
MEDCouplingFieldInt::MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td):MEDCouplingField(ft,false),_time_discr(MEDCouplingTimeDiscretizationInt::New(td))
{
}
+
+MEDCouplingFieldInt *MEDCouplingFieldInt::deepCopy() const
+{
+ return cloneWithMesh(true);
+}
+
+MEDCouplingFieldInt *MEDCouplingFieldInt::cloneWithMesh(bool recDeepCpy) const
+{
+ MCAuto<MEDCouplingFieldInt> ret(clone(recDeepCpy));
+ if(_mesh)
+ {
+ MCAuto<MEDCouplingMesh> mCpy(_mesh->deepCopy());
+ ret->setMesh(mCpy);
+ }
+ return ret.retn();
+}
+
+MEDCouplingFieldInt *MEDCouplingFieldInt::clone(bool recDeepCpy) const
+{
+ return new MEDCouplingFieldInt(*this,recDeepCpy);
+}
+
+bool MEDCouplingFieldInt::isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const
+{
+ if(!other)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldInt::isEqualIfNotWhy : other instance is NULL !");
+ const MEDCouplingFieldInt *otherC(dynamic_cast<const MEDCouplingFieldInt *>(other));
+ if(!otherC)
+ {
+ reason="field given in input is not castable in MEDCouplingFieldInt !";
+ return false;
+ }
+ if(!MEDCouplingField::isEqualIfNotWhy(other,meshPrec,valsPrec,reason))
+ return false;
+ if(!_time_discr->isEqualIfNotWhy(otherC->_time_discr,reason))
+ {
+ reason.insert(0,"In FieldInt time discretizations differ :");
+ return false;
+ }
+ return true;
+}
+
+bool MEDCouplingFieldInt::isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const
+{
+ const MEDCouplingFieldInt *otherC(dynamic_cast<const MEDCouplingFieldInt *>(other));
+ if(!otherC)
+ return false;
+ if(!MEDCouplingField::isEqualWithoutConsideringStr(other,meshPrec,valsPrec))
+ return false;
+ if(!_time_discr->isEqualWithoutConsideringStr(otherC->_time_discr))
+ return false;
+ return true;
+}
+
+void MEDCouplingFieldInt::copyTinyStringsFrom(const MEDCouplingField *other)
+{
+ MEDCouplingField::copyTinyStringsFrom(other);
+ const MEDCouplingFieldInt *otherC(dynamic_cast<const MEDCouplingFieldInt *>(other));
+ if(otherC)
+ {
+ _time_discr->copyTinyStringsFrom(*otherC->_time_discr);
+ }
+}
+
+bool MEDCouplingFieldInt::areStrictlyCompatible(const MEDCouplingField *other) const
+{
+ std::string tmp;
+ if(!MEDCouplingField::areStrictlyCompatible(other))
+ return false;
+ const MEDCouplingFieldInt *otherC(dynamic_cast<const MEDCouplingFieldInt *>(other));
+ if(!otherC)
+ return false;
+ if(!_time_discr->areStrictlyCompatible(otherC->_time_discr,tmp))
+ return false;
+ return true;
+}
+
+bool MEDCouplingFieldInt::areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const
+{
+ if(!MEDCouplingField::areStrictlyCompatibleForMulDiv(other))
+ return false;
+ const MEDCouplingFieldInt *otherC(dynamic_cast<const MEDCouplingFieldInt *>(other));
+ if(!otherC)
+ return false;
+ if(!_time_discr->areStrictlyCompatibleForDiv(otherC->_time_discr))
+ return false;
+ return true;
+}
+
MEDCOUPLING_EXPORT void setArray(DataArrayInt *array);
MEDCOUPLING_EXPORT const DataArrayInt *getArray() const;
MEDCOUPLING_EXPORT DataArrayInt *getArray();
+ MEDCOUPLING_EXPORT MEDCouplingFieldInt *deepCopy() const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldInt *clone(bool recDeepCpy) const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const;
+ MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const;
+ MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const;
+ MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingField *other);
+ MEDCOUPLING_EXPORT bool areStrictlyCompatible(const MEDCouplingField *other) const;
+ MEDCOUPLING_EXPORT bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
protected:
MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td);
MEDCouplingFieldInt(const MEDCouplingFieldInt& other, bool deepCopy);
{
}
-MEDCouplingTimeDiscretizationInt::MEDCouplingTimeDiscretizationInt(const MEDCouplingTimeDiscretizationInt& other, bool deepCopy):MEDCouplingTimeDiscretizationTemplate<int>(other,deepCopy)
+MEDCouplingTimeDiscretizationInt::MEDCouplingTimeDiscretizationInt(const MEDCouplingTimeDiscretizationInt& other, bool deepCopy):MEDCouplingTimeDiscretizationTemplate<int>(other,deepCopy),_tk(other._tk)
{
}
}
}
+bool MEDCouplingTimeDiscretizationInt::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationInt *other, std::string& reason) const
+{
+ if(!other)
+ {
+ reason="Time discretization is NULL.";
+ return false;
+ }
+ if(!MEDCouplingTimeDiscretizationTemplate<int>::areStrictlyCompatible(other,reason))
+ return false;
+ if(!_tk.isEqualIfNotWhy(other->_tk,_time_tolerance,reason))
+ return false;
+ if(_array==other->_array)
+ return true;
+ return _array->isEqualIfNotWhy(*other->_array,reason);
+}
+
+bool MEDCouplingTimeDiscretizationInt::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationInt *other) const
+{
+ std::string tmp;
+ if(!areStrictlyCompatible(other,tmp))
+ return false;
+ std::string reason;
+ if(!_tk.isEqualIfNotWhy(other->_tk,_time_tolerance,reason))
+ return false;
+ if(_array==other->_array)
+ return true;
+ return _array->isEqualWithoutConsideringStr(*other->_array);
+}
////////////////////////
std::string getStringRepr() const;
TypeOfTimeDiscretization getEnum() const { return DISCRETIZATION; }
MEDCouplingTimeDiscretizationInt *performCopyOrIncrRef(bool deepCopy) const;
+ bool isEqualIfNotWhy(const MEDCouplingTimeDiscretizationInt *other, std::string& reason) const;
+ bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationInt *other) const;
private:
static const TypeOfTimeDiscretization DISCRETIZATION=ONE_TIME;
MEDCOUPLING_EXPORT static const char REPR[];
self.assertTrue(rd.isEqual(DataArrayInt([0,4,0,3,0,2,0,2,0,0,1,2,1,2,1,6,1,5,1,1,2,8,2,7,3,3,4,4,5,5,6,6,7,7,8,8])))
self.assertTrue(rdi.isEqual(DataArrayInt([0,2,4,6,8,9,10,12,14,16,18,19,20,22,24,25,27,28,29,31,33,35,36])))
pass
-
+
+ def testFieldIntIsOnStage2(self):
+ """ Very important test to check that isEqual of MEDCouplingFieldInt is OK !"""
+ m1=MEDCouplingCMesh() ; m1.setCoords(DataArrayDouble([0,1,2,3]),DataArrayDouble([0,1,2,3,4]))
+ m1=m1.buildUnstructured() ; m1.setName("mesh")
+ f1=MEDCouplingFieldInt(ON_CELLS) ; f1.setMesh(m1)
+ arr1=DataArrayInt([(0,1),(2,3),(4,5),(6,7),(8,9),(10,11),(12,13),(14,15),(16,17),(18,19),(20,21),(22,23)]) ; arr1.setInfoOnComponents(["aa","bbb"])
+ f1.setArray(arr1) ; f1.setName("f1") ; f1.setTime(2.,3,4)
+ #
+ m2=MEDCouplingCMesh() ; m2.setCoords(DataArrayDouble([0,1,2,3]),DataArrayDouble([0,1,2,3,4]))
+ m2=m2.buildUnstructured() ; m2.setName("mesh")
+ f2=MEDCouplingFieldInt(ON_CELLS) ; f2.setMesh(m2)
+ arr2=DataArrayInt([(0,1),(2,3),(4,5),(6,7),(8,9),(10,11),(12,13),(14,15),(16,17),(18,19),(20,21),(22,23)]) ; arr2.setInfoOnComponents(["aa","bbb"])
+ f2.setArray(arr2) ; f2.setName("f1") ; f2.setTime(2.,3,4)
+ #
+ self.assertTrue(f1.isEqual(f2,1e-12,0.))
+ f1.getArray()[:]*=2
+ self.assertTrue(not f1.isEqual(f2,1e-12,0.))
+ self.assertTrue(not f1.isEqualWithoutConsideringStr(f2,1e-12,0.))
+ f1.getArray()[:]/=2
+ self.assertTrue(f1.isEqual(f2,1e-12,0.))
+ #
+ f1.setName("F1")
+ self.assertTrue(not f1.isEqual(f2,1e-12,0.))
+ f1.setName("f1")
+ self.assertTrue(f1.isEqual(f2,1e-12,0.))
+ #
+ f1.getArray().setInfoOnComponents(["aa","bbbb"])
+ self.assertTrue(not f1.isEqual(f2,1e-12,0.))
+ self.assertTrue(f1.isEqualWithoutConsideringStr(f2,1e-12,0.))
+ f1.getArray().setInfoOnComponents(["aa","bbb"])
+ self.assertTrue(f1.isEqual(f2,1e-12,0.))
+ #
+ f3=f2.deepCopy()
+ self.assertTrue(f1.isEqual(f3,1e-12,0.))
+ #
+ for fd,expected in ((ON_NODES,False),(ON_CELLS,True)):
+ f4=MEDCouplingFieldInt(fd) ; f4.setMesh(m2) ; f4.setTime(2.,3,4)
+ arr4=DataArrayInt([(0,1),(2,3),(4,5),(6,7),(8,9),(10,11),(12,13),(14,15),(16,17),(18,19),(20,21),(22,23)]) ; arr4.setInfoOnComponents(["aa","bbb"])
+ f4.setArray(arr4) ; f4.setName("f1")
+ self.assertEqual(f1.isEqual(f4,1e-12,0.),expected)
+ pass
+ pass
+
pass
if __name__ == '__main__':
%newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
%newobject MEDCoupling::MEDCouplingFieldInt::New;
%newobject MEDCoupling::MEDCouplingFieldInt::getArray;
+%newobject MEDCoupling::MEDCouplingFieldInt::deepCopy;
+%newobject MEDCoupling::MEDCouplingFieldInt::clone;
+%newobject MEDCoupling::MEDCouplingFieldInt::cloneWithMesh;
%newobject MEDCoupling::MEDCouplingFieldTemplate::New;
%newobject MEDCoupling::MEDCouplingMesh::deepCopy;
%newobject MEDCoupling::MEDCouplingMesh::clone;
std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
%extend {
MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
{
#include "MEDFileFieldOverView.hxx"
#include "MEDCouplingFieldDouble.hxx"
+#include "MEDCouplingFieldTemplate.hxx"
#include "MEDCouplingFieldDiscretization.hxx"
#include "InterpKernelAutoPtr.hxx"
void MEDFileFieldPerMeshPerType::getDimension(int& dim) const
{
- const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(_geo_type);
- int curDim=(int)cm.getDimension();
+ const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(_geo_type));
+ int curDim((int)cm.getDimension());
dim=std::max(dim,curDim);
}
+bool MEDFileFieldPerMeshPerType::isUniqueLevel(int& dim) const
+{
+ const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(_geo_type));
+ int curDim((int)cm.getDimension());
+ if(dim!=std::numeric_limits<int>::max())
+ {
+ if(dim!=curDim)
+ return false;
+ }
+ else
+ dim=curDim;
+ return true;
+}
+
void MEDFileFieldPerMeshPerType::fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const
{
for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
(*it)->getDimension(dim);
}
+bool MEDFileFieldPerMesh::isUniqueLevel(int& dim) const
+{
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ if(!(*it)->isUniqueLevel(dim))
+ return false;
+ return true;
+}
+
void MEDFileFieldPerMesh::fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const
{
for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
return false;
}
+MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::fieldOnMesh(const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+{
+ static const char MSG0[]="MEDFileAnyTypeField1TSWithoutSDA::fieldOnMesh : the field is too complex to be able to extract a field ! Call getFieldOnMeshAtLevel method instead to deal with complexity !";
+ if(_field_per_mesh.empty())
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::fieldOnMesh : the field is empty ! Nothing to extract !");
+ if(_field_per_mesh.size()>1)
+ throw INTERP_KERNEL::Exception(MSG0);
+ if(_field_per_mesh[0].isNull())
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::fieldOnMesh : the field is inconsistent !");
+ const MEDFileFieldPerMesh *pm(_field_per_mesh[0]);
+ std::set<TypeOfField> types;
+ pm->fillTypesOfFieldAvailable(types);
+ if(types.size()!=1)
+ throw INTERP_KERNEL::Exception(MSG0);
+ TypeOfField type(*types.begin());
+ int meshDimRelToMax(0);
+ if(type==ON_NODES)
+ meshDimRelToMax=0;
+ else
+ {
+ int myDim(std::numeric_limits<int>::max());
+ bool isUnique(pm->isUniqueLevel(myDim));
+ if(!isUnique)
+ throw INTERP_KERNEL::Exception(MSG0);
+ meshDimRelToMax=myDim-mesh->getMeshDimension();
+ if(meshDimRelToMax>0)
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::fieldOnMesh : the mesh attached to field is not compatible with the field !");
+ }
+ return MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(type,meshDimRelToMax,0/*renumPol*/,glob,mesh,arrOut,nasc);
+}
+
/*!
* Returns a new MEDCouplingFieldDouble of given type lying on a given support.
* \param [in] type - a spatial discretization of the new field.
MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
MCAuto<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax,false));
- const DataArrayInt *d=mesh->getNumberFieldAtLevel(meshDimRelToMax);
- const DataArrayInt *e=mesh->getNumberFieldAtLevel(1);
+ const DataArrayInt *d(mesh->getNumberFieldAtLevel(meshDimRelToMax)),*e(mesh->getNumberFieldAtLevel(1));
if(meshDimRelToMax==1)
(static_cast<MEDCouplingUMesh *>((MEDCouplingMesh *)m))->setMeshDimension(0);
return MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(type,renumPol,glob,m,d,e,arrOut,nasc);
_content=new MEDFileField1TSWithoutSDA;
}
+/*!
+ * This is the simplest version to fetch a field for MED structure. One drawback : if \a this is a complex field (multi spatial discretization inside a same field) this method will throw exception and more advance
+ * method should be called (getFieldOnMeshAtLevel for example).
+ * But for normal usage of field in MED file world this method is the most efficient to fetch data.
+ *
+ * \param [in] mesh - the mesh the field is lying on
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ */
+MEDCouplingFieldDouble *MEDFileField1TS::field(const MEDFileMesh *mesh) const
+{
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret(contentNotNull()->fieldOnMesh(this,mesh,arrOut,*contentNotNull()));
+ MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
+ return ret.retn();
+}
+
/*!
* Returns a new MEDCouplingFieldDouble of a given type lying on
* mesh entities of a given dimension of the first mesh in MED file. If \a this field
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
MCAuto<DataArray> arrOut;
- MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut,*contentNotNull());
+ MCAuto<MEDCouplingFieldDouble> ret(contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut,*contentNotNull()));
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtTopLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtTopLevel method instead !");
MCAuto<DataArray> arrOut;
- MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtTopLevel(type,std::string(),renumPol,this,arrOut,*contentNotNull());
+ MCAuto<MEDCouplingFieldDouble> ret(contentNotNull()->getFieldAtTopLevel(type,std::string(),renumPol,this,arrOut,*contentNotNull()));
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
MEDCouplingFieldDouble *MEDFileField1TS::getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol) const
{
MCAuto<DataArray> arrOut;
- MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arrOut,*contentNotNull());
+ MCAuto<MEDCouplingFieldDouble> ret(contentNotNull()->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arrOut,*contentNotNull()));
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
MEDCouplingFieldDouble *MEDFileField1TS::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol) const
{
MCAuto<DataArray> arrOut;
- MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arrOut,*contentNotNull());
+ MCAuto<MEDCouplingFieldDouble> ret(contentNotNull()->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arrOut,*contentNotNull()));
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtLevelOld : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
MCAuto<DataArray> arrOut;
- MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arrOut,*contentNotNull());
+ MCAuto<MEDCouplingFieldDouble> ret(contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arrOut,*contentNotNull()));
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
contentNotNull()->setFieldNoProfileSBT(field,arrOfVals,*this,*contentNotNull());
}
+/*!
+ * Adds a MEDCouplingFieldInt to \a this. The underlying mesh of the given field is
+ * checked if its elements are sorted suitable for writing to MED file ("STB" stands for
+ * "Sort By Type"), if not, an exception is thrown.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] field - the field to add to \a this.
+ * \throw If the name of \a field is empty.
+ * \throw If the data array of \a field is not set.
+ * \throw If the data array is already allocated but has different number of components
+ * than \a field.
+ * \throw If the underlying mesh of \a field has no name.
+ * \throw If elements in the mesh are not in the order suitable for writing to the MED file.
+ */
+void MEDFileIntField1TS::setFieldNoProfileSBT(const MEDCouplingFieldInt *field)
+{
+ MCAuto<MEDCouplingFieldDouble> field2(ConvertFieldIntToFieldDouble(field));
+ setFileName("");
+ contentNotNull()->setFieldNoProfileSBT(field2,field->getArray(),*this,*contentNotNull());
+}
+
/*!
* Adds a MEDCouplingFieldDouble to \a this. As described in \ref MEDLoaderMainC a field in MED file sense
* can be an aggregation of several MEDCouplingFieldDouble instances.
contentNotNull()->setFieldProfile(field,arrOfVals,mesh,meshDimRelToMax,profile,*this,*contentNotNull());
}
+/*!
+ * Adds a MEDCouplingFieldInt to \a this. As described in \ref MEDLoaderMainC a field in MED file sense
+ * can be an aggregation of several MEDCouplingFieldDouble instances.
+ * The mesh support of input parameter \a field is ignored here, it can be NULL.
+ * The support of field \a field is expected to be those computed with the input parameter \a mesh, \a meshDimRelToMax,
+ * and \a profile.
+ *
+ * This method will check that the field based on the computed support is coherent. If not an exception will be thrown.
+ * A new profile is added only if no equal profile is missing.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] field - the field to add to \a this.
+ * \param [in] mesh - the supporting mesh of \a field.
+ * \param [in] meshDimRelToMax - a relative dimension of mesh entities \a field lies on (useless if field spatial discretization is ON_NODES).
+ * \param [in] profile - ids of mesh entities on which corresponding field values lie.
+ * \throw If either \a field or \a mesh or \a profile has an empty name.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a mesh.
+ * \throw If the data array of \a field is not set.
+ * \throw If the data array of \a this is already allocated but has different number of
+ * components than \a field.
+ * \throw If elements in \a mesh are not in the order suitable for writing to the MED file.
+ * \sa setFieldNoProfileSBT()
+ */
+void MEDFileIntField1TS::setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile)
+{
+ MCAuto<MEDCouplingFieldDouble> field2(ConvertFieldIntToFieldDouble(field));
+ setFileName("");
+ contentNotNull()->setFieldProfile(field2,field->getArray(),mesh,meshDimRelToMax,profile,*this,*contentNotNull());
+}
+
const MEDFileIntField1TSWithoutSDA *MEDFileIntField1TS::contentNotNull() const
{
const MEDFileAnyTypeField1TSWithoutSDA *pt(_content);
DataArrayInt *MEDFileIntField1TS::ReturnSafelyDataArrayInt(MCAuto<DataArray>& arr)
{
- if(!((DataArray *)arr))
+ if(arr.isNull())
throw INTERP_KERNEL::Exception("MEDFileIntField1TS::ReturnSafelyDataArrayInt : input DataArray is NULL !");
DataArrayInt *arrC=dynamic_cast<DataArrayInt *>((DataArray *)arr);
if(!arrC)
return arrC;
}
+MCAuto<MEDCouplingFieldInt> MEDFileIntField1TS::SetDataArrayDoubleInIntField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr)
+{
+ int t1,t2;
+ double t0(f->getTime(t1,t2));
+ MCAuto<DataArrayInt> arr2(DynamicCastSafe<DataArray,DataArrayInt>(arr));
+ MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::New(*f));
+ MCAuto<MEDCouplingFieldInt> ret(MEDCouplingFieldInt::New(*ft));
+ ret->setTime(t0,t1,t2); ret->setArray(arr2);
+ return ret.retn();
+}
+
+MCAuto<MEDCouplingFieldDouble> MEDFileIntField1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f)
+{
+ if(!f)
+ throw INTERP_KERNEL::Exception("MEDFileIntField1TS::ConvertFieldIntToFieldDouble : null input field !");
+ int t1,t2;
+ double t0(f->getTime(t1,t2));
+ MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::New(*f));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(*ft));
+ ret->setTime(t0,t1,t2);
+ return ret;
+}
+
MEDFileIntField1TS *MEDFileIntField1TS::extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const
{
throw INTERP_KERNEL::Exception("MEDFileIntField1TS::extractPart : not implemented yet !");
}
+/*!
+ * This is the simplest version to fetch a field for MED structure. One drawback : if \a this is a complex field (multi spatial discretization inside a same field) this method will throw exception and more advance
+ * method should be called (getFieldOnMeshAtLevel for example).
+ * But for normal usage of field in MED file world this method is the most efficient to fetch data.
+ *
+ * \param [in] mesh - the mesh the field is lying on
+ * \return MEDCouplingFieldInt * - a new instance of MEDCouplingFieldInt. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ */
+MEDCouplingFieldInt *MEDFileIntField1TS::field(const MEDFileMesh *mesh) const
+{
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret(contentNotNull()->fieldOnMesh(this,mesh,arrOut,*contentNotNull()));
+ MCAuto<MEDCouplingFieldInt> ret2(SetDataArrayDoubleInIntField(ret,arrOut));
+ return ret2.retn();
+}
+
/*!
* 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 ret.retn();
}
+/*!
+ * This is the simplest version to fetch a field for MED structure. One drawback : if \a this is a complex field (multi spatial discretization inside a same field) this method will throw exception and more advance
+ * method should be called (getFieldOnMeshAtLevel for example).
+ * But for normal usage of field in MED file world this method is the most efficient to fetch data.
+ *
+ * \param [in] iteration - the iteration number of a required time step.
+ * \param [in] order - the iteration order number of required time step.
+ * \param [in] mesh - the mesh the field is lying on
+ * \return MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ */
+MEDCouplingFieldDouble *MEDFileFieldMultiTS::field(int iteration, int order, const MEDFileMesh *mesh) const
+{
+ const MEDFileAnyTypeField1TSWithoutSDA& myF1TS(contentNotNullBase()->getTimeStepEntry(iteration,order));
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret(myF1TS.fieldOnMesh(this,mesh,arrOut,*contentNotNullBase()));
+ MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
+ return ret.retn();
+}
+
/*!
* Returns a new MEDCouplingFieldDouble of a given type, of a given time step, lying on
* a given support.
*/
MEDCouplingFieldDouble *MEDFileFieldMultiTS::getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol) const
{
- const MEDFileAnyTypeField1TSWithoutSDA& myF1TS=contentNotNullBase()->getTimeStepEntry(iteration,order);
+ const MEDFileAnyTypeField1TSWithoutSDA& myF1TS(contentNotNullBase()->getTimeStepEntry(iteration,order));
const MEDFileField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldOnMeshAtLevel : mismatch of type of field !");
throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::checkCoherencyOfType : the input field1TS is not a INT32 type !");
}
+/*!
+ * This is the simplest version to fetch a field for MED structure. One drawback : if \a this is a complex field (multi spatial discretization inside a same field) this method will throw exception and more advance
+ * method should be called (getFieldOnMeshAtLevel for example).
+ * But for normal usage of field in MED file world this method is the most efficient to fetch data.
+ *
+ * \param [in] iteration - the iteration number of a required time step.
+ * \param [in] order - the iteration order number of required time step.
+ * \param [in] mesh - the mesh the field is lying on
+ * \return MEDCouplingFieldInt * - a new instance of MEDCouplingFieldInt. The
+ * caller is to delete this field using decrRef() as it is no more needed.
+ */
+MEDCouplingFieldInt *MEDFileIntFieldMultiTS::field(int iteration, int order, const MEDFileMesh *mesh) const
+{
+ const MEDFileAnyTypeField1TSWithoutSDA& myF1TS(contentNotNullBase()->getTimeStepEntry(iteration,order));
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret(myF1TS.fieldOnMesh(this,mesh,arrOut,*contentNotNullBase()));
+ MCAuto<MEDCouplingFieldInt> ret2(MEDFileIntField1TS::SetDataArrayDoubleInIntField(ret,arrOut));
+ return ret2.retn();
+}
+
/*!
* Returns a new MEDCouplingFieldDouble of a given type, of a given time step, lying on
* mesh entities of a given dimension of the first mesh in MED file.
*/
MEDCouplingFieldDouble *MEDFileIntFieldMultiTS::getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol) const
{
- const MEDFileAnyTypeField1TSWithoutSDA& myF1TS=contentNotNullBase()->getTimeStepEntry(iteration,order);
- const MEDFileIntField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(&myF1TS);
+ const MEDFileAnyTypeField1TSWithoutSDA& myF1TS(contentNotNullBase()->getTimeStepEntry(iteration,order));
+ const MEDFileIntField1TSWithoutSDA *myF1TSC(dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(&myF1TS));
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::getFieldAtLevel : mismatch of type of field expecting INT32 !");
MCAuto<DataArray> arr;
- MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arr,*contentNotNullBase());
+ MCAuto<MEDCouplingFieldDouble> ret(myF1TSC->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arr,*contentNotNullBase()));
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
+/*!
+ * Adds a MEDCouplingFieldInt to \a this as another time step. The underlying mesh of
+ * the given field is checked if its elements are sorted suitable for writing to MED file
+ * ("STB" stands for "Sort By Type"), if not, an exception is thrown.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] field - the field to add to \a this.
+ * \throw If the name of \a field is empty.
+ * \throw If the data array of \a field is not set.
+ * \throw If existing time steps have different name or number of components than \a field.
+ * \throw If the underlying mesh of \a field has no name.
+ * \throw If elements in the mesh are not in the order suitable for writing to the MED file.
+ */
+void MEDFileIntFieldMultiTS::appendFieldNoProfileSBT(const MEDCouplingFieldInt *field)
+{
+ MCAuto<MEDCouplingFieldDouble> field2(MEDFileIntField1TS::ConvertFieldIntToFieldDouble(field));
+ contentNotNull()->appendFieldNoProfileSBT(field2,field->getArray(),*this);
+}
+
/*!
* Adds a MEDCouplingFieldDouble to \a this as another time step. The underlying mesh of
* the given field is checked if its elements are sorted suitable for writing to MED file
contentNotNull()->appendFieldNoProfileSBT(field,arrOfVals,*this);
}
+/*!
+ * Adds a MEDCouplingFieldDouble to \a this as another time step.
+ * The mesh support of input parameter \a field is ignored here, it can be NULL.
+ * The support of field \a field is expected to be those computed with the input parameter \a mesh, \a meshDimRelToMax,
+ * and \a profile.
+ *
+ * This method will check that the field based on the computed support is coherent. If not an exception will be thrown.
+ * A new profile is added only if no equal profile is missing.
+ * For more info, see \ref AdvMEDLoaderAPIFieldRW
+ * \param [in] field - the field to add to \a this. The field double values and mesh support are ignored.
+ * \param [in] arrOfVals - the values of the field \a field used.
+ * \param [in] mesh - the supporting mesh of \a field.
+ * \param [in] meshDimRelToMax - a relative dimension of mesh entities \a field lies on (useless if field spatial discretization is ON_NODES).
+ * \param [in] profile - ids of mesh entities on which corresponding field values lie.
+ * \throw If either \a field or \a mesh or \a profile has an empty name.
+ * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a mesh.
+ * \throw If the data array of \a field is not set.
+ * \throw If the data array of \a this is already allocated but has different number of
+ * components than \a field.
+ * \throw If elements in \a mesh are not in the order suitable for writing to the MED file.
+ * \sa setFieldNoProfileSBT()
+ */
+void MEDFileIntFieldMultiTS::appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile)
+{
+ MCAuto<MEDCouplingFieldDouble> field2(MEDFileIntField1TS::ConvertFieldIntToFieldDouble(field));
+ contentNotNull()->appendFieldProfile(field2,field->getArray(),mesh,meshDimRelToMax,profile,*this);
+}
+
/*!
* Adds a MEDCouplingFieldDouble to \a this as another time step.
* The mesh support of input parameter \a field is ignored here, it can be NULL.
#include "MCAuto.hxx"
#include "MEDCouplingRefCountObject.hxx"
+#include "MEDCouplingFieldInt.hxx"
#include "MEDCouplingMemArray.hxx"
#include "NormalizedUnstructuredMesh.hxx"
void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
void getDimension(int& dim) const;
+ bool isUniqueLevel(int& dim) const;
void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
void fillFieldSplitedByType(std::vector< std::pair<int,int> >& dads, std::vector<TypeOfField>& types, std::vector<std::string>& pfls, std::vector<std::string>& locs) const;
int getIteration() const;
void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(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;
void getDimension(int& dim) const;
+ bool isUniqueLevel(int& dim) const;
double getTime() const;
int getIteration() const;
int getOrder() const;
MEDLOADER_EXPORT virtual DataArray *getOrCreateAndGetArray() = 0;
MEDLOADER_EXPORT virtual const DataArray *getOrCreateAndGetArray() const = 0;
public:
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *fieldOnMesh(const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
MEDLOADER_EXPORT static MEDFileField1TS *New();
MEDLOADER_EXPORT MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const;
//
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
MEDLOADER_EXPORT MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *shallowCpy() const;
//
+ MEDLOADER_EXPORT MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
//
+ MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldInt *field);
MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals);
+ MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray() const;
public:
MEDLOADER_EXPORT static DataArrayInt *ReturnSafelyDataArrayInt(MCAuto<DataArray>& arr);
+ MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldInt> SetDataArrayDoubleInIntField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
+ MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f);
public:
MEDLOADER_EXPORT MEDFileIntField1TS *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
private:
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
//
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
MEDLOADER_EXPORT MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
//
+ MEDLOADER_EXPORT MEDCouplingFieldInt *field(int iteration, int order, const MEDFileMesh *mesh) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, DataArrayInt* &arrOut, int renumPol=0) const;
MEDLOADER_EXPORT DataArrayInt *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const;
//
+ MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field);
MEDLOADER_EXPORT void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals);
+ MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
MEDLOADER_EXPORT void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
//
MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray(int iteration, int order) const;
%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::buildNewEmpty;
%newobject MEDCoupling::MEDFileFieldMultiTS::New;
%newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
+%newobject MEDCoupling::MEDFileFieldMultiTS::field;
%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
%newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
%newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
+%newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
%newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
%newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::extractPart;
%newobject MEDCoupling::MEDFileField1TS::New;
+%newobject MEDCoupling::MEDFileField1TS::field;
%newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
%newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
%newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
%newobject MEDCoupling::MEDFileField1TS::convertToInt;
%newobject MEDCoupling::MEDFileIntField1TS::New;
+%newobject MEDCoupling::MEDFileIntField1TS::field;
%newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileField1TS *New();
MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
//
+ void setFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
+ void setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldInt *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileIntField1TS() throw(INTERP_KERNEL::Exception)
static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
//
+ MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
static MEDFileIntFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileIntFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
//
+ void appendFieldNoProfileSBT(const MEDCouplingFieldInt *field) throw(INTERP_KERNEL::Exception);
void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
+ void appendFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileIntFieldMultiTS()