Change restart file from studymanager

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
C.FLAG.
Posts: 32
Joined: Fri Apr 08, 2016 2:19 pm

Change restart file from studymanager

Post 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
Yvan Fournier
Posts: 4075
Joined: Mon Feb 20, 2012 3:25 pm

Re: Change restart file from studymanager

Post 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
C.FLAG.
Posts: 32
Joined: Fri Apr 08, 2016 2:19 pm

Re: Change restart file from studymanager

Post 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
Post Reply