.. _InputFileAnatomy: ############################################################################### Anatomy of an Input File ############################################################################### A GEOS simulation is described entirely by one or more XML input files. There is no graphical pre-processor and no scripting language to learn: the XML file declares *what* is simulated (mesh, materials, physics, boundary conditions) and *when* things happen (time stepping, outputs). This page explains how such a file is organized and how its parts are connected. For a hands-on walkthrough of a complete file, see :ref:`TutorialSinglePhaseFlowWithInternalMesh`. Top-level blocks ================ Every input file has a single root element ````. Its children are the following blocks. Each block is optional in the schema, but a typical simulation uses the first nine. .. list-table:: :header-rows: 1 :widths: 22 78 * - Block - Purpose * - ```` - The computational mesh: generated internally (``InternalMesh``, ``InternalWellbore``) or imported from a file (``VTKMesh``). Wells are declared here too. See :ref:`Meshes`. * - ```` - Simple geometric objects (``Box``, ``Cylinder``, ``Disc``, ``Rectangle``, ``ThickPlane``, ``CustomPolarObject``) used to define named *sets* of mesh objects, or fracture planes. * - ```` - Groups mesh cell blocks into regions (``CellElementRegion``) and assigns materials to them. Fracture (``SurfaceElementRegion``) and well (``WellElementRegion``) regions are also declared here. * - ```` - Material models: fluids, solids, porosity, permeability, relative permeability, etc. See :ref:`Constitutive`. * - ```` - Spatial discretizations: finite-volume flux approximations and finite-element spaces. See :ref:`NumericalMethodsManager`. * - ```` - Physics solvers and their nonlinear/linear solver settings. See :ref:`Solvers`. * - ```` - Initial conditions, boundary conditions and source terms. See :ref:`FieldSpecification`. * - ```` - The simulation timeline: when solvers, outputs and tasks run, and when the run ends. See :ref:`EventManager`. * - ```` - Output formats (``VTK``, ``Silo``, ``TimeHistory``, ``Restart``, ...). See :ref:`Outputs`. * - ```` - Tables and analytical functions used to make inputs vary in time or space. See :ref:`FunctionManager`. * - ```` - Actions that are not physics solvers: data collection, statistics, initialization, constitutive model drivers. See :ref:`TasksManager`. * - ```` - Other XML files to merge into this one (see below). * - ```` - Named values for the XML preprocessor (see below). * - ```` - External data sources (e.g. VTK hierarchical data) referenced by the mesh. * - ```` - Particle regions, used by the Material Point Method solver. * - ```` - Machine-specific settings used by the performance benchmark suite. How blocks refer to each other ============================== Every object in the file has a ``name`` attribute. Other objects refer to it by that name. This is how the blocks above are connected: no block is implicitly linked to another. The example below is a complete, runnable deck, adapted from ``inputFiles/singlePhaseFlow/3D_10x10x10_compressible_base.xml`` and its ``_smoke.xml`` companion. Comments mark each cross-reference. .. code-block:: xml The references used most often are summarized below. .. list-table:: :header-rows: 1 :widths: 30 35 35 * - Attribute - Found in - Refers to the ``name`` of * - ``cellBlocks`` - ``CellElementRegion`` - cell blocks created by the mesh (``cellBlockNames`` of ``InternalMesh``, or region attribute values of a ``VTKMesh``). ``{ * }`` selects all of them. * - ``materialList`` - ``CellElementRegion`` - models in ````. Solvers find the fluid, solid, etc. they need in the ``materialList`` of their target regions. * - ``solidModelName``, ``porosityModelName``, ``permeabilityModelName`` - composite solid models (e.g. ``CompressibleSolidConstantPermeability``, ``PorousElasticIsotropic``) - other models in ````. * - ``targetRegions`` - every solver - regions in ````. * - ``discretization`` - flow and mechanics solvers - an object in ````. * - ``flowSolverName``, ``solidSolverName``, ``wellSolverName`` - coupled solvers (poromechanics, reservoir + wells, ...) - other solvers in ````. * - ``objectPath`` - field specifications - a path in the mesh hierarchy: ``ElementRegions//`` for cell fields, ``nodeManager`` for nodal fields, ``faceManager`` for face fields. * - ``setNames`` - field specifications - sets of mesh objects: geometric objects from ````, sets created by the mesh generator, or the built-in set ``all``. See :ref:`FieldSpecification`. * - ``functionName`` - field specifications - a function in ````. * - ``target`` - events - an absolute path to a solver, output or task: ``/Solvers/``, ``/Outputs/``, ``/Tasks/``. A misspelled name is the most common error in a new input file, and GEOS stops with an error when a reference cannot be resolved. Splitting a deck: ```` ================================ Large decks are usually split into a *base* file (physics, materials, regions) and smaller *driver* files (mesh resolution, run length) that include it: .. code-block:: xml Relative paths are resolved from the location of the including file. Several input files can also be given on the command line (``geos -i a.xml -i b.xml``); they are merged in the same way. Merge rules are described in :ref:`InputFiles`. Parameters and units: ```` ====================================== ```` defines named values that can be reused anywhere in the file as ``$name$``. These, along with units (e.g. ``"1 [min]"``) and inline arithmetic (e.g. ``"`$t0$+$dt$`"``), are handled by the Python XML preprocessor, not by GEOS itself. A file using them must be preprocessed before running; see :ref:`AdvancedXMLFeatures`. Looking up any element or attribute =================================== The complete list of XML elements and attributes, with types, defaults and descriptions, is generated from the code and always up to date: * :doc:`/docs/sphinx/datastructure/CompleteXMLSchema` lists every element. For example, the solver used above is documented at :ref:`XML_SinglePhaseFVM`. * Your build of GEOS can write its own schema with ``geos -s schema.xsd``. Point your XML editor at this file to get validation and auto-completion (see :ref:`InputFiles`). * ``geos -i input.xml -v`` reads and checks an input file without running the simulation.