cape.pykes.cntl: Kestrel control module¶
This module provides tools to quickly setup basic or complex Kestrel 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.pykes.cntl >>> cntl = cape.pykes.cntl.Cntl("pyKes.json") >>> cntl <cape.pyfun.Cntl(nCase=892)> >>> cntl.x.GetFullFolderNames(0) 'poweroff/m1.5a0.0b0.0'
An instance of this cape.pykes.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.), and possibly others.
Attribute
Class
cntl.x
cape.runmatrix.RunMatrixcntl.opts
cntl.DataBook
cntl.JobXML
cape.cfdx.cntl.Cntl class, so any methods available to the CAPE
class are also available here.
- class cape.pykes.cntl.Cntl(fname=None)¶
Class for handling global options and setup for Kestrel
This class is intended to handle all settings used to describe a group of Kestrel cases.
The settings are read from a JSON file.
Defaults are read from the file
options/pyKes.default.json.- Call:
>>> cntl = Cntl(fname="pyKes.json")
- Inputs:
- fname:
str Name of pyKes input file
- fname:
- Outputs:
- cntl:
cape.pykes.cntl.Cntl Instance of the pyKes control class
- cntl:
- Data members:
- Versions:
2015-10-16
@ddalle: Started
- ApplyCase(i, 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: Version 1.0
- CheckMesh(i)¶
Check if the mesh for case i is prepared
- FindXMLPaths(j=0)¶
Find all Path and File elements
- Call:
>>> elems = cntl.FindXMLPaths(j=0)
- Inputs:
- cntl:
cape.pykes.cntl.Cntl Run matrix control interface
- j: {
0} |int Phase number
- cntl:
- Outputs:
- elems:
list[Element] List of XML elements
- elems:
- Versions:
2021-10-25
@ddalle: Version 1.0
- GetMeshFileNames(j=0)¶
Get list of copy/link files from both JSON and XML
- PrepareCase(i)¶
Prepare a case for running if necessary
- PrepareJobXML(i)¶
Write
pykes.xmlfile(s) for case i
- PrepareMesh(i)¶
Prepare the mesh for case i if necessary
- ReadJobXML(j=0, q=True)¶
Read the
fun3d.nmlfile- Call:
>>> cntl.ReadNamelist(j=0, q=True)
- Inputs:
- cntl:
cape.pykes.cntl.Cntl Run matrix control interface
- j: {
0} |int Phase number
- q: {
True} |False Option read to JobXML, else JobXML0
- cntl:
- Versions:
2021-10-18
@ddalle: Version 1.0
- cli(*a, **kw)¶
Command-line interface
- Call:
>>> cntl.cli(*a, **kw)
- Inputs:
- cntl:
cape.pykes.cntl.Cntl CAPE main control instance
- kw:
dict(True|False|str) Unprocessed keyword arguments
- cntl:
- Outputs:
- cmd:
None|str Name of command that was processed, if any
- cmd:
- Versions:
2018-10-19
@ddalle: Content frombin/executables
- get_job_name(j=0)¶
Get “job name” for phase j
- init_post()¶
Do
__init__()actions specific topyfun- Call:
>>> cntl.init_post()
- Inputs:
- cntl:
cape.cfdx.cntl.Cntl CAPE run matrix control instance
- cntl:
- Versions:
2023-07-10
@ddalle: v1.0