+void MEDCouplingTimeDiscretization::fillFromAnalyticNamedCompo(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
+{
+ std::vector<DataArrayDouble *> arrays;
+ getArrays(arrays);
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+ for(std::size_t j=0;j<arrays.size();j++)
+ arrays2[j]=loc->applyFuncNamedCompo(nbOfComp,varsOrder,func);
+ std::vector<DataArrayDouble *> arrays3(arrays.size());
+ for(std::size_t j=0;j<arrays.size();j++)
+ arrays3[j]=arrays2[j];
+ setArrays(arrays3,0);
+}
+
+////////////////////////
+
+bool MEDCouplingTimeKeeper::isEqualIfNotWhy(const MEDCouplingTimeKeeper& other, double prec, std::string& reason) const
+{
+ std::ostringstream oss;
+ if(_iteration!=other._iteration)
+ {
+ oss << "iterations differ. this iteration=" << _iteration << " other iteration=" << other._iteration;
+ reason=oss.str();
+ return false;
+ }
+ if(_order!=other._order)
+ {
+ oss << "orders differ. this order=" << _order << " other order=" << other._order;
+ reason=oss.str();
+ return false;
+ }
+ if(std::fabs(_time-other._time)>prec)
+ {
+ oss << "times differ. this time=" << _time << " other time=" << other._time;
+ reason=oss.str();
+ return false;
+ }
+ return true;
+}
+
+bool MEDCouplingTimeKeeper::isEqual(const MEDCouplingTimeKeeper& other, double prec) const
+{
+ if(_iteration!=other._iteration)
+ return false;
+ if(_order!=other._order)
+ return false;
+ if(std::fabs(_time-other._time)>prec)
+ return false;
+ return true;
+}
+
+void MEDCouplingTimeKeeper::copyFrom(const MEDCouplingTimeKeeper& other)
+{
+ _time=other._time;
+ _iteration=other._iteration;
+ _order=other._order;
+}
+
+void MEDCouplingTimeKeeper::checkTimePresence(double time, double eps) const
+{
+ if(std::fabs(time-_time)>eps)
+ {
+ std::ostringstream stream;
+ stream << "The field is defined on time " << _time << " with eps=" << eps << " and asking time = " << time << " !";
+ throw INTERP_KERNEL::Exception(stream.str().c_str());
+ }
+}
+
+////////////////////////
+
+MEDCouplingTimeDiscretizationInt::MEDCouplingTimeDiscretizationInt(const MEDCouplingTimeDiscretizationInt& other, bool deepCopy):MEDCouplingTimeDiscretizationSimple<int>(other,deepCopy)
+{
+}
+
+MEDCouplingTimeDiscretizationInt *MEDCouplingTimeDiscretizationInt::performCopyOrIncrRef(bool deepCopy) const
+{
+ return new MEDCouplingTimeDiscretizationInt(*this,deepCopy);
+}
+
+MEDCouplingTimeDiscretizationInt *MEDCouplingTimeDiscretizationInt::New(TypeOfTimeDiscretization type)
+{
+ switch(type)
+ {
+ case MEDCouplingTimeDiscretizationInt::DISCRETIZATION:
+ return new MEDCouplingTimeDiscretizationInt;
+ default:
+ throw INTERP_KERNEL::Exception("Time discretization not implemented yet for intergers !");
+ }
+}
+
+bool MEDCouplingTimeDiscretizationInt::isEqualIfNotWhy(const MEDCouplingTimeDiscretizationTemplate<int> *other, int prec, std::string& reason) const
+{
+ if(prec!=0)
+ throw INTERP_KERNEL::Exception("isEqualIfNotWhy : only precision equal to 0 supported for int !");
+ if(!other)
+ {
+ reason="Time discretization is NULL.";
+ return false;
+ }
+ const MEDCouplingTimeDiscretizationInt *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt *>(other));
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("isEqualIfNotWhy : other is not a MEDCouplingTimeDiscretizationInt !");
+ if(!MEDCouplingTimeDiscretizationTemplate<int>::areStrictlyCompatible(other,reason))
+ return false;
+ if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason))
+ return false;
+ if(_array==other->getArray())
+ return true;
+ return _array->isEqualIfNotWhy(*other->getArray(),reason);
+}
+
+bool MEDCouplingTimeDiscretizationInt::isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretizationTemplate<int> *other, int prec) const
+{
+ if(prec!=0)
+ throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretizationInt::isEqualWithoutConsideringStr : only precision 0 is supported !");
+ const MEDCouplingTimeDiscretizationInt *otherC(dynamic_cast<const MEDCouplingTimeDiscretizationInt *>(other));
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("isEqualWithoutConsideringStr : other is not a MEDCouplingTimeDiscretizationInt !");
+ std::string tmp;
+ if(!areStrictlyCompatible(other,tmp))
+ return false;
+ std::string reason;
+ if(!_tk.isEqualIfNotWhy(otherC->_tk,_time_tolerance,reason))
+ return false;
+ if(_array==other->getArray())
+ return true;
+ return _array->isEqualWithoutConsideringStr(*(other->getArray()));
+}
+
+////////////////////////