cape.pylava.casecntl: LAVA case control module

This module contains LAVACURV-specific versions of some of the generic methods from cape.cfdx.case.

All of the functions from cape.case are imported here. Thus they are available unless specifically overwritten by specific cape.pylava versions.

class cape.pylava.casecntl.CaseRunner(fdir: str | None = None)
check_alt_exit(j: int | None = None) bool

Check for solver-selected exit, e.g. convergence target hit

Call:
>>> q = runner.check_alt_exit(j=None)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: {None} | int

Phase index

Outputs:
q: bool

True if no listed files have been modified recently

Versions:
  • 2025-08-14 @ddalle: v1.0

check_complete() bool

Check if a case is complete (DONE)

In addition to the standard CAPE checks, this version checks residuals convergence udner certain conditions.

Call:
>>> q = runner.check_complete()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Versions:
  • 2024-09-16 @sneuhoff: v1.0

  • 2024-10-11 @ddalle: v2.0; use parent method directly

finalize_files(j: int)

Clean up files after running one cycle of phase j

Call:
>>> runner.finalize_files(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase number

Versions:
  • 2024-10-11 @ddalle: v1.0

genr8_restart_regex() str

Return a regular expression that matches all restart files

Call:
>>> pat = runner.genr8_restart_regex()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Outputs:
pat: str

Regular expression pattern

Versions:
  • 2025-08-14 @ddalle: v1.0

get_ctu() float

Get the most recent iteration Char. Time Unit value

Call:
>>> t = runner.get_ctu()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Outputs:
t: float

Last time step (characteristic units)

Versions:
  • 2025-08-14 @sneuhoff: v1.0

get_ctu_max(j: int | None = None) float

Get the characteristic time units cutoff for phase j

Call:
>>> t = runner.get_ctu_max()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Outputs:
t: float

Last time step (characteristic units)

Versions:
  • 2025-08-15 @sneuhoff: v1.0

get_restart_file(j: int | None = None) str | None

Get the most recent restart file for phase j

Call:
>>> restartfile = runner.get_restart_file(j=None)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: {None} | int

Phase number

Versions:
  • 2024-11-05 @ddalle: v1.0

getx_iter()

Get the most recent iteration number for a LAVA case

Call:
>>> n = runner.getx_iter()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Outputs:
n: int | None

Last iteration number

Versions:
  • 2024-08-02 @sneuhoff: v1.0

  • 2024-10-11 @ddalle: v2.0; use DataIterFile(meta=True)

getx_restart_iter() int

Get total iteration number of most recent flow file

Call:
>>> n = runner.getx_restart_iter()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Outputs:
n: int

Index of most recent check file

Versions:
  • 2024-09-16 @sneuhoff: v1.0

init_post()

Custom initialization for pyfun

Call:
>>> runner.init_post()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Versions:
  • 2023-06-28 @ddalle: v1.0

Link the most recent visualization files

Call:
>>> runner.link_viz()
Inputs:
runner: CaseRunner

Controller to run one case of solver

Versions:
  • 2025-07-25 @jmeeroff: v1.0

  • 2025-07-28 @ddalle: v1.1; bug for subfolder links

prepare_files(j: int)

Prepare files for phase j, LAVA-specific

Call:
>>> runner.prepare_files(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase index

Versions:
  • 2025-07-28 @ddalle: v1.0

prepare_restart(j: int)

Automatically configure a case to restart if appropriate

Call:
>>> runner.prepare_restart(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase number

Versions:
  • 2025-08-14 @ddalle: v1.0

prepare_restart_cartesian(j: int)

Automatically configure LAVA-Cartesian for restart

Call:
>>> runner.prepare_restart_cartesian(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase number

Versions:
  • 2025-08-14 @ddalle: v1.0

read_data_iter(fname: str = 'data.iter', meta: bool = False, force: bool = False) DataIterFile

Read data.iter, if present

Call:
>>> db = runner.read_data_iter(fname, meta=False)
Inputs:
runner: CaseRunner

Controller to run one case of solver

fname: {"data.iter"} | str

Name of file to read

meta: {True} | False

Option to only read basic info such as last iter

force: True | {False}

Reread even if cached

Versions:
  • 2024-08-02 @sneuhoff; v1.0

  • 2024-10-11 @ddalle: v2.0

  • 2025-08-14 @ddalle: v2.1; cache, force

read_runinputs(j: int | None = None) CartInputFile

Read case’s LAVA-Cartesian input file

Call:
>>> yamlfile = runner.read_runinputs(j=None)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: {None} | int

Phase number

Outputs:
yamlfile: CartInputFile

LAVA YAML input file interface

Versions:
  • 2025-08-14 @ddalle: v1.0

  • 2025-09-03 @ddalle: v1.1; check for file

read_runyaml(j: int | None = None) RunYAMLFile

Read case’s LAVA-Curvilinear input file

Call:
>>> yamlfile = runner.read_runyaml(j=None)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: {None} | int

Phase number

Outputs:
yamlfile: RunYAMLFile

LAVA YAML input file interface

Versions:
  • 2024-10-11 @ddalle: v1.0

run_phase(j: int)

Run one phase using appropriate commands

Call:
>>> runner.run_phase(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase number

Versions:
  • 2024-08-02 @sneuhoff: v1.0

  • 2024-10-11 @ddalle: v1.1; split run_superlava()

run_superlava(j: int)

Run one phase of the superlava executable

Call:
>>> runner.run_superlava(j)
Inputs:
runner: CaseRunner

Controller to run one case of solver

j: int

Phase number

Versions:
  • 2024-10-11 @ddalle: v1.0

cape.pylava.casecntl.LinkViz()

Link the most recent viz files to fixed file names

Call:
>>> LinkPLT()
Versions:
  • 2025-07-28 @jmeeroff: v1.0

cape.pylava.casecntl.run_lavacurv()

Setup and run the appropriate LAVACURV command

Call:
>>> run_lavacurv()
Versions:
  • 2024-09-30 @sneuhoff: v1.0;