double MEDFileFieldPerMesh::getTime() const
{
- return _father->getTime();
+ int tmp1,tmp2;
+ return _father->getTime(tmp1,tmp2);
}
int MEDFileFieldPerMesh::getIteration() const
const MEDFileField1TSWithoutDAS *f1ts=_time_steps[i];
if(f1ts)
{
- ret[i].first=f1ts->getIteration();
- ret[i].second=f1ts->getOrder();
- ret1[i]=f1ts->getTime();
+ ret1[i]=f1ts->getTime(ret[i].first,ret[i].second);
}
else
{
int getDimension() const;
int getIteration() const { return _iteration; }
int getOrder() const { return _order; }
- double getTime() const { return _dt; }
+ double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _dt; }
+ void setTime(double val, int iteration, int order) { _dt=val; _iteration=iteration; _order=order; }
std::string getName() const { return _name; }
const std::string& getDtUnit() const { return _dt_unit; }
std::string getMeshName() const throw(INTERP_KERNEL::Exception);
int getNumberOfComponents() const;
bool isDealingTS(int iteration, int order) const;
const std::vector<std::string>& getInfo() const;
+ void setTime(double val, int iteration, int order);
%extend
{
- PyObject *getDtIt() const
+ PyObject *getTime()
+ {
+ int tmp1,tmp2;
+ double tmp0=self->getTime(tmp1,tmp2);
+ PyObject *res = PyList_New(3);
+ PyList_SetItem(res,0,SWIG_From_double(tmp0));
+ PyList_SetItem(res,1,SWIG_From_int(tmp1));
+ PyList_SetItem(res,2,SWIG_From_int(tmp2));
+ return res;
+ }
+
+ PyObject *getDtIt() const
{
std::pair<int,int> res=self->getDtIt();
PyObject *elt=PyTuple_New(2);
ff1.setFieldNoProfileSBT(f1)
ff1.write(fname,0)
f2=MEDLoader.ReadFieldCell(fname,f1.getMesh().getName(),0,f1.getName(),f1.getTime()[1],f1.getTime()[2]);
+ ti,itt,orr=ff1.getTime()
+ self.assertEqual(0,itt); self.assertEqual(1,orr); self.assertAlmostEqual(2.,ti,14);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12))
+ ff1.setTime(2.3,3,4)
+ ti,itt,orr=ff1.getTime()
+ self.assertEqual(3,itt); self.assertEqual(4,orr); self.assertAlmostEqual(2.3,ti,14);
#
fname="Pyfile26.med"
f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1();