Calling Elmer Solver using .sh script

Numerical methods and mathematical models of Elmer
Post Reply
asandip
Posts: 92
Joined: 09 May 2019, 22:06
Antispam: Yes

Calling Elmer Solver using .sh script

Post by asandip »

Hello,

I currently have a code that is used for material calibration - determine best material parameter values that fit the test data - in Linux. The code would call the shell (.sh) script, which would

1. transfer the new material parameter values to the .sif file.
2. Run Elmer Solver for the new material parameter values
3. Extract the quantities of interest from the Elmer output and send it to the code for further optimization.

I was able to transfer the new parameter values to the .sif file using the shell script. I am currently stuck on step 2. Would the command line to run Elmer Solver with the new parameter values be -

elmersolver input.sif

[or]

echo 'input.sif' >! ELMERSOLVER_STARTINFO; ElmerSolver

Thank you for any information you can provide.

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

Re: Calling Elmer Solver using .sh script

Post by kevinarden »

If you are in the directory that the elmer files are in, then the command

ElmerSolver

runs the sif file that is in ELMERSOLVER_STARTINFO file
asandip
Posts: 92
Joined: 09 May 2019, 22:06
Antispam: Yes

Re: Calling Elmer Solver using .sh script

Post by asandip »

I think I am in the directory that the elmer files are in. Using the shell script, I tried to run Elmer

ElmerSolver case.sif

and here's the error I get - "ERROR:: LoadMesh: Requested mesh > ./. < does not exist!"

How should i proceed?
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Calling Elmer Solver using .sh script

Post by kevinarden »

The mesh that is read is specified from the case.sif file, sounds like it can't find the mesh specified

Header
CHECK KEYWORDS Warn
Mesh DB "." "."
Include Path ""
Results Directory ""
End

this means that the mesh is in the current directory. Mesh DB "." "."
asandip
Posts: 92
Joined: 09 May 2019, 22:06
Antispam: Yes

Re: Calling Elmer Solver using .sh script

Post by asandip »

Thank you, the issue was resolved. But now I have run into another error while trying the run Elmer using the .sh script -

MAIN:
MAIN: -------------------------------------
MAIN: Time: 1/10 1.0000000000000000
MAIN: -------------------------------------
MAIN:
ERROR:: NormalVector: Invalid dimension for determining normal!
Note: The following floating-point exceptions are signalling: IEEE_DENORMAL

The same sif file I ran through the GUI after loading the project, and it did not give me any errors -
MAIN: Time: 1/10 1.0000000000000000
MAIN: -------------------------------------
MAIN:
ShellSolver: --------------------------------------------------------
ShellSolver: Nonlinear iteration: 1
ShellSolver: --------------------------------------------------------
ShellSolver: Residual for nonlinear iterate 0 9.883E-01
ShellSolver: --------------------------------------------------------
.
.
.
ElmerSolver: *** Elmer Solver: ALL DONE ***
ElmerSolver: The end
SOLVER TOTAL TIME(CPU,REAL): 8.88 8.91
ELMER SOLVER FINISHED AT: 2019/05/30 12:55:46
case.sif
(1.78 KiB) Downloaded 236 times
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Calling Elmer Solver using .sh script

Post by mzenker »

Hi,

strange that the same sif file seems to run without error only in the GUI...
Are you sure that it is really the same, and is run with the same mesh?

The following test can help to clarify that:
* load the project in ElmerGUI, save the project, run the solver
* on the command line, cd to the very same project directory and type
ElmerSolver

If you still get the error only outside the GUI, then I would really be surprised...

HTH,
Matthias
asandip
Posts: 92
Joined: 09 May 2019, 22:06
Antispam: Yes

Re: Calling Elmer Solver using .sh script

Post by asandip »

Matthias,

I was able to resolve the problem. The issue was that in the GUI, I had to load the project and then edit the .sif file to get the results that I was looking for. I now have created a project were the editing the .sif file step is no longer needed. This project went through the terminal. Thank you for your suggestions!

- Anjali
Post Reply