3.4.6.5. InputReader

InputReader reads a .pro input file and constructs the analysis state (props and globdat). It can also read a previously saved dump to restore the full state.

3.4.6.5.1. Overview

Function: InputReader(argv) and InputRead(fname, dname=None, parameters=None)

  • Reads properties from a .pro file; parses mesh, elements, dofs, models.

  • Sets up logging, prefix, and initial global state.

  • Optionally reads a dump file (pickle) to restore state instead of parsing.

3.4.6.5.2. Command-Line Arguments

Option

Description

-i, --input

Path to the .pro file

-d, --dump

Path to a pickle dump (created by DataDump) to restore state

-p, --param

Override parameters as name=value (can be repeated)

-h, --help

Show help

3.4.6.5.3. Programmatic Use

Function

Description

InputRead(fname, dname=None, parameters=None)

Returns props, globdat; reads from fname or dname when provided.

3.4.6.5.4. Examples

  • Read from a .pro file:

from pyfem.io.InputReader import InputRead
props, globdat = InputRead("examples/ch03/cantilever8.pro")
  • Restore from a dump:

props, globdat = InputRead(None, dname="results/run.dump")

3.4.6.5.5. See Also