Page 1 of 1

Change restart file from studymanager

Posted: Mon Jan 06, 2020 11:42 am
by C.FLAG.
Dear users, developers,

I would like to change the restart file when using the studymanager (the xml file is set for a restart). I speculate it can be done with a python script. However, I would like to know which variable has to be changed / function has to be called ?

Some of the modules already imported in my script:

Code: Select all

    from cs_package import package
    from model.XMLengine import Case
    from model.XMLinitialize import XMLinit
    from model.SolutionDomainModel import SolutionDomainModel
    from model.TimeStepModel import TimeStepModel
    from model.NumericalParamGlobalModel import NumericalParamGlobalModel
    from model.NumericalParamEquationModel import NumericalParamEquationModel
    from model.NotebookModel import NotebookModel
    from studymanager.cs_studymanager_parser import Parser
Would setRestartPath do the job ?

Code: Select all

    from model.StartRestartModel import setRestartPath
    ...
    restart = StartRestartModel(case)
    restart.setRestartPath("/folder/smgr/case/RESU/simulation/checkpoint")
Many thanks,
Best wishes,
Cédric

Re: Change restart file from studymanager

Posted: Mon Jan 06, 2020 11:03 pm
by Yvan Fournier
Hello,

If it works, fine. There is unfortunately no well documented/stable API, so as long as we do not improve the documentation to provide recommendations, any working solution in the Python model is as good as any other...

Best regards,

Yvan

Re: Change restart file from studymanager

Posted: Tue Jan 07, 2020 2:11 pm
by C.FLAG.
Thank you for your reply Yvan. Current seemingly working solution is very similar to my original post :

Code: Select all

    from model.StartRestartModel import StartRestartModel
    ...
    restart = StartRestartModel(case)
    restart.setRestartPath("/folder/smgr/case/RESU/simulation/checkpoint")
Kind regards,
Cédric