correct timestep issues

This commit is contained in:
azakir 2020-12-21 15:46:50 +01:00
parent 2e6d418599
commit 147d2c026d
2 changed files with 13 additions and 6 deletions

View File

@ -1366,9 +1366,18 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit
med_float dt; med_float dt;
med_int tmp_numdt, tmp_numit; 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); //~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 ) if ( erreur < 0 )
{ {
@ -1377,8 +1386,6 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit
return; return;
} }
numdt = tmp_numdt;
numit = tmp_numit;
// Fermeture du fichier // Fermeture du fichier

View File

@ -693,7 +693,7 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton()
{ {
fieldNameCmb->insertItem(0,QString(it->first)); fieldNameCmb->insertItem(0,QString(it->first));
int typeStepInField = it->second > 2 ? 2 : it->second ; 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)); fieldNameCmb->insertItem(0,QString(it->first));
int typeStepInField = it->second > 2 ? 2 : it->second ; int typeStepInField = it->second > 2 ? 2 : it->second ;
timeStepGroupChanged(typeStepInField, true, it->second-1); timeStepGroupChanged(typeStepInField, true);
} }
} }