Case ID and simple calculation whit SaveLine

Numerical methods and mathematical models of Elmer
Post Reply
joni
Posts: 21
Joined: 10 Mar 2018, 15:05
Antispam: Yes

Case ID and simple calculation whit SaveLine

Post by joni » 22 Mar 2019, 10:16

hi,

I have simple School work where I compare
same 1m x 1m plate by changeing
elmentsize Mesh, element ordder p2/p:4
and solver plate/shell/Linear elasticy
and there will 53 cases,...

Save Line + append operator will do good
job but I like to save to first column ID
, case.sif filename and I like to divide
resulted Deflections whit analytical values
to get comparatable parameter.

I could not figure out where I should use
MATC to manipulate values and how to add
ID.

raback
Site Admin
Posts: 3453
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Case ID and simple calculation whit SaveLine

Post by raback » 24 Mar 2019, 19:56

Hi joni

I would perhaps not save everything in one file. Currently SaveLine does not support adding any index in a nice way. SaveScalars has the keyword "Line Marker" which makes it possible to mark different lines easily.

Instead if you're running over several meshes you could have some simple unix script, e.g.

Code: Select all

#!/bin/bash
for i in {1..10}
do
  export FILEIND=$i
  ElmerSolver case.sif
done  
in the sif file you can access the environmental variables by MATC, for example.

Code: Select all

  $ind = env("FILEIND")
And you canu use this index in Simulation section to choose the mesh

Code: Select all

  Mesh DB = "." mesh$ind$
and in Solver section for to choose the filename for SaveLine

Code: Select all

  
  Filename = line$ind$.dat

And the results would be easy to script in Matlab or octave, for example.

-Peter

joni
Posts: 21
Joined: 10 Mar 2018, 15:05
Antispam: Yes

Re: Case ID and simple calculation whit SaveLine

Post by joni » 24 Mar 2019, 20:27

hi,

I have actually three scripts creating .sif files.
I have about three "TEMPLATE.SIF" files where i have
parameters "E_JOB , E_MESH".

One of scripts replaces "E_JOB , E_MESH" at TEMPLATE.SIF
file whit parameter's.

And all cases have code name P1N8CP
P1= 1/4 fourt model, only one element
N8= 808 elemnt
C=Clamped
P=Pressure

Case name like P1N8CP can be easyly decoded
to parameters like E_JOB, E_MESH, E_SCALE
and replaced from TEMPLATE.SIF

Example:

Boundary Condition 4
Target Boundaries(1) = 2
Name = SYM2
E_SC21 Deflection 1 = 0
E_SC22 Deflection 2 = 0
E_SC23 Deflection 3 = 0
End

So to remove Boundary condition E_SC21="!" and
to activate E_SC21="" , vòla


And result is *.sif file that work's as evidence what
had been calculated !

I'am useing operator APPEND to get both saveline and savescalar
to one file.

Purpose was to use this case as test case how to deploy jobs
via slurm to my small three machine cluster.

Now I do calculation at seriers, at one machine, so I know
order of calculated cases, i can add id at LibreCalc !!

When I'am done I will post all "source" files, if one need to
solve same problem form nothing.

joni

Post Reply