return _type;
}
+void MEDFileFieldPerMeshPerTypePerDisc::fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const throw(INTERP_KERNEL::Exception)
+{
+ types.insert(_type);
+}
+
void MEDFileFieldPerMeshPerTypePerDisc::setType(TypeOfField newType)
{
_type=newType;
dim=std::max(dim,curDim);
}
+void MEDFileFieldPerMeshPerType::fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const throw(INTERP_KERNEL::Exception)
+{
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ {
+ (*it)->fillTypesOfFieldAvailable(types);
+ }
+}
+
int MEDFileFieldPerMeshPerType::getIteration() const
{
return _father->getIteration();
(*it)->getDimension(dim);
}
+void MEDFileFieldPerMesh::fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const throw(INTERP_KERNEL::Exception)
+{
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ (*it)->fillTypesOfFieldAvailable(types);
+}
+
double MEDFileFieldPerMesh::getTime() const
{
return _father->getTime();
p.second=_order;
}
+void MEDFileField1TSWithoutDAS::fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const throw(INTERP_KERNEL::Exception)
+{
+ std::set<TypeOfField> types2;
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ {
+ (*it)->fillTypesOfFieldAvailable(types2);
+ }
+ std::back_insert_iterator< std::vector<TypeOfField> > bi(types);
+ std::copy(types2.begin(),types2.end(),bi);
+}
+
+std::vector<TypeOfField> MEDFileField1TSWithoutDAS::getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
+{
+ std::vector<TypeOfField> ret;
+ fillTypesOfFieldAvailable(ret);
+ return ret;
+}
+
void MEDFileField1TSWithoutDAS::finishLoading(med_idt fid) throw(INTERP_KERNEL::Exception)
{
med_int numdt,numit;
return ret;
}
+std::vector< std::vector<TypeOfField> > MEDFileFieldMultiTSWithoutDAS::getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
+{
+ int lgth=_time_steps.size();
+ std::vector< std::vector<TypeOfField> > ret(lgth);
+ for(int i=0;i<lgth;i++)
+ _time_steps[i]->fillTypesOfFieldAvailable(ret[i]);
+ return ret;
+}
+
const MEDFileField1TSWithoutDAS& MEDFileFieldMultiTSWithoutDAS::getTimeStepEntry(int iteration, int order) const throw(INTERP_KERNEL::Exception)
{
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSWithoutDAS> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
std::string getName() const;
std::string getMeshName() const;
TypeOfField getType() const;
+ void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const throw(INTERP_KERNEL::Exception);
void setType(TypeOfField newType);
INTERP_KERNEL::NormalizedCellType getGeoType() const;
int getNumberOfComponents() const;
void finishLoading(med_idt fid, TypeOfField type) throw(INTERP_KERNEL::Exception);
void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
void getDimension(int& dim) const;
+ void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const throw(INTERP_KERNEL::Exception);
int getIteration() const;
int getOrder() const;
double getTime() const;
void assignNodeFieldProfile(const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
void finishLoading(med_idt fid) throw(INTERP_KERNEL::Exception);
void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
+ void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const throw(INTERP_KERNEL::Exception);
void getDimension(int& dim) const;
double getTime() const;
int getIteration() const;
bool isDealingTS(int iteration, int order) const;
std::pair<int,int> getDtIt() const;
void fillIteration(std::pair<int,int>& p) const;
+ void fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const throw(INTERP_KERNEL::Exception);
const std::vector<std::string>& getInfo() const { return _infos; }
//
static MEDFileField1TSWithoutDAS *New(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, MEDFieldFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFieldFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
public:
+ std::vector<TypeOfField> getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const char *mName, int renumPol, const MEDFieldFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFieldFieldGlobsReal *glob, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const char *mName, int renumPol, const MEDFieldFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception);
static MEDFileFieldMultiTSWithoutDAS *New(med_idt fid, const char *fieldName, int id, const std::vector<std::string>& infos, int nbOfStep) throw(INTERP_KERNEL::Exception);
int getNumberOfTS() const;
std::vector< std::pair<int,int> > getIterations() const;
+ std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception);
void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
std::string getName() const;
std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const throw(INTERP_KERNEL::Exception);
PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
return elt;
}
+
+ PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
+ PyObject *ret2=PyList_New(ret.size());
+ for(int i=0;i<ret.size();i++)
+ PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
+ return ret2;
+ }
}
};
}
return ret2;
}
+
+ PyObject *getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
+ PyObject *ret2=PyList_New(ret.size());
+ for(int i=0;i<ret.size();i++)
+ {
+ const std::vector<TypeOfField>& rett=ret[i];
+ PyObject *ret3=PyList_New(rett.size());
+ for(int j=0;j<rett.size();j++)
+ PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
+ PyList_SetItem(ret2,i,ret3);
+ }
+ return ret2;
+ }
}
};
self.assertTrue(vals.isEqual(d,1e-14))
#
ff2=MEDFileField1TS.New(fname,f1.getName(),-1,-1)
+ self.assertEqual([0],ff2.getTypesOfFieldAvailable())
vals,pfl=ff2.getFieldWithProfile(ON_CELLS,0,mm1)
self.assertTrue(pfl.isEqualWithoutConsideringStr(da))
self.assertTrue(vals.isEqual(d,1e-14))
vals,pfl=ff1.getFieldWithProfile(ON_GAUSS_NE,1,2,0,mm1)
self.assertTrue(pfl.isEqualWithoutConsideringStr(da))
self.assertTrue(vals.isEqual(e,1e-14))
+ self.assertEqual([[3],[3]],ff1.getTypesOfFieldAvailable())
#
ff2=MEDFileFieldMultiTS.New(fname,f1.getName())
vals,pfl=ff1.getFieldWithProfile(ON_GAUSS_NE,-1,-1,0,mm1)