Salome HOME
Merge branch 'master' of salome:modules/med
[tools/medcoupling.git] / src / MEDLoader / MEDFileParameter.cxx
index 38559d7ae5b2b8e5b77e314bbecf527f19330d3b..3f1bc8a77e64a489f6e73e07647360c91d559149 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2014  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
@@ -465,7 +465,7 @@ void MEDFileParameterMultiTS::finishLoading(med_idt fid, med_parameter_type typ,
       double tim;
       MEDparameterComputationStepInfo(fid,_name.c_str(),i+1,&dt,&it,&tim);
       switch(typ)
-        {
+      {
         case MED_FLOAT64:
           _param_per_ts[i]=MEDFileParameterDouble1TSWTI::New(dt,it,tim);
           _param_per_ts[i]->readValue(fid,_name.c_str());
@@ -475,7 +475,7 @@ void MEDFileParameterMultiTS::finishLoading(med_idt fid, med_parameter_type typ,
          break;*/
         default:
           throw INTERP_KERNEL::Exception("MEDFileParameterMultiTS::finishLoading : supporting only FLOAT64 !");
-        }
+      }
     }
 }
 
@@ -606,7 +606,7 @@ int MEDFileParameterMultiTS::getPosOfTimeStep(int iteration, int order) const
       const MEDFileParameter1TS *elt(*it);
       if(elt)
         {
-          if(elt->getIteration()==iteration && elt->getOrder())
+          if(elt->getIteration()==iteration && elt->getOrder()==order)
             return ret;
           else
             oss << "(" << elt->getIteration() << "," << elt->getOrder() << "), ";
@@ -666,6 +666,11 @@ void MEDFileParameterMultiTS::eraseTimeStepIds(const int *startIds, const int *e
   _param_per_ts=paramPerTs;
 }
 
+int MEDFileParameterMultiTS::getNumberOfTS() const
+{
+  return (int) getIterations().size();
+}
+
 std::vector< std::pair<int,int> > MEDFileParameterMultiTS::getIterations() const
 {
   std::vector< std::pair<int,int> > ret;