The cape.pycart
module¶
The cape.pycart
module contains the top-level interface for Cart3D setup. It
loads the most important methods from the various submodules so that they are
easier to access. Most tasks using the pyCart API can be accessed by loading
this module.
import cape.pycart
For example the following will read in a global settings instance assuming that the present working directory contains the correct files. (If not, various defaults will be used, but it is unlikely that the resulting setup will be what you intended.)
import cape.pycart cntl = pyCart.Cntl()
A simpler example is to simply read a .tri
file, rotate it about the
x-axis by 20 degrees, and write it to a new file.
# Import the module. import cape.pycart # Read the .tri file. tri = pyCart.Tri('bJet.i.tri') # Rotate it. tri.Rotate([0.,0.,0.], [1.,0.,0.], 20) # Write it to a new file. tri.Write('bJet_rotated.i.tri')
Most of the pyCart submodules essentially contain a one or more class
definitions, and some of these classes are accessible directly from
cape.pycart
.
The module also contains the cape.pycart.bin
module, which contains
functions that run the main Cart3D binaries: autoInputs
, cubes
,
mgPrep
, and flowCart
.
The following classes are imported in this module, so that code like
cape.pycart.Tri
will work (although cape.pycart.tri.Tri
) will also work.
Modules included within this one are outlined below.
- Cart3D and Cape files
cape.pycart.runmatrix
- Supporting modules
cape.pycart.cmd
cape.pycart.bin
The following lists the pyCart submodules, which contain the main functionality and define the classes that are the workhorses of pyCart.
cape.pycart.cntl
: Cart3D control module- Cart3D executive class:
cape.pycart.cntl.Cntl
cape.pycart.options
: Cart3D and pyCart Settingscape.pycart.options
: pyCart options interface modulecape.pycart.options.archiveopts
: Cart3D archiving optionscape.pycart.options.configopts
: Cart3Dcomponent config optionscape.pycart.options.rctlopts
: Cart3D run control optionscape.pycart.options.meshopts
: Cart3D-specific volume meshing optionscape.pycart.options.functionalopts
: Objective Function Optionscape.pycart.options.databookopts
: Pycart databook definition optionscape.pycart.options.util
: Utilities for pyCart Options Module
cape.pycart.case
: Case Control Modulecape.pycart.tri
: Cart3D Triangulation Module- Cart3D Triangulation Class:
pyCart.tri.Tri
- Cart3D Annotated Triangulation Class:
pyCart.tri.Triq
cape.pycart.cmd
: Create commands for Cart3D executablescape.pycart.bin
: Cart3D executable interface modulecape.pycart.inputCntl
: Cart3Dinput.cntl
interfacecape.pycart.aeroCsh
: Cart3Daero.csh
interfacepyCart.aeroCsh.AeroCsh
: Cart3D aero.csh Interfacecape.pycart.preSpecCntl
: Cart3D preSpec.c3d.cntl Interface- Cart3D preSpec.c3d.cntl:
pyCart.preSpecCntl.PreSpecCntl
- Global pyCart Data Book:
pyCart.dataBook.DataBook
- Individual data books
- Data book classes for individual cases
- Other
cape.pycart.dataBook
methods cape.pycart.lineLoad
: Sectional loads module- Line load databook:
pyCart.lineLoad.DBLineLoad
- Case line load:
pyCart.lineLoad.CaseLL
- Line Load seam class:
pyCart.lineLoad.CaseSeam
cape.pycart.pointSensor
: Cart3D point sensors modulecape.pycart.report
: Automated report interfacecape.pycart.manage
: Manage pyCart case folderscape.pycart.util