Skip to content

Header section

t7saeki edited this page May 8, 2023 · 14 revisions

Overview

Elmer Solver Manual listed 11 sections which can be used in SIF. However, Header section is very different from others as:

  • Header section should be the first section in SIF.
  • Keyword commands of Header section do not include equal sign.
  • Keyword commands of Header section can be written before Header section without in-line format.

These are due to the parse process by ElmerSolver (more specifically, LoadInputFile function in ModelDescription.F90 ) and that's why there are some test SIFs which start with CHECK KEYWORDS "Warn". (For example, https://github.com/ElmerCSC/elmerfem/blob/devel/fem/tests/1dtests/1d.sif.)

Note : It is possible to write all the keyword commands of Header section before Header section, but Header section is still needed to let ElmerSolver know the end of Header section as shown below.

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

Header
End

Simulation
  Max Output Level = 5
  Coordinate System = Cartesian
  ...

Note : Some keyword commands of Header section cause an error with inline style as shown below. Therefore, it is recommended not to use inline style for keyword commans of Header section.

Header ::  CHECK KEYWORDS Warn ! This causes an error

Header
  Include Path ""
  Results Directory ""
  ...

List of keywords

Name Description
Check Keywords specifies how ElmerSolver behaves when parsing keywords which are not listed in SOLVER.KEYWORDS.
Mesh DB specifies the directory where Elmer mesh files are located.
Include Path specifies path to SIF contents to be included.
Results Directory specifies the directory to store simulation results.
Simulation ID specifies ID for the simulation.
Echo controls command echoing of ElmerSolver during parsing SIF.
Numbering specifies whether to map materials to bodies by number.

Keyword details

Check Keywords

specifies how ElmerSolver behaves when parsing keywords which are not listed in SOLVER.KEYWORDS file.

Syntax

Check Keywords string

string: one from the list below. The default value is "Warn".

  • "Warn"
  • "Abort"
  • "Silent"
  • "Ignore"

Examples

Header 
  Check Keywords "Warn"
End

Description

Usually, each keyword command in SIF must specify the data type like Density = Real 1000.0, otherwise ElmerSolver stops with an error. However, for the convenience of users, the data type can be omitted in SIF when the keyword is listed in SOLVER.KEYWORDS file with its data type. Check Keywords provides options for ElmerSolver's behavior during the keyword checking as listed below.

  • "Warn": ElmerSolver shows a message when there is a keyword which is not listed in SOLVER.KEYWORDS even if its data type is specified in SIF.
  • "Abort": ElmerSolver stops with an error when there is a keyword which is not listed in SOLVER.KEYWORDS even if its data type is specified in SIF.
  • "Silent": ElmerSolver does not show any message even if there is a keyword which is not listed in SOLVER.KEYWORDS.
  • "Ignore": ElmerSolver ignores SOLVER.KEYWORDS. Therefore, all the keyword commands in SIF except for Header section must specify the data type.

The behavior of ElmerSolver is tabulated below. The options "Warn" and "Abort" are useful for developers to detect keywords which are not listed in SOLVER.KEYWORDS.

Listed in SOLVER.KEYWORDS Data type is specified in SIF "Warn" "Abort" "Silent" "Ignore"
Yes Yes --- --- --- ---
Yes No --- --- --- Error
No Yes Message Error --- ---
No No Error Error Error Error

Note: Keyword commands of Header section mustn't specify data type though they are not listed in SOLVER.KEYWORDS.

Note: Location of SOLVER.KEYWORDS depends on your system. It is most likely located in /usr/local/share/elmersolver/lib in Ubuntu or Elmer_Install_Dir\share\elmersolver\lib in Windows.

Note: Classifying this keyword as Header section may be controversial. ElmerSolver Manual treats this keyword as "text outside sections" and explains that this keyword is placed in the beginning of SIF. However, SIFs generated by ElmerGUI have this keyword inside Header section as of May 2023.


Mesh DB

specifies the directory where Elmer mesh files are located.

Syntax

Mesh DB directory1 directory2

directory1 and directory2 specify mesh directory as directory1/directory2.

Examples

Header
  Mesh DB "." "."
End
Header 
  Mesh DB "/home/elmer/test_case" "mesh_dir"
End

Description

