restart with init file

Numerical methods and mathematical models of Elmer
Luve
Posts: 9
Joined: 22 May 2022, 16:07
Antispam: Yes

restart with init file

Post by Luve »

Hello
The problem: A transient calculation is performed with an old calculation up to time step no. 100. The evaluation shows, better would be a calculation up to time step no. 150.
How to use old results as initialization of a new calculation?
kevinarden posted a description on 2019-01-25. This fits to this task. I do not understand it well.
Is there a detailed example ? In which documentation (chapter-no.) is it described ?

- Which commands have to be added to the *.sif file by hand ?
- Which is the new init file ? Is it a *.vtu file ?
- Where is the line number in the new init file for the restart?

I hope I have not bothered you unnecessarily.

With kind regards
luve
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: restart with init file

Post by kevinarden »

Elmer's solver manual Chapter 3

https://www.nic.funet.fi/pub/sci/physic ... Manual.pdf

First run You need to specify an output file name in the simulation section that will contain the restart data

Output File = "old.result"
Binary Output = Logical True

the binary output is optional but file sizes are smaller

Second run you need to tell it where to restart from in the simulation section

Restart File = old.result
Restart Position = 0

0 is a special case that starts from the last completed step.

There is an example case here
https://github.com/ElmerCSC/elmerfem/tr ... eamRestart
Luve
Posts: 9
Joined: 22 May 2022, 16:07
Antispam: Yes

Re: restart with init file

Post by Luve »

Thank you very much. Also many thanks for years of answering user questions.

With kind regards
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: restart with init file

Post by kevinarden »

If you primarily use ElmerGUI the you can use the free text block to add the creation of restart files to the simulation section
and in the restart run add the restart information, free text is added to the section on sif generation
model setup 1.png
model setup 1.png (75.87 KiB) Viewed 931 times
restart_run.png
restart_run.png (75.14 KiB) Viewed 931 times
The caution is that you have to anticipate or plan for a restart on the first run. If you didn't create restart files then you can't use restart on a later run.
Luve
Posts: 9
Joined: 22 May 2022, 16:07
Antispam: Yes

Re: restart with init file

Post by Luve »

Hello kevingarden,

your first post already worked for me.
Maybe it helps, the link for example
https://github.com/ElmerCSC/elmerfem/tr ... eamRestart
cannot be used. The file beam2d.grd cannot be opened with my ELMER version:
ElmerFEM-gui-mpi-Windows-AMD64-rel9.



With kind regards

luve
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: restart with init file

Post by kevinarden »

I had no issues opening beam2d.grd in ElmerGUI on LINUX MINT
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: restart with init file

Post by annier »

Hi,
The code for producing old.result file

Code: Select all

 Output File = "old.result"
      Binary Output = Logical True

assumes that the directory of the mesh is in the same directory as the sif file
i.e.

Code: Select all

Mesh DB "." "Mesh1"
.

How do we modify the path for the output restart file old.result to be saved in the Mesh1 directory which is in the parent directory of the current directory of sif file, i.e. for

Code: Select all

Mesh DB "./../" "Mesh1"
?

Best Regards,
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: restart with init file

Post by kevinarden »

output file = "../restart.data"

or

output file = "../restart_file/restart.data"

if you create the directory restart_file first

.. means go up one directory
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: restart with init file

Post by annier »

Dear Kevin,
For the following simulation settings,

Code: Select all

Header
...
Mesh DB "./../" "Mesh_1"
...
End

Simulation
...
Output File = "../Mesh_1/old.result"
Output File = "../Mesh_1/old.result"
...
End
The following error occurs :

Code: Select all

SaveResult: -----------------------------------------
SaveResult: Saving results to file: Mesh_1/../Mesh_1/old.result
At line 4170 of file /build/elmerfem-csc-AyevAU/elmerfem-csc-9.0-0ppa0/fem/src/ModelDescription.F90 (unit = 31)
Fortran runtime error: Cannot open file 'Mesh_1/../Mesh_1/old.result': No such file or directory

Best Regards,
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: restart with init file

Post by kevinarden »

The .. .
Means go up one directory so maybe it is not fi ding the file
Post Reply