pofff.core.pofff module#

Command-line entry point and top-level workflow coordination for pofff.

pofff supports connected workflows for FluidFlower history matching:

  • File generation creates OPM Flow, ERT, and Everest input.

  • Single execution runs OPM Flow and generates benchmark data.

  • History matching runs ERT ensemble studies or Everest optimization.

  • Postprocessing creates benchmark maps, metrics, and comparison figures.

This module parses and validates CLI arguments, builds the shared configuration, prepares output folders, dispatches the selected workflows, and reports results. Grid construction, file writing, execution, and visualization are implemented in the utility and visualization modules.

pofff.core.pofff._build_cli_config(args: Namespace, *, pofff_path: Path) CliConfig[source]#

Build normalized CLI configuration object.

Parameters:
argsargparse.Namespace

Parsed command-line arguments.

pofff_pathPath

Package root containing templates, geology, jobs, and benchmark data.

Returns:
CliConfig

Normalized command-line configuration.

pofff.core.pofff._generate_figures(cfg: PofffConfig) None[source]#

Generate benchmark plots and comparison figures.

Parameters:
cfgPofffConfig

Shared pofff configuration and derived runtime state.

pofff.core.pofff._parse_arguments(argv: list[str] | None = None) Namespace[source]#

Define and parse command-line arguments.

Parameters:
argvlist[str] | None, optional

Arguments to parse instead of the process command line.

Returns:
argparse.Namespace

Parsed command-line arguments or the corresponding runtime configuration.

pofff.core.pofff._prepare_jobs_folder(cfg: PofffConfig) None[source]#

Copy job scripts into output/jobs and make them executable.

Parameters:
cfgPofffConfig

Shared pofff configuration and derived runtime state.

pofff.core.pofff._prepare_simulation(cfg: PofffConfig) None[source]#

Prepare directories and generate all input files.

Parameters:
cfgPofffConfig

Shared pofff configuration and derived runtime state.

pofff.core.pofff._run_simulation_steps(cfg: PofffConfig) None[source]#

Run the selected execution mode.

Parameters:
cfgPofffConfig

Shared pofff configuration and derived runtime state.

pofff.core.pofff._validate_arguments(cmdargs: Namespace) None[source]#

Validate command-line arguments and incompatible operations.

Parameters:
cmdargsargparse.Namespace

Parsed command-line arguments.

Raises:
SystemExit

If an argument is invalid or incompatible with the selected workflow.

pofff.core.pofff.main(argv: list[str] | None = None) None[source]#

Main pofff execution routine.

The selected file-generation, simulation, data, history-matching, and plotting stages are executed in dependency order.

Parameters:
argvlist[str] | None, optional

Arguments to parse instead of the process command line.