Elmer mesh data consist of four or five files - mesh.feader, mesh.nodes, mesh elements, mesh.body (and mesh.names, optionally). These files must be located in one directory. This command specifies the directory by using two strings directory1 and directory2 as directory1/directory2.

Note: directory1 and directory2 should be double-quoted, otherwise these are converted to lowercase by ElmerSolver and may cause problems in OSs where file path is case-sensitive.


Include Path

specifies path to SIF contents to be included.

Syntax

Include Path directory

directory: Name of directory where SIF contents to be included are located.

Examples

Header
  Include Path "materials"
End
Header
  Include Path "/home/elmer/include"
End

Description

Users may want to reuse a certain part of a SIF file (SIF contents, here) for other simulations. This can be achieved by storing the SIF contents as another file then insert the contents into other SIFs by using Include keyword. The Include Path keyword specifies the directory where the SIF contents are stored.

Note: directory should be double-quoted, otherwise it is converted to lowercase by ElmerSolver and may cause problems in OSs where file path is case-sensitive.


Results Directory

specifies the directory to store simulation results.

Syntax

Results Directory directory

directory: Name of directory to store simulation results.

Examples

Header
  Results Directory "results"
End
Header
  Results Directory "/home/elmer/test_case/results"
End

Description

This keyword specifies the directory to store simulation results. If the specified directory does not exist, ElmerSolver creates the directory when its parent directory exists.(If the parent directory does not exist, ElmerSolver fails to create the directory.)

If the Result directory is not specified in SIF, simulation results are stored in Mesh directory which is specified by Mesh DB.

Note: directory should be double-quoted, otherwise these are converted to lowercase by ElmerSolver and may cause problems in OSs where file path is case-sensitive.


Simulation ID

specifies ID for the simulation.

Syntax

Simulation ID string

string: ID for the simulation

Examples

Header
  Simulation ID "RX-78"
End
Header :: Simulation ID "MSZ-006"

Description

This keyword specifies ID for the simulation. The simulation ID is not used by ElmerSolver but just for convenience of users.


Echo

controls command echoing of ElmerSolver during parsing SIF.

Syntax

Numbering string

string: one from the list below. The default value is off.

  • on
  • off
  • on master

Note: It is recommended not to double-quote the value on, off and on master. This is because ElmerSolver internally handle as if "echo on", "echo off" and "echo on master" are different keywords. More specifically, the value must be written in lowercase when double-quoted. Otherwise ElmerSolver stops with an error.

Examples

Header 
  Echo on
End
Header 
  Echo off
End
Header 
  Echo on master
End

Description

Sometimes users wonder whether keyword commands in SIF are appropriately loaded by ElmerSolver. Command echoing helps to make sure the keyword commands are certainly loaded. This keyword provides options for command echoing behavior of ElmerSolver as listed below:

  • on: ElmerSolver echoes keyword commands during parsing SIF.

  • off: ElmerSolver does not echo keyword commands during parsing SIF.

  • on master: ElmerSolver echoes keyword commands during parsing SIF, but minimizes in parallel runs.

Note: Classifying this keyword as Header section may be controversial. ElmerSolver Manual treats this keyword as "text outside sections" and explains that this keyword is placed in the beginning of SIF.


Numbering

specifies whether to map materials to bodies by number.

Syntax

Numbering string

string: one from the list below. The default value is on.

  • on
  • off

Note: It is recommended not to double-quote the value on and off. This is because ElmerSolver internally handle as if "Numbering on" is one keyword and "Numbering off" is another keyword. More specifically, the value must be written in lowercase when double-quoted. Otherwise ElmerSolver stops with an error.

Examples

Header 
  Numbering on
End
Header 
  Numbering off
End

Description

Typically, materials are mapped to bodies by using their number such like:

Body 1
  Target Bodies(1) = 1
  Equation = 1
  Material = 1
End

Material 1
  Name = "Iron (generic)"
  Heat Conductivity = 80.2
  Heat Capacity = 449.0
  ...

By specifying Numbering as off, The materials can be mapped by their name such like:

Body 1
  Target Bodies(1) = 1
  Equation = 1
  Material Name = "Iron (generic)"
End

Material 1
  Name = "Iron (generic)"
  Heat Conductivity = 80.2
  Heat Capacity = 449.0
  ...

Note: Even if Numbering is specified as off, mapping by number is still active. If a body has both Material and Material Number keywords, Material keyword is piroiritized and the body is mapped by number.