Salome HOME
Ensure sequential run of MEDLoader 1,2,3 tests.
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingTimeDiscretization.cxx
index 7712aa874d4354f56f4764b5a902054fae09e6ad..b2064b5fdfb71d5287df817ae2454d0896df6eba 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,8 +19,9 @@
 // Author : Anthony Geay (CEA/DEN)
 
 #include "MEDCouplingTimeDiscretization.hxx"
+#include "MCAuto.hxx"
 #include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MEDCouplingMesh.hxx"
 
 #include <cmath>
 #include <sstream>
@@ -28,7 +29,7 @@
 #include <algorithm>
 #include <functional>
 
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 
 const double MEDCouplingTimeDiscretization::TIME_TOLERANCE_DFT=1.e-12;
 
@@ -51,7 +52,7 @@ const char MEDCouplingLinearTime::REPR[]="Linear time between 2 time steps.";
 MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::New(TypeOfTimeDiscretization type)
 {
   switch(type)
-    {
+  {
     case MEDCouplingNoTimeLabel::DISCRETIZATION:
       return new MEDCouplingNoTimeLabel;
     case MEDCouplingWithTimeStep::DISCRETIZATION:
@@ -62,10 +63,10 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::New(TypeOfTimeDisc
       return new MEDCouplingLinearTime;
     default:
       throw INTERP_KERNEL::Exception("Time discretization not implemented yet");
-    }
+  }
 }
 
-void MEDCouplingTimeDiscretization::copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTimeDiscretization::copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other)
 {
   _time_tolerance=other._time_tolerance;
   _time_unit=other._time_unit;
@@ -78,7 +79,7 @@ void MEDCouplingTimeDiscretization::copyTinyStringsFrom(const MEDCouplingTimeDis
     _array->copyStringInfoFrom(*other._array);
 }
 
-void MEDCouplingTimeDiscretization::checkCoherency() const throw(INTERP_KERNEL::Exception)
+void MEDCouplingTimeDiscretization::checkConsistencyLight() const
 {
   if(!_array)
     throw INTERP_KERNEL::Exception("Field invalid because no values set !");
@@ -92,6 +93,19 @@ void MEDCouplingTimeDiscretization::updateTime() const
     updateTimeWith(*_array);
 }
 
+std::size_t MEDCouplingTimeDiscretization::getHeapMemorySizeWithoutChildren() const
+{
+  std::size_t ret(_time_unit.capacity());
+  return ret;
+}
+
+std::vector<const BigMemoryObject *> MEDCouplingTimeDiscretization::getDirectChildrenWithNull() const
+{
+  std::vector<const BigMemoryObject *> ret;
+  ret.push_back(_array);
+  return ret;
+}
+
 bool MEDCouplingTimeDiscretization::areCompatible(const MEDCouplingTimeDiscretization *other) const
 {
   if(std::fabs(_time_tolerance-other->_time_tolerance)>1.e-16)
@@ -203,14 +217,14 @@ bool MEDCouplingTimeDiscretization::isEqualWithoutConsideringStr(const MEDCoupli
   return _array->isEqualWithoutConsideringStr(*other->_array,prec);
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCpy) const
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCopy) const
 {
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(type);
   ret->setTimeUnit(getTimeUnit());
   const DataArrayDouble *arrSrc=getArray();
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr;
+  MCAuto<DataArrayDouble> arr;
   if(arrSrc)
-    arr=arrSrc->performCpy(deepCpy);
+    arr=arrSrc->performCopyOrIncrRef(deepCopy);
   ret->setArray(arr,0);
   return ret;
 }
@@ -244,12 +258,30 @@ void MEDCouplingTimeDiscretization::resizeForUnserialization(const std::vector<i
   arrays[0]=arr;
 }
 
+void MEDCouplingTimeDiscretization::checkForUnserialization(const std::vector<int>& tinyInfoI, const std::vector<DataArrayDouble *>& arrays)
+{
+  static const char MSG[]="MEDCouplingTimeDiscretization::checkForUnserialization : arrays in input is expected to have size one !";
+  if(arrays.size()!=1)
+    throw INTERP_KERNEL::Exception(MSG);
+  if(_array!=0)
+    _array->decrRef();
+  _array=0;
+  if(tinyInfoI[0]!=-1 && tinyInfoI[1]!=-1)
+    {
+      if(!arrays[0])
+        throw INTERP_KERNEL::Exception(MSG);
+      arrays[0]->checkNbOfTuplesAndComp(tinyInfoI[0],tinyInfoI[1],MSG);
+      _array=arrays[0];
+      _array->incrRef();
+    }
+}
+
 void MEDCouplingTimeDiscretization::finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD, const std::vector<std::string>& tinyInfoS)
 {
   _time_tolerance=tinyInfoD[0];
   int nbOfCompo=_array->getNumberOfComponents();
   for(int i=0;i<nbOfCompo;i++)
-    _array->setInfoOnComponent(i,tinyInfoS[i].c_str());
+    _array->setInfoOnComponent(i,tinyInfoS[i]);
 }
 
 void MEDCouplingTimeDiscretization::getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const
