Introduction to CAPE Application Program Interface¶
The various methods used by pyCart, pyFun, and pyOver are based on a set of
Python modules with a few capabilities written in C (with a full Python/C
interface). In order to reduce the number of lines, most of the base
functionality is provided by a common module cape
. Then each of the
modules for individual solvers (cape.pycart
, cape.pyfun
,
cape.pyover
) are based off of this module. Furthermore, pyCart is a
heavily object-oriented implementation in which the vast majority of
capabilities come from customized classes.
The most critical class is cape.cntl.Cntl
, which acts as a template
for the three classes that interact with actually submitting jobs and checking
status. An instance of one of these classes comes from reading all the
settings from a master JSON file. When a user utilizes the
primary command-line interface via a command such as
$ pycart -f run/poweroff.json -c
the program works by loading an instance of cape.pycart.cntl.Cntl
by
reading run/poweroff.json
and using methods of that instance. In this
case, the Python version of the above is shown below.
# Load the pyCart API module import cape.pycart # Read the settings from the JSON file cntl = cape.pycart.Cntl('run/powroff.json') # Do something (in this case, the "-c" command) cntl.DisplayStatus()
The basic modules based on this model are listed below:
Reading the JSON files depends heavily on the cape.options
module. The
majority of JSON settings are defined in cape.json
,
with some of the additional settings particular to each individual solver
defined in cape.pycart.options
, etc.
There are also a collection of helper modules, such as cape.pycart.report
.
These typically provide one or more classes (such as
cape.pycart.report.Report
) which add a few methods to the cape
version. This leads to a definition for the cape.pycart
version of the
module that starts something like the following.
# Import CAPE version import cape.cfdx.report # Definition for pyCart.report.Report based on cape.cfdx.report.Report class Report(cape.cfdx.report.Report): ...
Then the code in cape/pycart/report.py
contains either methods that are
particular to Cart3D or methods that need to be modified from the definitions
in cape/cfdx/report.py
.
Here is a list of modules that are not primarily based on classes. Modules
that are particular to a solver are listed as children of the cape
module.
cape.cfdx.case
cape.pycart.case
cape.pyfun.case
cape.pyover.case
Finally, in addition to the cape.cntl.Cntl
class, there are several
classes that form the basis for the key CAPE functionality.
Class |
Description and discussion |
---|---|
|
Interface to Cart3D-style surface triangulations, can read several
formats, and |
|
CFD raw data database class |
|
Template class for reading and interacting with iterative data from a single case |
Interface to automated reports |
|
Template for interacting with many CFD solver settings file types |
|
Class for reading Fortran namelists |
|
Alternative interface to Fortran namelists |
- The
cape
modulecape.filecntl
: Interfaces for text control filescape.argread
: Command-Line Argument Processorcape.atm
: Atmosphere Modelscapeio
: Binary file input/output toolscape.cgns
: CGNS file interfacecape.color
: Color conversion toolscape.config
: Surface configuration modulecape.convert
: Unit and angle conversion utilitiescape.geom
: Generic geometry utilitiescape.fileutils
: Pure-Python file information utilitiescape.msh
: FLUENT mesh modulenmlfile
: Interface to Fortran namelistnmlerr
: Errors forNmlFile
dataoptdict
: Advanceddict
-based options interfaceopterror
: Errors forOptionsDict
toolsoptdict.optitem
: Tools to access items from option listscape.plot3d
: Python interface to Plot3D filescape.plt
: Interface to Tecplot data filescape.tnakit.statutils
: Statistics toolscape.step
: Python interface to STEP Filescape.tar
: Semiautomatic folder archivingcape.teccli
: Command-line interfaces to Tecplot(R)cape.text
: Module to print docstrings to STDOUTcape.tri
: Surface triangulation modulecape.tricli
: Interfaces to.tri
and related filescape.units
: Unit Conversion Modulecape.util
: Cape utilitiescape.writell
: Collect CAPE line load databookscape.xmlfile
: Extended interface to XML files_cape3
: Compiled CAPE extension
cape.cfdx
: Templates for CFD control toolscape.cntl
: Base module for CFD operations and processingcape.cfdx.case
: Case control modulecape.cfdx.caseutils
: Common functions for case-control modulescape.cfdx.cmd
: Creating system commandscape.cfdx.cmdrun
: Execute system calls for CAPEcape.cfdx.databook
: Post-processed data module- Global data book container class
- Individual data books
- Data book classes for individual cases
- Other
cape.cfdx.databook
methods cape.cfdx.lineload
: Line load databookscape.cfdx.logger
: Logging utilities for CAPEcape.cfdx.pointsensor
: Point sensor databooks- Point sensor group data book
- Individual point sensor data books
cape.cfdx.queue
: Manage PBS and Slurm interfacescape.cfdx.report
: Automated CFD report interfacecape.cfdx.runmatrix
: Run matrix interfacecape.cfdx.volcomp
: Cell volume computation toolscape.cfdx.options
: Options packagecape.cfdx.cli_doc
: Template help messages for CAPE executables
cape.pycart
: Interfaces to Cart3Dcape.pycart.cntl
: Cart3D control modulecape.pycart.options
: Cart3D and pyCart Settingscape.pycart.aerocshfile
: Cart3Daero.csh
interfacecape.pycart.case
: Case Control Modulecape.pycart.cmdgen
: Create commands for Cart3D executablescape.pycart.cmdrun
: Cart3D executable interface modulecape.pycart.databook
: pyCart data book modulecape.pycart.inputcntlfile
: Cart3Dinput.cntl
interfacecape.pycart.lineload
: Sectional loads modulecape.pycart.pointSensor
: Cart3D point sensors modulecape.pycart.prespecfile
: Cart3DpreSpec.c3d.cntl
Interfacecape.pycart.report
: Automated report interfacecape.pycart.tri
: Cart3D.tri
file interfacecape.pycart.util
cape.pyfun
: FUN3D interfacescape.pyfun.cntl
: FUN3D control modulecape.pyfun.options
: FUN3D and pyFun settingscape.pyfun.case
: FUN3D case control modulecape.pyfun.cmdgen
: Create commands for FUN3D executablescape.pyfun.cmdrun
: Calls to FUN3D executablescape.pyfun.databook
: Post-processing for FUN3D datacape.pyfun.faux
: FAUXGeom interface modulecape.pyfun.lineload
: Sectional loads modulecape.pyfun.mapbc
: FUN3D boundary condition modulecape.pyfun.namelist
: FUN3D namelist modulecape.pyfun.pointsensor
: FUN3D point sensors modulecape.pyfun.plt
: Interface to FUN3D Tecplot PLT filescape.pyfun.report
: Automated report interfacecape.pyfun.rubberData
: FUN3D filerubber.data
cape.pyfun.tricli
: Special FUN3D triangulation interfacescape.pyfun.util
: Utilities forpyfun
cape.lava
: Interfaces to LAVA from NASA Amescape.pylava
: CAPE support for NASA’s LAVA solver suitecape.pylavacntl
: LAVA control modulecape.pylava.options
: Options interface for LAVAcape.pylava.case
: LAVACURV case control modulecape.pylava.cmdgen
: Create commands for LAVA executablescape.pylava.dataiterfile
: Interface to LAVAdata.iters
filescape.pylava.report
: Automated report interfacecape.pylava.yamlfile
: Custom class for LAVA input YAML files
cape.pylch
: Interfaces to Loci/CHEMcape.pylch.cntl
: Main Loci/CHEM run matrix controllercape.pylch.options
: Options interface for Loci/CHEMcape.pylch.case
: Loci/CHEM case control modulecape.pylava.cmdgen
: Create commands for LAVA executablescape.pylch.report
: Automated report interfacecape.pylch.varsfile
: Interface for Loci/CHEM.vars
files
cape.pykes
: Interfaces to CREATE-AV Kestrelcape.pykes
: CAPE interface to Kestrel running and processingcape.pykes.cntl
: Kestrel control modulecape.pykes.options
: Options interface for pyKes/Kestrelcape.pykes.case
: Kestrel individual-case modulecape.pykes.jobxml
: Interface to Kestrel main XML control filecape.pykes.cmdgen
: Create commands for Kestrel executablescape.pykes.databook
: Kestrel data book modulecape.pykes.report
: Automated report interface
cape.pyover
: Interfaces to OVERFLOWcape.pyover.cntl
: OVERFLOW control modulecape.pyover.options
: Options interface for pyOver/OVERFLOWcape.pyover.case
: OVERFLOW case control modulecape.pyover.cmdgen
: Create commands for OVERFLOW executablescape.pyover.cmdrun
: OVERFLOW binary interface modulecape.pyover.databook
: DataBook module for OVERFLOWcape.pyover.lineload
: Sectional loads modulecape.pyover.overnmlfile
: OVERFLOW namelist modulecape.pyover.plot3d
: Interface to OVERFLOW Plot3D filescape.pyover.report
: Automated report interfacecape.pyover.util
: Utilities forpyover
cape.dkit
: Package for “datakits”: database + toolkitcape.dkit
: Package for datakits: database + tookitcape.dkit.basedata
: Common ATTDB data containercape.dkit.basefile
: Common ATTDB file type attributescapefile
: Reader for CAPE-specific binary filescape.dkit.csvfile
: Comma-separated value read/writecape.dkit.rdb
: Main DataKit modulecape.dkit.datakithub
: Hub for importing DataKits by namecape.dkit.datakitloader
: DataKit collection toolscape.dkit.dbfm
: Specialized force & moment DataKitscape.dkit.dbll
: Aerodynamic line load DataKitscape.dkit.froot
: Nonlinear equation solvercape.dkit.gitutils
: Very simple git utils for DataKitscape.dkit.matfile
: MATLAB data interfacecape.dkit.metautils
: Metadata tools for DataKit collectionscape.dkit.modutils
: Module docstring utils for DataKitcape.dkit.pkgutils
: Tools for creating DataKit packagescape.dkit.rdbaero
: Database Template for Aerospace Variablescape.dkit.tecdatfile
: ASCII Tecplot(R) column filescape.dkit.textdata
: Generic textual data interfacecape.dkit.tsvfile
: Space-separated value read/writecape.dkit.vendorutils
: Package Vendorization Utilitiescape.dkit.writedb
: Write DataKit processed data to filecape.dkit.xlsfile
: Excel spreadsheet data interface
cape.tnakit
: Basic TNA Python tool kitcape.tnakit.arrayutils
: Tools for NumPy arrayscape.tnakit.kwutils
: Tools for Processing Keyword Argumentscape.tnakit.optitem
: Option list item access toolscape.plot_mpl
: Matplotlib/Pyplot Interfacescape.tnakit.promptutils
: Interactive Console Promptcape.tnakit.rstutils
: Tools for writing ReST filescape.tnakit.textutils.wrap
: Text-wrapping toolkitcape.tnakit.typeutils
: Python 2/3 type-check utils