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.RunMatrix

cntl.opts

cape.pylava.options.Options

cntl.DataBook

cape.pylava.databook.DataBook

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

Outputs:
cntl: cape.pylava.cntl.Cntl

Instance of the cape.pylava control class

Data members:
cntl.opts: dict

Dictionary of options for this case (directly from fname)

cntl.x: cape.pylava.runmatrix.RunMatrix

Values and definitions for variables in the run matrix

cntl.RootDir: str

Absolute path to the root directory

Versions:
  • 2024-04-25 @sneuhoff: 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

Versions:
  • 2024-06-12 @sneuhoff: v1.0

PrepareMesh(i: int)

Copy/link mesh files into case folder

Call:
>>> cntl.PrepareMesh(i)
Inputs:
cntl: Cntl

CAPE run matrix controller instance

i: int

Case index

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

PrepareRunYAML(i: int)

Prepare the run YAML file for each phase of one case

Call:
>>> cntl.PrepareRunYAML(i)
Inputs:
cntl: Cntl

CAPE run matrix control instance

i: int

Case index

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

PrepareRunYAMLFlightConditions(i: int)

Prepare the flight conditions variables in a LAVA YAML file

Call:
>>> cntl.PrepareRunYAMLFlightConditions(i)
Inputs:
cntl: Cntl

CAPE run matrix control instance

i: int

Case index

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

ReadRunYAML()

Read run YAML file, using template if setting is empty

Call:
>>> cntl.ReadRunYAML()
Inputs:
cntl: Cntl

CAPE run matrix control instance

Versions:
  • 2024-08-19 @sneuhoff: v1.0 (ReadInputFile())

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

init_post()

Do __init__() actions specific to pylava

Call:
>>> cntl.init_post()
Inputs:
cntl: Cntl

CAPE run matrix control instance

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