@@ -268,10 +300,10 @@ MEDCouplingTimeDiscretization::MEDCouplingTimeDiscretization():_time_tolerance(T
 {
 }
 
-MEDCouplingTimeDiscretization::MEDCouplingTimeDiscretization(const MEDCouplingTimeDiscretization& other, bool deepCpy):_time_unit(other._time_unit),_time_tolerance(other._time_tolerance)
+MEDCouplingTimeDiscretization::MEDCouplingTimeDiscretization(const MEDCouplingTimeDiscretization& other, bool deepCopy):_time_unit(other._time_unit),_time_tolerance(other._time_tolerance)
 {
   if(other._array)
-    _array=other._array->performCpy(deepCpy);
+    _array=other._array->performCopyOrIncrRef(deepCopy);
   else
     _array=0;
 }
@@ -311,7 +343,7 @@ void MEDCouplingTimeDiscretization::setEndArray(DataArrayDouble *array, TimeLabe
   throw INTERP_KERNEL::Exception("setEndArray not available for this type of time discretization !");
 }
 
-void MEDCouplingTimeDiscretization::setArrays(const std::vector<DataArrayDouble *>& arrays, TimeLabel *owner) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTimeDiscretization::setArrays(const std::vector<DataArrayDouble *>& arrays, TimeLabel *owner)
 {
   if(arrays.size()!=1)
     throw INTERP_KERNEL::Exception("MEDCouplingTimeDiscretization::setArrays : number of arrays must be one.");
@@ -324,7 +356,7 @@ void MEDCouplingTimeDiscretization::getArrays(std::vector<DataArrayDouble *>& ar
   arrays[0]=_array;
 }
 
-bool MEDCouplingTimeDiscretization::isBefore(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception)
+bool MEDCouplingTimeDiscretization::isBefore(const MEDCouplingTimeDiscretization *other) const
 {
   int iteration,order;
   double time1=getEndTime(iteration,order)-_time_tolerance;
@@ -332,7 +364,7 @@ bool MEDCouplingTimeDiscretization::isBefore(const MEDCouplingTimeDiscretization
   return time1<=time2;
 }
 
-bool MEDCouplingTimeDiscretization::isStrictlyBefore(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception)
+bool MEDCouplingTimeDiscretization::isStrictlyBefore(const MEDCouplingTimeDiscretization *other) const
 {
   int iteration,order;
   double time1=getEndTime(iteration,order)+_time_tolerance;
@@ -340,14 +372,14 @@ bool MEDCouplingTimeDiscretization::isStrictlyBefore(const MEDCouplingTimeDiscre
   return time1<time2;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::doublyContractedProduct() const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::doublyContractedProduct() const
 {
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->doublyContractedProduct();
@@ -355,18 +387,18 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::doublyContractedPr
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   ret->setArrays(arrays3,0);
   return ret;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::determinant() const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::determinant() const
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->determinant();
@@ -374,7 +406,7 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::determinant() cons
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
@@ -382,12 +414,12 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::determinant() cons
   return ret;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::eigenValues() const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::eigenValues() const
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->eigenValues();
@@ -395,7 +427,7 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::eigenValues() cons
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
@@ -403,12 +435,12 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::eigenValues() cons
   return ret;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::eigenVectors() const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::eigenVectors() const
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->eigenVectors();
@@ -416,7 +448,7 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::eigenVectors() con
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
@@ -424,12 +456,12 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::eigenVectors() con
   return ret;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::inverse() const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::inverse() const
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->inverse();
@@ -437,7 +469,7 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::inverse() const th
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
@@ -445,12 +477,12 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::inverse() const th
   return ret;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::trace() const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::trace() const
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->trace();
@@ -458,7 +490,7 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::trace() const thro
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
@@ -466,12 +498,12 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::trace() const thro
   return ret;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::deviator() const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::deviator() const
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->deviator();
@@ -479,7 +511,7 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::deviator() const t
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
@@ -487,12 +519,12 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::deviator() const t
   return ret;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::magnitude() const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::magnitude() const
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->magnitude();
@@ -500,7 +532,28 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::magnitude() const
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
+    arrays3[j]=arrays2[j];
+  MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
+  ret->setTimeUnit(getTimeUnit());
+  ret->setArrays(arrays3,0);
+  return ret;
+}
+
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::negate() const
+{
+  std::vector<DataArrayDouble *> arrays;
+  getArrays(arrays);
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
+    {
+      if(arrays[j])
+        arrays2[j]=arrays[j]->negate();
+      else
+        arrays2[j]=0;
+    }
+  std::vector<DataArrayDouble *> arrays3(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
@@ -508,12 +561,12 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::magnitude() const
   return ret;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::maxPerTuple() const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::maxPerTuple() const
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->maxPerTuple();
@@ -521,7 +574,7 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::maxPerTuple() cons
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
@@ -529,20 +582,20 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::maxPerTuple() cons
   return ret;
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::keepSelectedComponents(const std::vector<int>& compoIds) const
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
-        arrays2[j]=arrays[j]->keepSelectedComponents(compoIds);
+        arrays2[j]=static_cast<DataArrayDouble *>(arrays[j]->keepSelectedComponents(compoIds));
       else
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
   ret->setTimeUnit(getTimeUnit());
@@ -550,14 +603,14 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::keepSelectedCompon
   return ret;
 }
 
-void MEDCouplingTimeDiscretization::setSelectedComponents(const MEDCouplingTimeDiscretization *other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTimeDiscretization::setSelectedComponents(const MEDCouplingTimeDiscretization *other, const std::vector<int>& compoIds)
 {
   std::vector<DataArrayDouble *> arrays1,arrays2;
   getArrays(arrays1);
   other->getArrays(arrays2);
   if(arrays1.size()!=arrays2.size())
     throw INTERP_KERNEL::Exception("TimeDiscretization::setSelectedComponents : number of arrays mismatch !");
-  for(unsigned int i=0;i<arrays1.size();i++)
+  for(std::size_t i=0;i<arrays1.size();i++)
     {
       if(arrays1[i]!=0 && arrays2[i]!=0)
         arrays1[i]->setSelectedComponents(arrays2[i],compoIds);
@@ -566,12 +619,12 @@ void MEDCouplingTimeDiscretization::setSelectedComponents(const MEDCouplingTimeD
     }
 }
 
-void MEDCouplingTimeDiscretization::changeNbOfComponents(int newNbOfComp, double dftValue) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTimeDiscretization::changeNbOfComponents(int newNbOfComp, double dftValue)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->changeNbOfComponents(newNbOfComp,dftValue);
@@ -579,16 +632,16 @@ void MEDCouplingTimeDiscretization::changeNbOfComponents(int newNbOfComp, double
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
-void MEDCouplingTimeDiscretization::sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTimeDiscretization::sortPerTuple(bool asc)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays[j]->sortPerTuple(asc);
@@ -599,46 +652,85 @@ void MEDCouplingTimeDiscretization::setUniformValue(int nbOfTuple, int nbOfCompo
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         {
-          arrays[j]->incrRef();
-          arrays[j]->fillWithValue(value);
-          arrays2[j]=arrays[j];
+          arrays2[j]=arrays[j]->changeNbOfComponents(nbOfCompo,value);
+          arrays2[j]->fillWithValue(value);
         }
       else
         {
-          DataArrayDouble *tmp=DataArrayDouble::New();
-          tmp->alloc(nbOfTuple,nbOfCompo);
-          tmp->fillWithValue(value);
-          arrays2[j]=tmp;
+          arrays2[j]=DataArrayDouble::New();
+          arrays2[j]->alloc(nbOfTuple,nbOfCompo);
+          arrays2[j]->fillWithValue(value);
         }
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
+void MEDCouplingTimeDiscretization::setOrCreateUniformValueOnAllComponents(int nbOfTuple, double value)
+{
+  std::vector<DataArrayDouble *> arrays;
+  getArrays(arrays);
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  bool newArr=false;
+  for(std::size_t j=0;j<arrays.size();j++)
+    {
+      if(arrays[j])
+        {
+          arrays2[j]=arrays[j]; arrays2[j]->incrRef();
+          arrays2[j]->fillWithValue(value);
+        }
+      else
+        {
+          newArr=true;
+          arrays2[j]=DataArrayDouble::New();
+          arrays2[j]->alloc(nbOfTuple,1);
+          arrays2[j]->fillWithValue(value);
+        }
+    }
+  if(newArr)
+    {
+      std::vector<DataArrayDouble *> arrays3(arrays.size());
+      for(std::size_t j=0;j<arrays.size();j++)
+        arrays3[j]=arrays2[j];
+      setArrays(arrays3,0);
+    }
+}
+
 void MEDCouplingTimeDiscretization::applyLin(double a, double b, int compoId)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays[j]->applyLin(a,b,compoId);
     }
 }
 
+void MEDCouplingTimeDiscretization::applyLin(double a, double b)
+{
+  std::vector<DataArrayDouble *> arrays;
+  getArrays(arrays);
+  for(std::size_t j=0;j<arrays.size();j++)
+    {
+      if(arrays[j])
+        arrays[j]->applyLin(a,b);
+    }
+}
+
 void MEDCouplingTimeDiscretization::applyFunc(int nbOfComp, FunctionToEvaluate func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->applyFunc(nbOfComp,func);
@@ -646,17 +738,17 @@ void MEDCouplingTimeDiscretization::applyFunc(int nbOfComp, FunctionToEvaluate f
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
-void MEDCouplingTimeDiscretization::applyFunc(int nbOfComp, const char *func)
+void MEDCouplingTimeDiscretization::applyFunc(int nbOfComp, const std::string& func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->applyFunc(nbOfComp,func);
@@ -664,53 +756,53 @@ void MEDCouplingTimeDiscretization::applyFunc(int nbOfComp, const char *func)
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
-void MEDCouplingTimeDiscretization::applyFunc2(int nbOfComp, const char *func)
+void MEDCouplingTimeDiscretization::applyFuncCompo(int nbOfComp, const std::string& func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
-        arrays2[j]=arrays[j]->applyFunc2(nbOfComp,func);
+        arrays2[j]=arrays[j]->applyFuncCompo(nbOfComp,func);
       else
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
-void MEDCouplingTimeDiscretization::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func)
+void MEDCouplingTimeDiscretization::applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
-        arrays2[j]=arrays[j]->applyFunc3(nbOfComp,varsOrder,func);
+        arrays2[j]=arrays[j]->applyFuncNamedCompo(nbOfComp,varsOrder,func);
       else
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
-void MEDCouplingTimeDiscretization::applyFunc(const char *func)
+void MEDCouplingTimeDiscretization::applyFunc(const std::string& func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays2[j]=arrays[j]->applyFunc(func);
@@ -718,81 +810,81 @@ void MEDCouplingTimeDiscretization::applyFunc(const char *func)
         arrays2[j]=0;
     }
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
-void MEDCouplingTimeDiscretization::applyFuncFast32(const char *func)
+void MEDCouplingTimeDiscretization::applyFuncFast32(const std::string& func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays[j]->applyFuncFast32(func);
     }
 }
 
-void MEDCouplingTimeDiscretization::applyFuncFast64(const char *func)
+void MEDCouplingTimeDiscretization::applyFuncFast64(const std::string& func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     {
       if(arrays[j])
         arrays[j]->applyFuncFast64(func);
     }
 }
 
-void MEDCouplingTimeDiscretization::fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, FunctionToEvaluate func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTimeDiscretization::fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, FunctionToEvaluate func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays2[j]=loc->applyFunc(nbOfComp,func);
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
-void MEDCouplingTimeDiscretization::fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTimeDiscretization::fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const std::string& func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays2[j]=loc->applyFunc(nbOfComp,func);
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
-void MEDCouplingTimeDiscretization::fillFromAnalytic2(const DataArrayDouble *loc, int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTimeDiscretization::fillFromAnalyticCompo(const DataArrayDouble *loc, int nbOfComp, const std::string& func)
 {
   std::vector<DataArrayDouble *> arrays;
   getArrays(arrays);
-  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
-    arrays2[j]=loc->applyFunc2(nbOfComp,func);
+  std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
+  for(std::size_t j=0;j<arrays.size();j++)
+    arrays2[j]=loc->applyFuncCompo(nbOfComp,func);
   std::vector<DataArrayDouble *> arrays3(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
 
-void MEDCouplingTimeDiscretization::fillFromAnalytic3(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception)
+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< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
-  for(int j=0;j<(int)arrays.size();j++)
-    arrays2[j]=loc->applyFunc3(nbOfComp,varsOrder,func);
+  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(int j=0;j<(int)arrays.size();j++)
+  for(std::size_t j=0;j<arrays.size();j++)
     arrays3[j]=arrays2[j];
   setArrays(arrays3,0);
 }
@@ -801,7 +893,7 @@ MEDCouplingNoTimeLabel::MEDCouplingNoTimeLabel()
 {
 }
 
-MEDCouplingNoTimeLabel::MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCpy):MEDCouplingTimeDiscretization(other,deepCpy)
+MEDCouplingNoTimeLabel::MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCopy):MEDCouplingTimeDiscretization(other,deepCopy)
 {
 }
 
@@ -813,6 +905,11 @@ std::string MEDCouplingNoTimeLabel::getStringRepr() const
   return stream.str();
 }
 
+void MEDCouplingNoTimeLabel::synchronizeTimeWith(const MEDCouplingMesh *mesh)
+{
+  throw INTERP_KERNEL::Exception("MEDCouplingNoTimeLabel::synchronizeTimeWith : impossible to synchronize time with a MEDCouplingMesh because the time discretization is incompatible with it !");
+}
+
 bool MEDCouplingNoTimeLabel::areCompatible(const MEDCouplingTimeDiscretization *other) const
 {
   if(!MEDCouplingTimeDiscretization::areCompatible(other))
@@ -880,7 +977,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::aggregate(const MEDCoupli
   const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("NoTimeLabel::aggregation on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -897,7 +994,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::aggregate(const std::vect
         throw INTERP_KERNEL::Exception("NoTimeLabel::aggregate on mismatched time discretization !");
       a[i]=itC->getArray();
     }
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -908,7 +1005,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::meld(const MEDCouplingTim
   const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("NoTimeLabel::meld on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setTimeTolerance(getTimeTolerance());
   ret->setArray(arr,0);
@@ -920,7 +1017,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::dot(const MEDCouplingTime
   const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("NoTimeLabel::dot on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -931,7 +1028,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::crossProduct(const MEDCou
   const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("NoTimeLabel::crossProduct on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -942,7 +1039,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::max(const MEDCouplingTime
   const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("NoTimeLabel::max on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -953,7 +1050,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::min(const MEDCouplingTime
   const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("NoTimeLabel::max on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -964,7 +1061,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::add(const MEDCouplingTime
   const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("NoTimeLabel::add on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -987,7 +1084,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::substract(const MEDCoupli
     throw INTERP_KERNEL::Exception("NoTimeLabel::substract on mismatched time discretization !");
   if(!getArray())
     throw INTERP_KERNEL::Exception("MEDCouplingNoTimeLabel::substract : Data Array is NULL !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -1008,7 +1105,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::multiply(const MEDCouplin
   const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("NoTimeLabel::multiply on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -1029,7 +1126,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::divide(const MEDCouplingT
   const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("divide on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
   MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
   ret->setArray(arr,0);
   return ret;
@@ -1045,17 +1142,38 @@ void MEDCouplingNoTimeLabel::divideEqual(const MEDCouplingTimeDiscretization *ot
   getArray()->divideEqual(other->getArray());
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::performCpy(bool deepCpy) const
+MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::pow(const MEDCouplingTimeDiscretization *other) const
+{
+  const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
+  if(!otherC)
+    throw INTERP_KERNEL::Exception("pow on mismatched time discretization !");
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
+  MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
+  ret->setArray(arr,0);
+  return ret;
+}
+
+void MEDCouplingNoTimeLabel::powEqual(const MEDCouplingTimeDiscretization *other)
+{
+  const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
+  if(!otherC)
+    throw INTERP_KERNEL::Exception("NoTimeLabel::powEqual on mismatched time discretization !");
+  if(!getArray())
+    throw INTERP_KERNEL::Exception("MEDCouplingNoTimeLabel::powEqual : Data Array is NULL !");
+  getArray()->powEqual(other->getArray());
+}
+
+MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::performCopyOrIncrRef(bool deepCopy) const
 {
-  return new MEDCouplingNoTimeLabel(*this,deepCpy);
+  return new MEDCouplingNoTimeLabel(*this,deepCopy);
 }
 
-void MEDCouplingNoTimeLabel::checkTimePresence(double time) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::checkTimePresence(double time) const
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-std::vector< const DataArrayDouble *> MEDCouplingNoTimeLabel::getArraysForTime(double time) const throw(INTERP_KERNEL::Exception)
+std::vector< const DataArrayDouble *> MEDCouplingNoTimeLabel::getArraysForTime(double time) const
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
@@ -1065,72 +1183,72 @@ void MEDCouplingNoTimeLabel::getValueForTime(double time, const std::vector<doub
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-bool MEDCouplingNoTimeLabel::isBefore(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception)
+bool MEDCouplingNoTimeLabel::isBefore(const MEDCouplingTimeDiscretization *other) const
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-bool MEDCouplingNoTimeLabel::isStrictlyBefore(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception)
+bool MEDCouplingNoTimeLabel::isStrictlyBefore(const MEDCouplingTimeDiscretization *other) const
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-double MEDCouplingNoTimeLabel::getStartTime(int& iteration, int& order) const throw(INTERP_KERNEL::Exception)
+double MEDCouplingNoTimeLabel::getStartTime(int& iteration, int& order) const
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-double MEDCouplingNoTimeLabel::getEndTime(int& iteration, int& order) const throw(INTERP_KERNEL::Exception)
+double MEDCouplingNoTimeLabel::getEndTime(int& iteration, int& order) const
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::setStartIteration(int it) throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::setStartIteration(int it)
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::setEndIteration(int it) throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::setEndIteration(int it)
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::setStartOrder(int order) throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::setStartOrder(int order)
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::setEndOrder(int order) throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::setEndOrder(int order)
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::setStartTimeValue(double time) throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::setStartTimeValue(double time)
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::setEndTimeValue(double time) throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::setEndTimeValue(double time)
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::setStartTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::setStartTime(double time, int iteration, int order)
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::setEndTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::setEndTime(double time, int iteration, int order)
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::getValueOnTime(int eltId, double time, double *value) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::getValueOnTime(int eltId, double time, double *value) const
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingNoTimeLabel::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingNoTimeLabel::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const
 {
   throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
@@ -1160,8 +1278,8 @@ void MEDCouplingNoTimeLabel::finishUnserialization2(const std::vector<int>& tiny
   _time_tolerance=tinyInfoD[0];
 }
 
-MEDCouplingWithTimeStep::MEDCouplingWithTimeStep(const MEDCouplingWithTimeStep& other, bool deepCpy):MEDCouplingTimeDiscretization(other,deepCpy),
-                                                                                                     _time(other._time),_iteration(other._iteration),_order(other._order)
+MEDCouplingWithTimeStep::MEDCouplingWithTimeStep(const MEDCouplingWithTimeStep& other, bool deepCopy):MEDCouplingTimeDiscretization(other,deepCopy),
+    _time(other._time),_iteration(other._iteration),_order(other._order)
 {
 }
 
@@ -1177,6 +1295,17 @@ std::string MEDCouplingWithTimeStep::getStringRepr() const
   return stream.str();
 }
 
+void MEDCouplingWithTimeStep::synchronizeTimeWith(const MEDCouplingMesh *mesh)
+{
+  if(!mesh)
+    throw INTERP_KERNEL::Exception("MEDCouplingWithTimeStep::synchronizeTimeWith : mesh instance is NULL ! Impossible to synchronize time !");
+  int it=-1,order=-1;
+  double val=mesh->getTime(it,order);
+  _time=val; _iteration=it; _order=order;
+  std::string tUnit=mesh->getTimeUnit();
+  _time_unit=tUnit;
+}
+
 void MEDCouplingWithTimeStep::getTinySerializationIntInformation(std::vector<int>& tinyInfo) const
 {
   MEDCouplingTimeDiscretization::getTinySerializationIntInformation(tinyInfo);
@@ -1316,7 +1445,7 @@ bool MEDCouplingWithTimeStep::isEqualWithoutConsideringStr(const MEDCouplingTime
   return MEDCouplingTimeDiscretization::isEqualWithoutConsideringStr(other,prec);
 }
 
-void MEDCouplingWithTimeStep::copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception)
+void MEDCouplingWithTimeStep::copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other)
 {
   MEDCouplingTimeDiscretization::copyTinyAttrFrom(other);
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(&other);
@@ -1332,7 +1461,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::aggregate(const MEDCoupl
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::aggregation on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   return ret;
@@ -1349,7 +1478,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::aggregate(const std::vec
         throw INTERP_KERNEL::Exception("WithTimeStep::aggregate on mismatched time discretization !");
       a[i]=itC->getArray();
     }
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   return ret;
@@ -1360,7 +1489,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::meld(const MEDCouplingTi
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::meld on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   return ret;
@@ -1372,7 +1501,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::dot(const MEDCouplingTim
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::dot on mismatched time discretization !");
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
   ret->setArray(arr,0);
   return ret;
 }
@@ -1382,7 +1511,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::crossProduct(const MEDCo
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::crossProduct on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   return ret;
@@ -1393,7 +1522,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::max(const MEDCouplingTim
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::max on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   return ret;
@@ -1404,7 +1533,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::min(const MEDCouplingTim
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::min on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   return ret;
@@ -1415,7 +1544,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::add(const MEDCouplingTim
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::add on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   int tmp1,tmp2;
@@ -1439,7 +1568,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::substract(const MEDCoupl
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::substract on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   int tmp1,tmp2;
@@ -1463,7 +1592,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::multiply(const MEDCoupli
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::multiply on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   int tmp1,tmp2;
@@ -1487,7 +1616,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::divide(const MEDCoupling
   const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("WithTimeStep::divide on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
   MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
   ret->setArray(arr,0);
   int tmp1,tmp2;
@@ -1506,17 +1635,41 @@ void MEDCouplingWithTimeStep::divideEqual(const MEDCouplingTimeDiscretization *o
   getArray()->divideEqual(other->getArray());
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::performCpy(bool deepCpy) const
+MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::pow(const MEDCouplingTimeDiscretization *other) const
+{
+  const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
+  if(!otherC)
+    throw INTERP_KERNEL::Exception("WithTimeStep::pow on mismatched time discretization !");
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
+  MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
+  ret->setArray(arr,0);
+  int tmp1,tmp2;
+  double tmp3=getStartTime(tmp1,tmp2);
+  ret->setStartTime(tmp3,tmp1,tmp2);
+  return ret;
+}
+
+void MEDCouplingWithTimeStep::powEqual(const MEDCouplingTimeDiscretization *other)
+{
+  const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
+  if(!otherC)
+    throw INTERP_KERNEL::Exception("WithTimeStep::powEqual on mismatched time discretization !");
+  if(!getArray())
+    throw INTERP_KERNEL::Exception("MEDCouplingWithTimeLabel::powEqual : Data Array is NULL !");
+  getArray()->powEqual(other->getArray());
+}
+
+MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::performCopyOrIncrRef(bool deepCopy) const
 {
-  return new MEDCouplingWithTimeStep(*this,deepCpy);
+  return new MEDCouplingWithTimeStep(*this,deepCopy);
 }
 
-void MEDCouplingWithTimeStep::checkNoTimePresence() const throw(INTERP_KERNEL::Exception)
+void MEDCouplingWithTimeStep::checkNoTimePresence() const
 {
   throw INTERP_KERNEL::Exception("No time specified on a field defined on one time");
 }
 
-void MEDCouplingWithTimeStep::checkTimePresence(double time) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingWithTimeStep::checkTimePresence(double time) const
 {
   if(std::fabs(time-_time)>_time_tolerance)
     {
@@ -1526,7 +1679,7 @@ void MEDCouplingWithTimeStep::checkTimePresence(double time) const throw(INTERP_
     }
 }
 
-std::vector< const DataArrayDouble *> MEDCouplingWithTimeStep::getArraysForTime(double time) const throw(INTERP_KERNEL::Exception)
+std::vector< const DataArrayDouble *> MEDCouplingWithTimeStep::getArraysForTime(double time) const
 {
   if(std::fabs(time-_time)<=_time_tolerance)
     {
@@ -1543,7 +1696,7 @@ void MEDCouplingWithTimeStep::getValueForTime(double time, const std::vector<dou
   std::copy(vals.begin(),vals.end(),res);
 }
 
-void MEDCouplingWithTimeStep::getValueOnTime(int eltId, double time, double *value) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingWithTimeStep::getValueOnTime(int eltId, double time, double *value) const
 {
   if(std::fabs(time-_time)<=_time_tolerance)
     if(_array)
@@ -1554,7 +1707,7 @@ void MEDCouplingWithTimeStep::getValueOnTime(int eltId, double time, double *val
     throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingWithTimeStep::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingWithTimeStep::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const
 {
   if(_iteration==iteration && _order==order)
     if(_array)
@@ -1569,7 +1722,7 @@ MEDCouplingConstOnTimeInterval::MEDCouplingConstOnTimeInterval():_start_time(0.)
 {
 }
 
-void MEDCouplingConstOnTimeInterval::copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception)
+void MEDCouplingConstOnTimeInterval::copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other)
 {
   MEDCouplingTimeDiscretization::copyTinyAttrFrom(other);
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(&other);
@@ -1647,9 +1800,9 @@ void MEDCouplingConstOnTimeInterval::finishUnserialization2(const std::vector<in
   _end_time=tinyInfoD[2];
 }
 
-MEDCouplingConstOnTimeInterval::MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCpy):
-  MEDCouplingTimeDiscretization(other,deepCpy),_start_time(other._start_time),_end_time(other._end_time),_start_iteration(other._start_iteration),
-  _end_iteration(other._end_iteration),_start_order(other._start_order),_end_order(other._end_order)
+MEDCouplingConstOnTimeInterval::MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCopy):
+      MEDCouplingTimeDiscretization(other,deepCopy),_start_time(other._start_time),_end_time(other._end_time),_start_iteration(other._start_iteration),
+      _end_iteration(other._end_iteration),_start_order(other._start_order),_end_order(other._end_order)
 {
 }
 
@@ -1662,12 +1815,24 @@ std::string MEDCouplingConstOnTimeInterval::getStringRepr() const
   return stream.str();
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::performCpy(bool deepCpy) const
+void MEDCouplingConstOnTimeInterval::synchronizeTimeWith(const MEDCouplingMesh *mesh)
 {
-  return new MEDCouplingConstOnTimeInterval(*this,deepCpy);
+  if(!mesh)
+    throw INTERP_KERNEL::Exception("MEDCouplingWithTimeStep::synchronizeTimeWith : mesh instance is NULL ! Impossible to synchronize time !");
+  int it=-1,order=-1;
+  double val=mesh->getTime(it,order);
+  _start_time=val; _start_iteration=it; _start_order=order;
+  _end_time=val; _end_iteration=it; _end_order=order;
+  std::string tUnit=mesh->getTimeUnit();
+  _time_unit=tUnit;
 }
 
-std::vector< const DataArrayDouble *> MEDCouplingConstOnTimeInterval::getArraysForTime(double time) const throw(INTERP_KERNEL::Exception)
+MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::performCopyOrIncrRef(bool deepCopy) const
+{
+  return new MEDCouplingConstOnTimeInterval(*this,deepCopy);
+}
+
+std::vector< const DataArrayDouble *> MEDCouplingConstOnTimeInterval::getArraysForTime(double time) const
 {
   if(time>_start_time-_time_tolerance && time<_end_time+_time_tolerance)
     {
@@ -1795,7 +1960,7 @@ bool MEDCouplingConstOnTimeInterval::isEqualWithoutConsideringStr(const MEDCoupl
   return MEDCouplingTimeDiscretization::isEqualWithoutConsideringStr(other,prec);
 }
 
-void MEDCouplingConstOnTimeInterval::getValueOnTime(int eltId, double time, double *value) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingConstOnTimeInterval::getValueOnTime(int eltId, double time, double *value) const
 {
   if(time>_start_time-_time_tolerance && time<_end_time+_time_tolerance)
     if(_array)
@@ -1806,7 +1971,7 @@ void MEDCouplingConstOnTimeInterval::getValueOnTime(int eltId, double time, doub
     throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingConstOnTimeInterval::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingConstOnTimeInterval::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const
 {
   if(iteration>=_start_iteration && iteration<=_end_iteration)
     if(_array)
@@ -1817,12 +1982,12 @@ void MEDCouplingConstOnTimeInterval::getValueOnDiscTime(int eltId, int iteration
     throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingConstOnTimeInterval::checkNoTimePresence() const throw(INTERP_KERNEL::Exception)
+void MEDCouplingConstOnTimeInterval::checkNoTimePresence() const
 {
   throw INTERP_KERNEL::Exception("No time specified on a field defined as constant on one time interval");
 }
 
-void MEDCouplingConstOnTimeInterval::checkTimePresence(double time) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingConstOnTimeInterval::checkTimePresence(double time) const
 {
   if(time<_start_time-_time_tolerance || time>_end_time+_time_tolerance)
     {
@@ -1838,7 +2003,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::aggregate(const M
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("ConstOnTimeInterval::aggregation on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   return ret;
@@ -1855,7 +2020,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::aggregate(const s
         throw INTERP_KERNEL::Exception("ConstOnTimeInterval::aggregate on mismatched time discretization !");
       a[i]=itC->getArray();
     }
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   return ret;
@@ -1866,7 +2031,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::meld(const MEDCou
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("ConstOnTimeInterval::meld on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setTimeTolerance(getTimeTolerance());
   ret->setArray(arr,0);
@@ -1878,7 +2043,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::dot(const MEDCoup
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("ConstOnTimeInterval::dot on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   return ret;
@@ -1889,7 +2054,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::crossProduct(cons
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("ConstOnTimeInterval::crossProduct on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   return ret;
@@ -1900,7 +2065,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::max(const MEDCoup
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("ConstOnTimeInterval::max on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   return ret;
@@ -1911,7 +2076,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::min(const MEDCoup
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("ConstOnTimeInterval::min on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   return ret;
@@ -1922,7 +2087,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::add(const MEDCoup
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("ConstOnTimeInterval::add on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   int tmp1,tmp2;
@@ -1942,13 +2107,13 @@ void MEDCouplingConstOnTimeInterval::addEqual(const MEDCouplingTimeDiscretizatio
     throw INTERP_KERNEL::Exception("MEDCouplingConstOnTimeInterval::substractaddEqual : Data Array is NULL !");
   getArray()->addEqual(other->getArray());
 }
+
 MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::substract(const MEDCouplingTimeDiscretization *other) const
 {
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("ConstOnTimeInterval::substract on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   int tmp1,tmp2;
@@ -1974,7 +2139,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::multiply(const ME
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("multiply on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   int tmp1,tmp2;
@@ -2000,7 +2165,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::divide(const MEDC
   const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("divide on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
   MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
   ret->setArray(arr,0);
   int tmp1,tmp2;
@@ -2021,13 +2186,39 @@ void MEDCouplingConstOnTimeInterval::divideEqual(const MEDCouplingTimeDiscretiza
   getArray()->divideEqual(other->getArray());
 }
 
-MEDCouplingTwoTimeSteps::MEDCouplingTwoTimeSteps(const MEDCouplingTwoTimeSteps& other, bool deepCpy):MEDCouplingTimeDiscretization(other,deepCpy),
-                                                                                                     _start_time(other._start_time),_end_time(other._end_time),
-                                                                                                     _start_iteration(other._start_iteration),_end_iteration(other._end_iteration),
-                                                                                                     _start_order(other._start_order),_end_order(other._end_order)
+MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::pow(const MEDCouplingTimeDiscretization *other) const
+{
+  const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
+  if(!otherC)
+    throw INTERP_KERNEL::Exception("pow on mismatched time discretization !");
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
+  MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
+  ret->setArray(arr,0);
+  int tmp1,tmp2;
+  double tmp3=getStartTime(tmp1,tmp2);
+  ret->setStartTime(tmp3,tmp1,tmp2);
+  tmp3=getEndTime(tmp1,tmp2);
+  ret->setEndTime(tmp3,tmp1,tmp2);
+  return ret;
+}
+
+void MEDCouplingConstOnTimeInterval::powEqual(const MEDCouplingTimeDiscretization *other)
+{
+  const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
+  if(!otherC)
+    throw INTERP_KERNEL::Exception("ConstOnTimeInterval::powEqual on mismatched time discretization !");
+  if(!getArray())
+    throw INTERP_KERNEL::Exception("MEDCouplingConstOnTimeInterval::powEqual : Data Array is NULL !");
+  getArray()->powEqual(other->getArray());
+}
+
+MEDCouplingTwoTimeSteps::MEDCouplingTwoTimeSteps(const MEDCouplingTwoTimeSteps& other, bool deepCopy):MEDCouplingTimeDiscretization(other,deepCopy),
+    _start_time(other._start_time),_end_time(other._end_time),
+    _start_iteration(other._start_iteration),_end_iteration(other._end_iteration),
+    _start_order(other._start_order),_end_order(other._end_order)
 {
   if(other._end_array)
-    _end_array=other._end_array->performCpy(deepCpy);
+    _end_array=other._end_array->performCopyOrIncrRef(deepCopy);
   else
     _end_array=0;
 }
@@ -2039,7 +2230,31 @@ void MEDCouplingTwoTimeSteps::updateTime() const
     updateTimeWith(*_end_array);
 }
 
-void MEDCouplingTwoTimeSteps::copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTwoTimeSteps::synchronizeTimeWith(const MEDCouplingMesh *mesh)
+{
+  if(!mesh)
+    throw INTERP_KERNEL::Exception("MEDCouplingTwoTimeSteps::synchronizeTimeWith : mesh instance is NULL ! Impossible to synchronize time !");
+  int it=-1,order=-1;
+  double val=mesh->getTime(it,order);
+  _start_time=val; _start_iteration=it; _start_order=order;
+  _end_time=val; _end_iteration=it; _end_order=order;
+  std::string tUnit=mesh->getTimeUnit();
+  _time_unit=tUnit;
+}
+
+std::size_t MEDCouplingTwoTimeSteps::getHeapMemorySizeWithoutChildren() const
+{
+  return MEDCouplingTimeDiscretization::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<const BigMemoryObject *> MEDCouplingTwoTimeSteps::getDirectChildrenWithNull() const
+{
+  std::vector<const BigMemoryObject *> ret(MEDCouplingTimeDiscretization::getDirectChildrenWithNull());
+  ret.push_back(_end_array);
+  return ret;
+}
+
+void MEDCouplingTwoTimeSteps::copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other)
 {
   MEDCouplingTimeDiscretization::copyTinyAttrFrom(other);
   const MEDCouplingTwoTimeSteps *otherC=dynamic_cast<const MEDCouplingTwoTimeSteps *>(&other);
@@ -2073,9 +2288,9 @@ DataArrayDouble *MEDCouplingTwoTimeSteps::getEndArray()
   return _end_array;
 }
 
-void MEDCouplingTwoTimeSteps::checkCoherency() const throw(INTERP_KERNEL::Exception)
+void MEDCouplingTwoTimeSteps::checkConsistencyLight() const
 {
-  MEDCouplingTimeDiscretization::checkCoherency();
+  MEDCouplingTimeDiscretization::checkConsistencyLight();
   if(!_end_array)
     throw INTERP_KERNEL::Exception("No end array specified !");
   if(_array->getNumberOfComponents()!=_end_array->getNumberOfComponents())
@@ -2171,12 +2386,12 @@ MEDCouplingTwoTimeSteps::~MEDCouplingTwoTimeSteps()
     _end_array->decrRef();
 }
 
-void MEDCouplingTwoTimeSteps::checkNoTimePresence() const throw(INTERP_KERNEL::Exception)
+void MEDCouplingTwoTimeSteps::checkNoTimePresence() const
 {
   throw INTERP_KERNEL::Exception("The field presents a time to be specified in every access !");
 }
 
-void MEDCouplingTwoTimeSteps::checkTimePresence(double time) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingTwoTimeSteps::checkTimePresence(double time) const
 {
   if(time<_start_time-_time_tolerance || time>_end_time+_time_tolerance)
     {
@@ -2268,6 +2483,32 @@ void MEDCouplingTwoTimeSteps::resizeForUnserialization(const std::vector<int>& t
   arrays[1]=arr;
 }
 
+void MEDCouplingTwoTimeSteps::checkForUnserialization(const std::vector<int>& tinyInfoI, const std::vector<DataArrayDouble *>& arrays)
+{
+  static const char MSG[]="MEDCouplingTimeDiscretization::checkForUnserialization : arrays in input is expected to have size two !";
+  if(arrays.size()!=2)
+    throw INTERP_KERNEL::Exception(MSG);
+  if(_array!=0)
+    _array->decrRef();
+  if(_end_array!=0)
+    _end_array->decrRef();
+  _array=0; _end_array=0;
+  if(tinyInfoI[0]!=-1 && tinyInfoI[1]!=-1)
+    {
+      if(!arrays[0])
+        throw INTERP_KERNEL::Exception(MSG);
+      arrays[0]->checkNbOfTuplesAndComp(tinyInfoI[0],tinyInfoI[1],MSG);
+      _array=arrays[0]; _array->incrRef();
+    }
+  if(tinyInfoI[6]!=-1 && tinyInfoI[7]!=-1)
+    {
+      if(!arrays[1])
+        throw INTERP_KERNEL::Exception(MSG);
+      arrays[1]->checkNbOfTuplesAndComp(tinyInfoI[0],tinyInfoI[1],MSG);
+      _end_array=arrays[1]; _end_array->incrRef();
+    }
+}
+
 void MEDCouplingTwoTimeSteps::finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD, const std::vector<std::string>& tinyInfoS)
 {
   MEDCouplingTimeDiscretization::finishUnserialization(tinyInfoI,tinyInfoD,tinyInfoS);
@@ -2316,9 +2557,9 @@ void MEDCouplingTwoTimeSteps::finishUnserialization2(const std::vector<int>& tin
   _end_time=tinyInfoD[2];
 }
 
-std::vector< const DataArrayDouble *> MEDCouplingTwoTimeSteps::getArraysForTime(double time) const throw(INTERP_KERNEL::Exception)
+std::vector< const DataArrayDouble *> MEDCouplingTwoTimeSteps::getArraysForTime(double time) const
 {
-   if(time>_start_time-_time_tolerance && time<_end_time+_time_tolerance)
+  if(time>_start_time-_time_tolerance && time<_end_time+_time_tolerance)
     {
       std::vector< const DataArrayDouble *> ret(2);
       ret[0]=_array;
@@ -2329,7 +2570,7 @@ std::vector< const DataArrayDouble *> MEDCouplingTwoTimeSteps::getArraysForTime(
     throw INTERP_KERNEL::Exception(EXCEPTION_MSG);
 }
 
-void MEDCouplingTwoTimeSteps::setArrays(const std::vector<DataArrayDouble *>& arrays, TimeLabel *owner) throw(INTERP_KERNEL::Exception)
+void MEDCouplingTwoTimeSteps::setArrays(const std::vector<DataArrayDouble *>& arrays, TimeLabel *owner)
 {
   if(arrays.size()!=2)
     throw INTERP_KERNEL::Exception("MEDCouplingTwoTimeSteps::setArrays : number of arrays must be two.");
@@ -2337,7 +2578,7 @@ void MEDCouplingTwoTimeSteps::setArrays(const std::vector<DataArrayDouble *>& ar
   setEndArray(arrays.back(),owner);
 }
 
-MEDCouplingLinearTime::MEDCouplingLinearTime(const MEDCouplingLinearTime& other, bool deepCpy):MEDCouplingTwoTimeSteps(other,deepCpy)
+MEDCouplingLinearTime::MEDCouplingLinearTime(const MEDCouplingLinearTime& other, bool deepCopy):MEDCouplingTwoTimeSteps(other,deepCopy)
 {
 }
 
@@ -2354,16 +2595,16 @@ std::string MEDCouplingLinearTime::getStringRepr() const
   return stream.str();
 }
 
-void MEDCouplingLinearTime::checkCoherency() const throw(INTERP_KERNEL::Exception)
+void MEDCouplingLinearTime::checkConsistencyLight() const
 {
-  MEDCouplingTwoTimeSteps::checkCoherency();
+  MEDCouplingTwoTimeSteps::checkConsistencyLight();
   if(std::fabs(_start_time-_end_time)<_time_tolerance)
     throw INTERP_KERNEL::Exception("Start time and end time are equals regarding time tolerance.");
 }
 
-MEDCouplingTimeDiscretization *MEDCouplingLinearTime::performCpy(bool deepCpy) const
+MEDCouplingTimeDiscretization *MEDCouplingLinearTime::performCopyOrIncrRef(bool deepCopy) const
 {
-  return new MEDCouplingLinearTime(*this,deepCpy);
+  return new MEDCouplingLinearTime(*this,deepCopy);
 }
 
 bool MEDCouplingLinearTime::areCompatible(const MEDCouplingTimeDiscretization *other) const
@@ -2440,7 +2681,7 @@ void MEDCouplingLinearTime::getValueForTime(double time, const std::vector<doubl
   std::transform(tmp.begin(),tmp.end(),res,res,std::plus<double>());
 }
 
-void MEDCouplingLinearTime::getValueOnTime(int eltId, double time, double *value) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingLinearTime::getValueOnTime(int eltId, double time, double *value) const
 {
   double alpha=(_end_time-time)/(_end_time-_start_time);
   int nbComp;
@@ -2459,7 +2700,7 @@ void MEDCouplingLinearTime::getValueOnTime(int eltId, double time, double *value
   std::transform(tmp.begin(),tmp.end(),value,value,std::plus<double>());
 }
 
-void MEDCouplingLinearTime::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingLinearTime::getValueOnDiscTime(int eltId, int iteration, int order, double *value) const
 {
   if(iteration==_start_iteration && order==_start_order)
     {
@@ -2484,8 +2725,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::aggregate(const MEDCouplin
   const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::aggregation on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Aggregate(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Aggregate(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Aggregate(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Aggregate(getEndArray(),other->getEndArray());
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setArray(arr1,0);
   ret->setEndArray(arr2,0);
@@ -2505,8 +2746,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::aggregate(const std::vecto
       a[i]=itC->getArray();
       b[i]=itC->getEndArray();
     }
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Aggregate(b);
+  MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Aggregate(b);
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setArray(arr,0);
   ret->setEndArray(arr2,0);
@@ -2518,8 +2759,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::meld(const MEDCouplingTime
   const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::meld on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Meld(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Meld(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Meld(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Meld(getEndArray(),other->getEndArray());
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setTimeTolerance(getTimeTolerance());
   ret->setArray(arr1,0);
@@ -2532,8 +2773,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::dot(const MEDCouplingTimeD
   const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::dot on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Dot(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Dot(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Dot(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Dot(getEndArray(),other->getEndArray());
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setArray(arr1,0);
   ret->setEndArray(arr2,0);
@@ -2545,8 +2786,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::crossProduct(const MEDCoup
   const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::crossProduct on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::CrossProduct(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::CrossProduct(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::CrossProduct(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::CrossProduct(getEndArray(),other->getEndArray());
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setArray(arr1,0);
   ret->setEndArray(arr2,0);
@@ -2559,8 +2800,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::max(const MEDCouplingTimeD
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::max on mismatched time discretization !");
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Max(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Max(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Max(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Max(getEndArray(),other->getEndArray());
   ret->setArray(arr1,0);
   ret->setEndArray(arr2,0);
   return ret;
@@ -2571,8 +2812,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::min(const MEDCouplingTimeD
   const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::min on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Min(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Min(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Min(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Min(getEndArray(),other->getEndArray());
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setArray(arr1,0);
   ret->setEndArray(arr2,0);
@@ -2584,8 +2825,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::add(const MEDCouplingTimeD
   const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::add on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Add(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Add(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Add(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Add(getEndArray(),other->getEndArray());
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setArray(arr1,0);
   ret->setEndArray(arr2,0);
@@ -2610,8 +2851,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::substract(const MEDCouplin
   const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::substract on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Substract(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Substract(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Substract(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Substract(getEndArray(),other->getEndArray());
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setArray(arr1,0);
   ret->setEndArray(arr2,0);
@@ -2636,8 +2877,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::multiply(const MEDCoupling
   const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::multiply on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Multiply(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Multiply(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Multiply(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Multiply(getEndArray(),other->getEndArray());
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setArray(arr1,0);
   ret->setEndArray(arr2,0);
@@ -2662,8 +2903,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::divide(const MEDCouplingTi
   const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
   if(!otherC)
     throw INTERP_KERNEL::Exception("LinearTime::divide on mismatched time discretization !");
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Divide(getArray(),other->getArray());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Divide(getEndArray(),other->getEndArray());
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Divide(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Divide(getEndArray(),other->getEndArray());
   MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
   ret->setArray(arr1,0);
   ret->setEndArray(arr2,0);
@@ -2682,3 +2923,29 @@ void MEDCouplingLinearTime::divideEqual(const MEDCouplingTimeDiscretization *oth
   getArray()->divideEqual(other->getArray());
   getEndArray()->divideEqual(other->getEndArray());
 }
+
+MEDCouplingTimeDiscretization *MEDCouplingLinearTime::pow(const MEDCouplingTimeDiscretization *other) const
+{
+  const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
+  if(!otherC)
+    throw INTERP_KERNEL::Exception("LinearTime::pow on mismatched time discretization !");
+  MCAuto<DataArrayDouble> arr1=DataArrayDouble::Pow(getArray(),other->getArray());
+  MCAuto<DataArrayDouble> arr2=DataArrayDouble::Pow(getEndArray(),other->getEndArray());
+  MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
+  ret->setArray(arr1,0);
+  ret->setEndArray(arr2,0);
+  return ret;
+}
+
+void MEDCouplingLinearTime::powEqual(const MEDCouplingTimeDiscretization *other)
+{
+  const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
+  if(!otherC)
+    throw INTERP_KERNEL::Exception("LinearTime::addEqual on mismatched time discretization !");
+  if(!getArray())
+    throw INTERP_KERNEL::Exception("MEDCouplingLinearTime::powEqual : Data Array is NULL !");
+  if(!getEndArray())
+    throw INTERP_KERNEL::Exception("MEDCouplingLinearTime::powEqual : Data Array (end) is NULL !");
+  getArray()->powEqual(other->getArray());
+  getEndArray()->powEqual(other->getEndArray());
+}