]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
correct timestep issues
authorazakir <abdoulbari.zakir@csgroup.eu>
Mon, 21 Dec 2020 14:46:50 +0000 (15:46 +0100)
committerazakir <abdoulbari.zakir@csgroup.eu>
Mon, 21 Dec 2020 14:46:50 +0000 (15:46 +0100)
src/SMESHGUI/MG_ADAPT.cxx
src/SMESHGUI/MG_ADAPTGUI.cxx

index 3a1f568326fa1899737d915d267b26bf5912bc29..b65696e972a48cb8fb05b236e5d4caf704c9becb 100644 (file)
@@ -1366,9 +1366,18 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit
     med_float dt;
     med_int tmp_numdt, tmp_numit;
 
-    med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1;
+    //~med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1;
     //~myPrint("step ", step);
-    erreur = MEDfieldComputingStepInfo         ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt );
+       erreur = MEDfieldComputingStepInfo      ( medIdt, nomcha, 1, &numdt, &numit, &dt );
+    for(med_int step = 1; step <= nbofcstp; step++ )
+    {
+               erreur = MEDfieldComputingStepInfo      ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt );
+               if(tmp_numdt > numdt)
+               {
+                   numdt = tmp_numdt;
+                       numit = tmp_numit;          
+               } 
+       }
     if ( erreur < 0 )
     {
 
@@ -1377,8 +1386,6 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit
         return;
     }
 
-    numdt = tmp_numdt;
-    numit = tmp_numit;
 
 
     // Fermeture du fichier
index 564271ac9849e7a68d82597e69994042a309fba9..598e0cf3facf286cc7661a7a1d277bc4e9c98852 100644 (file)
@@ -693,7 +693,7 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton()
             {
                 fieldNameCmb->insertItem(0,QString(it->first));
                 int typeStepInField = it->second > 2 ?  2 : it->second ;
-                timeStepGroupChanged(typeStepInField, true, it->second-1);
+                timeStepGroupChanged(typeStepInField, true);
             }
 
         }
@@ -794,7 +794,7 @@ void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath)
         {
             fieldNameCmb->insertItem(0,QString(it->first));
             int typeStepInField = it->second > 2 ?  2 : it->second ;
-            timeStepGroupChanged(typeStepInField, true, it->second-1);
+            timeStepGroupChanged(typeStepInField, true);
         }
 
     }