# 4.1.1. Anatomy of an Input Deck

Every Aria simulation requires a text input file to define the problem. The input file defines everything about your problem except the mesh itself. You can prepare and edit this file in any text editor of your choosing. Using the Sierra Editor in SAW to prepare this file will provide additional context hints and syntax checking in real-time.

## 4.1.1.1. Indentation & Capitalization

Indentation is recommended but not required in an Aria input file. You can indent with tabs or spaces, or choose not to indent things at all - although we highly recommend using indentation (with spaces) to make a consistently readable input file and to avoid errors with commands going in the wrong scope.

Aria commands are generally not case sensitive, although commands referring to a file (e.g. the mesh file or an Aprepro include file) will be case sensitive.

## 4.1.1.2. Comments

Anything that starts with a `#` or a `$` will be treated as a comment and ignored. Long lines can be split using `\$`, like this

    # This is a comment
    $ and so is this

    # This is a single line command split on three lines
    List of Blocks = block_1 block_2 block_3 \$
                     block_4 block_5 block_6 \$
                     block_7 block_8

## 4.1.1.3. Structure

The Aria input file is structured using nested blocks with `Begin` and `End` commands surrounding each block. The outermost block must always be the SIERRA block. Commands directly in this block are referred to as “Domain-level” or “Sierra-level” commands. Other commands must go inside inner blocks, such as “Procedure” or “Aria Region”, and will be referred to as such. If you put a command in the wrong level, you will get an error when you try to run Aria.

    Begin SIERRA Aria
      # Domain-level commands:
      # * Aria materials
      # * Finite element model
      # * Linear solvers

      Begin Procedure AriaProcedure
        # Procedure-level commands

        Begin Solution Control Description
          # Solution control commands
        End

        Begin Aria Region myRegion
          # Region-level commands:
          # * Equation(s) to solve
          # * Initial and Boundary conditions
          # * Post-processors
          # * File output specifications
        End
      End
    End

There are two types of commands that can go in the input file - block commands and line commands. Block commands start with the `Begin` keyword and end with the `End` keyword, and can contain line commands or nested blocks.

    Begin My Block Somename
       # line commands
    End My Block Somename

The block type and name are optional on the `End` command, but may improve readability for large blocks

    Begin My Block Somename
       # line commands
    End

A line command is a command on a single line

    Density = Constant value = 1.0

Each line command has a specific block or set of blocks where it is valid. Using it outside those blocks will result in an error about an un-recognized command.

For simple problems, the governing equations to solve are usually specified in the `Aria Region` block. When using this mode, a single linear system will be constructed with all the equations in the region and solved monolithically. Alternately, you can use `Equation System` blocks within the Aria region to separate out different equations.

    Begin Aria region myRegionName
      # general region commands

      Begin Equation System myPhysics1
        # physics1 equation
      End

      Begin Equation System myPhysics2
        # physics2 equations
      End
    End

When using this mode, a linear system will be constructed and solved independently for each equation system. These will be solved in the order listed in the input file.

## 4.1.1.4. Syntax checking

It is common that users may misspell or misplace a certain command line/block, causing an error before a run even starts. To streamline this process, Sierra offers a command line option to check the syntactic correctness of an input deck without loading reading the mesh. This can be done for a sample input deck `input.i`:

    module load sierra
    aria -i input.i --check-syntax

Typically, this will run quickly and determine whether or not `input.i` has any syntactic errors reported in the log file.

It is important to note that the speed of `--check-syntax` scales with the size of the input file. For example, the following input deck commands

    Begin Aria region myRegionName
      # general region commands

      Begin Equation System myPhysics1
        Eq energy for temperature on block_1 using Q1 with lumped_mass diff src
        Eq energy for temperature on block_2 using Q1 with lumped_mass diff src
        #... up to 1000 blocks
        Eq energy for temperature on block_1000 using Q1 with lumped_mass diff src
      End
    End

will run `--check-syntax` much slower than the following

    Begin Aria region myRegionName
      # general region commands
      mesh group solids = block_1 block_2 ... block_1000 # assume all 1000 blocks are explicitly defined in this mesh group
      Begin Equation System myPhysics1
        eq energy for temperature on solids using Q1 with lumped_mass diff src
      End
    End

This is due to having multiple ordering constraints on various commands lines/blocks that Sierra internally resolves before checking the input deck syntax.