}
}
+DataArrayDouble *MEDFileFieldPerMeshPerTypePerDisc::getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
+{
+ const DataArrayDouble *ret=_arr;
+ return const_cast<DataArrayDouble *>(ret);
+}
+
void MEDFileFieldPerMeshPerTypePerDisc::writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception)
{
TypeOfField type=getType();
(*it)->getFieldAtLevel(type,glob,dads,pfls,locs,geoTypes);
}
+DataArrayDouble *MEDFileFieldPerMeshPerType::getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
+{
+ if(_field_pm_pt_pd.size()!=1)
+ throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerType::getUndergroundDataArray : splitted MEDFileField*, this method has no sense !");
+ if(_field_pm_pt_pd[0]==0)
+ throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerType::getUndergroundDataArray : no field specified !");
+ return _field_pm_pt_pd[0]->getUndergroundDataArray();
+}
+
MEDFileFieldPerMeshPerType::MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception):_father(fath),_geo_type(geoType)
{
}
return 0;
}
+DataArrayDouble *MEDFileFieldPerMesh::getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
+{
+ if(_field_pm_pt.size()!=1)
+ throw INTERP_KERNEL::Exception("MEDFileFieldPerMesh::getUndergroundDataArray : splitted MEDFileField*, this method has no sense !");
+ if(_field_pm_pt[0]==0)
+ throw INTERP_KERNEL::Exception("MEDFileFieldPerMesh::getUndergroundDataArray : no field specified !");
+ return _field_pm_pt[0]->getUndergroundDataArray();
+}
+
int MEDFileFieldPerMesh::addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type)
{
int i=0;
return _field_per_mesh[meshId]->getFieldOnMeshAtLevelWithPfl(type,m,pfl,glob);
}
+/*!
+ * This method retrieves direct access to the underground ParaMEDMEM::DataArrayDouble instance.
+ * This method allows to the user a direct access to the values.
+ * This method throws an exception if 'this' is composed with multiple arrays due to cell type splitting (field on cells and field on gauss points).
+ */
+DataArrayDouble *MEDFileField1TSWithoutDAS::getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
+{
+ if(_field_per_mesh.size()!=1)
+ throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutDAS::getUndergroundDataArray : splitted MEDFileField*, this method has no sense !");
+ if(_field_per_mesh[0]==0)
+ throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutDAS::getUndergroundDataArray : no field specified !");
+ return _field_per_mesh[0]->getUndergroundDataArray();
+}
+
MEDFileField1TSWithoutDAS::MEDFileField1TSWithoutDAS(const char *fieldName, int csit, int iteration, int order,
const std::vector<std::string>& infos):_name(fieldName),_infos(infos),_csit(csit),_iteration(iteration),_order(order)
{
int getLocId() const { return _loc_id; }
void getFieldAtLevel(TypeOfField type, const MEDFieldFieldGlobsReal *glob, std::vector<const DataArrayDouble *>& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs,
std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
+ DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
static int ConvertType(TypeOfField type, int locId) throw(INTERP_KERNEL::Exception);
private:
MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, med_idt fid, TypeOfField type, int profileIt) throw(INTERP_KERNEL::Exception);
std::vector<std::string> getPflsReallyUsed() const;
std::vector<std::string> getLocsReallyUsed() const;
void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFieldFieldGlobsReal *glob, std::vector<const DataArrayDouble *>& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
+ DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
private:
std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells) throw(INTERP_KERNEL::Exception);
std::vector<std::string> getLocsReallyUsed() const;
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFieldFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl) const throw(INTERP_KERNEL::Exception);
DataArrayDouble *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFieldFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
private:
int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFieldFieldGlobsReal *glob,
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; }
+ std::vector<std::string>& getInfo() { return _infos; }
//
static MEDFileField1TSWithoutDAS *New(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
void finishLoading(med_idt fid) throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const char *mName, int renumPol, const MEDFieldFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFieldFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum) const throw(INTERP_KERNEL::Exception);
DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFieldFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
protected:
int addNewEntryIfNecessary(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
int getMeshIdFromMeshName(const char *mName) const throw(INTERP_KERNEL::Exception);
%newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
%newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
%newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
+%newobject ParaMEDMEM::MEDFileField1TSWithoutDAS::getUndergroundDataArray;
%newobject ParaMEDMEM::MEDFileField1TS::New;
%newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
%newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
}
return ret2;
}
+
+ DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayDouble *ret=self->getUndergroundDataArray();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
}
};
mm1.write(fname,2)
ff1=MEDFileField1TS.New()
ff1.setFieldNoProfileSBT(f1)
+ nv=1456.
+ da=ff1.getUndergroundDataArray().setIJ(0,0,nv)
ff1.write(fname,0)
f2=MEDLoader.ReadFieldNode(fname,f1.getMesh().getName(),0,f1.getName(),f1.getTime()[1],f1.getTime()[2])
+ self.assertTrue(not f1.isEqual(f2,1e-12,1e-12))
+ f1.getArray().setIJ(0,0,nv)
self.assertTrue(f1.isEqual(f2,1e-12,1e-12))
#
fname="Pyfile27.med"