cape.pylavacntl: LAVA control module¶
This module provides tools to quickly setup basic or complex LAVA run matrices and serve as an executive for pre-processing, running, post-processing, and managing the solutions. A collection of cases combined into a run matrix can be loaded using the following commands.
>>> import cape.pylava >>> cntl = cape.pylava.cntl.Cntl("pyLava.json") >>> cntl <cape.pylava.Cntl(nCase=907)> >>> cntl.x.GetFullFolderNames(0) 'poweroff/m1.5a0.0b0.0'
An instance of this cape.pylava.cntl.Cntl class has many
attributes, which include the run matrix (cntl.x), the options
interface (cntl.opts), and optionally the data book
(cntl.DataBook), the appropriate input files (such as
cntl.Namelist), and possibly others.
Attribute
Class
cntl.x
cape.runmatrix.RunMatrixcntl.opts
cntl.Namelist
cape.pylava.namelist.Namelist
Finally, the Cntl class is subclassed from the
cape.cntl.Cntl class, so any methods available to the CAPE
class are also available here.
- class cape.pylava.cntl.Cntl(fname=None)¶
Class for handling global options and setup for LAVA
This class is intended to handle all settings used to describe a group of LAVA cases. For situations where it is not sufficiently customized, it can be used partially, e.g., to set up a Mach/alpha sweep for each single control variable setting.
The settings are read from a yaml or json file.
- Call:
>>> cntl = cape.pylava.Cntl(fname="pyLava.yaml")
- Inputs:
- fname:
str Name of cape.pylava input file
- fname:
- Outputs:
- cntl:
cape.pylava.cntl.Cntl Instance of the cape.pylava control class
- cntl:
- Data members:
- Versions:
2024-04-25
@sneuhoff: v1.0
- ApplyCase(i: int, nPhase=None, **kw)¶
Apply settings from cntl.opts to an individual case
This rewrites each run namelist file and the
case.jsonfile in the specified directories.- Call:
>>> cntl.ApplyCase(i, nPhase=None)
- Inputs:
- cntl:
cape.pyfun.cntl.Cntl FUN3D control interface
- i:
int Case number
- nPhase: {
None} | positiveint Last phase number (default determined by PhaseSequence)
- cntl:
- Versions:
2016-03-31
@ddalle: v1.0
- GetConfigBody(comp: str, warn: bool = False) list¶
Convert face name to list of MapBC indices
Determine which component indices are in a named component based on the MapBC file, which is always numbered 1,2,…,N. Output the format as a nice string, such as
"4-10,13,15-18".If possible, this is read from the
"Inputs"subsection of the"Config"section of the master JSON file. Otherwise, it is read from the"mapbc"and configuration files.- Call:
>>> cids = cntl.GetConfigInput(comp, warn=False)
- Inputs:
- cntl:
cape.pyfun.cntl.Cntl CAPE main control instance
- comp:
str Name of component to process
- warn:
True| {False} Whether or not to print warnings if not raising errors
- cntl:
- Outputs:
- Versions:
2025-05-16
@ddalle: v1.0 (from GetConfigInput())
- GetConfigInput(comp: str, warn: bool = False)¶
Convert face name to list of MapBC indices
Determine which component indices are in a named component based on the MapBC file, which is always numbered 1,2,…,N. Output the format as a nice string, such as
"4-10,13,15-18".If possible, this is read from the
"Inputs"subsection of the"Config"section of the master JSON file. Otherwise, it is read from the"mapbc"and configuration files.- Call:
>>> cntl.GetConfigInput(comp, warn=False)
- Inputs:
- cntl:
cape.pyfun.cntl.Cntl CAPE main control instance
- comp:
str Name of component to process
- warn:
True| {False} Whether or not to print warnings if not raising errors
- cntl:
- Outputs:
- inp:
str String describing list of integers included
- inp:
- Versions:
2026-05-01
@ddalle: v1.0
- PrepareCase(i: int)¶
Prepare case for running if necessary
- Call:
>>> cntl.PrepareCase(i)
- Inputs:
- cntl:
cape.pylava.cntl.Cntl Instance of control class containing relevant parameters
- i:
int Index of case to analyze
- cntl:
- Versions:
2024-06-12
@sneuhoff: v1.0
- ReadCartInputFile()¶
Read LAVA-Cartesian input file,
run.inputs- Call:
>>> cntl.ReadCartInputFile()
- Inputs:
- cntl:
Cntl CAPE run matrix control instance
- cntl:
- Version:
2025-07-14
@ddalle: v1.0