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
cape.cfdx.cmdrun
cape.pyover.cmdrun
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 |
cape.cfdx: Templates for CFD control toolscape.cfdx.cntl: Base module for CFD operations and processingcape.cfdx.cntlbase: Abstract base module for run matrix controlcape.cfdx.casecntl: Case control modulecape.cfdx.casedata: Single-case data interfacescape.cfdx.caseutils: Common functions for case-control modulescape.cfdx.casecntlbase: Abstract base classes for case interfacecape.cfdx.archivist: File archiving and clean-up for casescape.cfdx.autocomplete: Shell completion for CAPE CLIcape.cfdx.cli: Command-line interface tocape(executable)cape.cfdx.cmd: Creating system commandscape.cfdx.cmdrun: Execute system calls for CAPEcape.cfdx.databook: Post-processed data modulecape.cfdx.databookbase: Abstract base classes for DataBookcape.cfd.dex: Exchange data b/w CFD case and DataBookcape.cfdx.lineload: Line load databookscape.cfdx.logger: Logging utilities for CAPEcape.cfdx.ll: Line load interfacescape.cfdx.manage: Manage file counts and quotascape.cfdx.pointsensor: Point sensor databookscape.cfdx.queue: Manage PBS and Slurm interfacescape.cfdx.report: Automated CFD report interfacecape.cfdx.runmatrix: Run matrix interfacecape.cfdx.tarcmd: Common tar/untar utilitiescape.cfdx.triqfm: Module for reading patch loads from one casecape.cfdx.volcomp: Cell volume computation toolscape.cfdx.options: Options package
cape.pycart: Interfaces to Cart3Dcape.pycart.cntl: Cart3D control modulecape.pycart.options: Cart3D and pyCart Settingscape.pycart.aerocshfile: Cart3Daero.cshinterfacecape.pycart.archivist: Archiving actions specific to Cart3Dcape.pycart.case: Case Control Modulecape.pycart.cli: Interface topycartexecutablecape.pycart.cmdgen: Create commands for Cart3D executablescape.pycart.cmdrun: Cart3D executable interface modulecape.pycart.databook: pyCart data book modulecape.pycart.inputcntlfile: Cart3Dinput.cntlinterfacecape.pycart.lineload: Sectional loads modulecape.pycart.pointSensor: Cart3D point sensors modulecape.pycart.prespecfile: Cart3DpreSpec.c3d.cntlInterfacecape.pycart.report: Automated report interfacecape.pycart.tri: Cart3D.trifile interfacecape.pycart.util
cape.pyfun: FUN3D interfacescape.pyfun.cntl: FUN3D control modulecape.pyfun.options: FUN3D and pyFun settingscape.pyfun.casecntl: FUN3D case control modulecape.pyfun.cli: Interface topyfunexecutablecape.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.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.datacape.pyfun.tricli: Special FUN3D triangulation interfaces
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.casecntl: LAVA case control modulecape.pylava.cli: Interface topylavaexecutablecape.pylava.cmdgen: Create commands for LAVA executablescape.pylava.databook: LAVA data book modulecape.pylava.dataiterfile: Interface to LAVAdata.itersfilescape.pylava.report: Automated report interfacecape.pylava.runinpfile: Interface to LAVA-Cartesian input filescape.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.pylch.cli: Interface topylchexecutablecape.pylava.cmdgen: Create commands for LAVA executablescape.pylch.databook: Loci/CHEM data book modulecape.pylch.fmfile: Read force & moment historiescape.pylch.report: Automated report interfacecape.pylch.varsfile: Interface for Loci/CHEM.varsfiles
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.cli: Interface topykesexecutablecape.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.cli: Interface topyoverexecutablecape.pyover.cmdgen: Create commands for OVERFLOW executablescape.pyover.databook: DataBook module for OVERFLOWcape.pyover.overnmlfile: OVERFLOW namelist modulecape.pyover.plot3d: Interface to OVERFLOW Plot3D filescape.pyover.pointsensor: OVERFLOW point sensor data interfacecape.pyover.report: Automated report interfacecape.pyover.util: Utilities forpyover
cape.pyus: US3D interfacescape.pyus.casecntl: US3D Case control modulecape.pyus.cli: Command-line interface topyuscape.pyus.cmdgen: Create commands for US3D executablescape.pyus.cmdrun: US3D binary interface modulecape.pyus.us3d: US3D control modulecape.pyus.inputinpfile: US3D primary input file interfacecape.pyus.options.Archive: US3D archiving optionscape.pyus.options.configopts: US3D configuration optionscape.pyus.options.inputInp: US3Dinput.inpoptionscape.pyus.options.runctlopts: US3D run control optionscape.pyus.options.util: Utilities for pyUS options module
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.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