# The Input File

- By default uses a hierarchical, block-structured input file.
- Within each block, any number of name/value pairs can be listed.
- The syntax is completely customizable, or replaceable.
- To specify a simple problem, you will need to populate five or six top-level blocks.
- We will briefly cover a few of these blocks in this section and will illustrate the usage of the remaining blocks throughout this manual.

[](---)
# Hierarchical Block-Structure
- The `u` and `v` and blocks define variables, since they are declared in the block.
- The `active` line can be used to turn on/off variables quickly. In this case, only the variable will be used in the simulation. An absent line means all variables are active.
- The block names are user-defined, but must be unique and should not contain non-ASCII characters.

```text
[Variables]
  active = 'u'
  [./u]
    order = FIRST
    family = LAGRANGE
  [../]
  [./v]
    order = FIRST
    family = LAGRANGE
  [../]
[]
[Kernels]
  ...
[]
```

[](---)
# Main Input File Blocks

- MOOSE expects the following basic blocks for a simple problem:
    * [`[Mesh]`](#mesh-block) Specifies the geometry of the problem
    * [`[Variables]`](#variables-block) Defines the unknowns to solve
    * [`[Kernels]`](#kernels-block) Implementation of the domain physics of the problem
    * [`[BCs]`](#boundary-conditions-block) Implementation of the boundary conditions physics for the problem
    * [`[Executioner]`](#executioner-block) Specifies how the problem is to be solved
    * [`[Outputs]`](#outputs-block) Indicate the format and variables to output


[](---)
## Mesh Block

[](.left-50[)

- The `Mesh` block is generally associated with an that reads and/or constructs the mesh for the simulation.
- The default type, `FileMesh`, is suitable for reading any normal mesh format from a file.
- The base class `MooseMesh` can be extended to construct or modify your own Meshes during runtime as needed.
- There are additional advanced options for this and the following blocks which are not listed in this section...

[](])
[](.right-50[)

```text
[Mesh]
  # Optional Type
  type = <FileMesh | GeneratedMesh>
 
  # FileMesh
  file = <filename>
 
  # Some other commonly used options
  uniform_refine = <n>
  second_order = <true|false>
[]
```

[](])

[](---)
## Variables Block

[](.left-50[)

- The `Variables` block declares the nonlinear variables that will be solved for in the simulation.
- The default order and family are `FIRST` and `LAGRANGE`, respectively.

[](])
[](.right-50[)

```text
[Variables]
  [./nonlinear_variable_1]
    order = <FIRST | SECOND | ...>
    family = <LAGRANGE | HERMITE | ...>
  [../]
  
  [./nonlinear_variable2]
      ...
  [../]
[]
```

[](])

[](---)
## Kernels Block

[](.left-50[)

- The `Kernels` block declares PDE operators that will be used in the simulation.
- The `type` parameter is used to specify the type of kernel to instantiate.

[](])
[](.right-50[)

```text
[Kernels]
  [./my_kernel1]
    type = <Any Registered Kernel>
    variable = <Nonlinear Variable Name> 
  [../]
  [./my_kernel2] 
    ...
  [../]
[]
```

[](])

[](---)
## Boundary Conditions Block

[](.left-50[)

- The `BCs` block declares the boundary conditions that will be used in the simulation.
- The `type` parameter is used to specify the type of boundary condition to instantiate.

[](])
[](.right-50[)

```text
[BCs] 
  [./bottom_bc]
    type = <Any Registered BoundaryCondition>
    variable = <Nonlinear Variable Name> 
  [../]
  [./top_bc] 
    ...
  [../] 
[]
```

[](])

[](---)
## Executioner Block

[](.left-50[)

- The `Executioner` block declares the executioner that will be used in the simulation.
- The `type` parameter is used to specify the type of executioner to instantiate.

[](])
[](.right-50[)

```text
[Executioner]
  type = <Steady | Transient | ...>
[]
```

[](])

[](---)
## Outputs Block

[](.left-50[)

- The `Outputs` block controls the various output(s) (to screen and file) used in the simulation.
- Provides control over file format, variable output, output intervals, etc...

[](])
[](.right-50[)

```text
[Outputs]
  file_base = <base_file_name>
  exodus = true
  console = true
[]
```

[](])