reinterpret_cast<const unsigned char*>(_arr->getConstPointer()));
}
+void MEDFileFieldPerMeshPerTypePerDisc::getCoarseData(TypeOfField& type, const DataArrayDouble *& dad, std::string& pfl, std::string& loc) const throw(INTERP_KERNEL::Exception)
+{
+ type=_type;
+ pfl=_profile;
+ loc=_localization;
+ dad=_arr;
+}
+
int MEDFileFieldPerMeshPerTypePerDisc::ConvertType(TypeOfField type, int locId) throw(INTERP_KERNEL::Exception)
{
switch(type)
}
}
+void MEDFileFieldPerMeshPerType::fillFieldSplitedByType(std::vector<const DataArrayDouble *>& dads, std::vector<TypeOfField>& types, std::vector<std::string>& pfls, std::vector<std::string>& locs) const throw(INTERP_KERNEL::Exception)
+{
+ int sz=_field_pm_pt_pd.size();
+ dads.resize(sz); types.resize(sz); pfls.resize(sz); locs.resize(sz);
+ for(int i=0;i<sz;i++)
+ {
+ _field_pm_pt_pd[i]->getCoarseData(types[i],dads[i],pfls[i],locs[i]);
+ }
+}
+
int MEDFileFieldPerMeshPerType::getIteration() const
{
return _father->getIteration();
(*it)->fillTypesOfFieldAvailable(types);
}
+std::vector< std::vector<const DataArrayDouble *> > MEDFileFieldPerMesh::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 throw(INTERP_KERNEL::Exception)
+{
+ int sz=_field_pm_pt.size();
+ std::vector< std::vector<const DataArrayDouble *> > ret(sz);
+ types.resize(sz); typesF.resize(sz); pfls.resize(sz); locs.resize(sz);
+ for(int i=0;i<sz;i++)
+ {
+ types[i]=_field_pm_pt[i]->getGeoType();
+ _field_pm_pt[i]->fillFieldSplitedByType(ret[i],typesF[i],pfls[i],locs[i]);
+ }
+ return ret;
+}
+
double MEDFileFieldPerMesh::getTime() const
{
return _father->getTime();
return ret;
}
+/*!
+ * entry point for users that want to iterate into MEDFile DataStructure without any overhead.
+ */
+std::vector< std::vector<const DataArrayDouble *> > MEDFileField1TSWithoutDAS::getFieldSplitedByType(const char *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 throw(INTERP_KERNEL::Exception)
+{
+ int meshId=0;
+ if(mname)
+ meshId=getMeshIdFromMeshName(mname);
+ else
+ if(_field_per_mesh.empty())
+ throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutDAS::getFieldSplitedByType : This is empty !");
+ return _field_per_mesh[meshId]->getFieldSplitedByType(types,typesF,pfls,locs);
+}
+
void MEDFileField1TSWithoutDAS::finishLoading(med_idt fid) throw(INTERP_KERNEL::Exception)
{
med_int numdt,numit;
return ret;
}
+std::vector< std::vector<const DataArrayDouble *> > MEDFileFieldMultiTSWithoutDAS::getFieldSplitedByType(int iteration, int order, const char *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 throw(INTERP_KERNEL::Exception)
+{
+ return getTimeStepEntry(iteration,order).getFieldSplitedByType(mname,types,typesF,pfls,locs);
+}
+
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++)
void assignFieldProfile(const char *pflName, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, const MEDCouplingFieldDouble *field, const MEDCouplingMesh *mesh, MEDFieldFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
void assignNodeFieldNoProfile(const MEDCouplingFieldDouble *field, MEDFieldFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
void assignNodeFieldProfile(const char *pflName, const DataArrayInt *idsInPfl, const MEDCouplingFieldDouble *field, const MEDCouplingMesh *mesh, MEDFieldFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception);
+ void getCoarseData(TypeOfField& type, const DataArrayDouble *& dad, std::string& pfl, std::string& loc) const throw(INTERP_KERNEL::Exception);
void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
const MEDFileFieldPerMeshPerType *getFather() const;
int getIteration() const;
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);
+ void fillFieldSplitedByType(std::vector<const DataArrayDouble *>& dads, std::vector<TypeOfField>& types, std::vector<std::string>& pfls, std::vector<std::string>& locs) const throw(INTERP_KERNEL::Exception);
int getIteration() const;
int getOrder() const;
double getTime() const;
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);
+ std::vector< std::vector<const DataArrayDouble *> > 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 throw(INTERP_KERNEL::Exception);
void getDimension(int& dim) const;
double getTime() const;
int getIteration() const;
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);
+ std::vector< std::vector<const DataArrayDouble *> > getFieldSplitedByType(const char *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 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);
int getNumberOfTS() const;
std::vector< std::pair<int,int> > getIterations() const;
std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const throw(INTERP_KERNEL::Exception);
+ std::vector< std::vector<const DataArrayDouble *> > getFieldSplitedByType(int iteration, int order, const char *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 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);
{
std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
PyObject *ret2=PyList_New(ret.size());
- for(int i=0;i<ret.size();i++)
+ for(int i=0;i<(int)ret.size();i++)
PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
return ret2;
}
+
+ PyObject *getFieldSplitedByType(const char *mname=0) const throw(INTERP_KERNEL::Exception)
+ {
+ 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;
+ std::vector< std::vector<const DataArrayDouble *> > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
+ int sz=ret.size();
+ PyObject *ret2=PyList_New(sz);
+ for(int i=0;i<sz;i++)
+ {
+ const std::vector<const DataArrayDouble *>& dadsI=ret[i];
+ const std::vector<TypeOfField>& typesFI=typesF[i];
+ const std::vector<std::string>& pflsI=pfls[i];
+ const std::vector<std::string>& locsI=locs[i];
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
+ int sz2=ret[i].size();
+ PyObject *elt2=PyList_New(sz2);
+ for(int j=0;j<sz2;j++)
+ {
+ PyObject *elt3=PyTuple_New(4);
+ if(dadsI[j])
+ dadsI[j]->incrRef();
+ PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
+ PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
+ PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
+ PyList_SetItem(elt2,j,elt3);
+ }
+ PyTuple_SetItem(elt,1,elt2);
+ PyList_SetItem(ret2,i,elt);
+ }
+ return ret2;
+ }
}
};
{
std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
PyObject *ret2=PyList_New(ret.size());
- for(int i=0;i<ret.size();i++)
+ for(int i=0;i<(int)ret.size();i++)
{
const std::vector<TypeOfField>& rett=ret[i];
PyObject *ret3=PyList_New(rett.size());
- for(int j=0;j<rett.size();j++)
+ for(int j=0;j<(int)rett.size();j++)
PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
PyList_SetItem(ret2,i,ret3);
}
return ret2;
}
+
+ PyObject *getFieldSplitedByType(int iteration, int order, const char *mname=0) const throw(INTERP_KERNEL::Exception)
+ {
+ 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;
+ std::vector< std::vector<const DataArrayDouble *> > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
+ int sz=ret.size();
+ PyObject *ret2=PyList_New(sz);
+ for(int i=0;i<sz;i++)
+ {
+ const std::vector<const DataArrayDouble *>& dadsI=ret[i];
+ const std::vector<TypeOfField>& typesFI=typesF[i];
+ const std::vector<std::string>& pflsI=pfls[i];
+ const std::vector<std::string>& locsI=locs[i];
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
+ int sz2=ret[i].size();
+ PyObject *elt2=PyList_New(sz2);
+ for(int j=0;j<sz2;j++)
+ {
+ PyObject *elt3=PyTuple_New(4);
+ if(dadsI[j])
+ dadsI[j]->incrRef();
+ PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
+ PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
+ PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
+ PyList_SetItem(elt2,j,elt3);
+ }
+ PyTuple_SetItem(elt,1,elt2);
+ PyList_SetItem(ret2,i,elt);
+ }
+ return ret2;
+ }
}
};