Databook module for cape.pycart

This module contains functions for reading and processing forces, moments, and other statistics from cases in a trajectory.

# Read Cart3D control instance
cntl = cape.pycart.cntl.Cntl("pyCart.json")
# Read the data book
cntl.ReadDataBook()
# Get a handle
db = cntl.DataBook

Data book modules are also invoked during update and reporting command-line calls.

$ pycart --aero
$ pycart --ll
$ pycart --report
See Also:

Global pyCart Data Book: pyCart.dataBook.DataBook

class cape.pycart.dataBook.DataBook(cntl, RootDir=None, targ=None, **kw)

Interface to the overall Cart3D run matrix

Call:
>>> DB = pyCart.dataBook.DataBook(x, opts)
Inputs:
x: cape.pycart.runmatrix.RunMatrix

The current pyCart trajectory (i.e. run matrix)

opts: cape.pycart.options.Options

Global pyCart options instance

Outputs:
DB: cape.pycart.dataBook.DataBook

Instance of the pyCart data book class

Versions:
  • 2015-01-03 @ddalle: v1.0

  • 2015-10-16 @ddalle: v1.1: subclass

Individual data books

class cape.pycart.dataBook.DBComp(comp, cntl, targ=None, check=False, lock=False, **kw)
class cape.pycart.dataBook.DBTarget(targ, x, opts, RootDir=None)

Data book classes for individual cases

class cape.pycart.dataBook.CaseFM(comp)

Cart3D iterative force & moment class

This class contains methods for reading data about an the history of an individual component for a single case. It reads the file {comp}.dat where comp is the name of the component. From this file it determines which coefficients are recorded automatically. If some of the comment lines from the Cart3D output file have been deleted, it guesses at the column definitions based on the number of columns.

Call:
>>> FM = CaseFM(comp)
Inputs:
comp: str

Name of component to process

Outputs:
FM: cape.pycart.dataBook.CaseFM

Instance of the force and moment class

FM.coeffs: list[str]

List of coefficients

FM.i: numpy.ndarray shape=(0,)

List of iteration numbers

FM.CA: numpy.ndarray shape=(0,)

Axial force coefficient at each iteration

FM.CY: numpy.ndarray shape=(0,)

Lateral force coefficient at each iteration

FM.CN: numpy.ndarray shape=(0,)

Normal force coefficient at each iteration

FM.CLL: numpy.ndarray shape=(0,)

Rolling moment coefficient at each iteration

FM.CLM: numpy.ndarray shape=(0,)

Pitching moment coefficient at each iteration

FM.CLN: numpy.ndarray shape=(0,)

Yaw moment coefficient at each iteration

Versions:
  • 2014-11-12 @ddalle: v1.0 (aero.FM)

  • 2014-12-21 @ddalle: v1.0

  • 2015-10-16 @ddalle: v2.0; self-contained

class cape.pycart.dataBook.CaseResid

Iterative history class

This class provides an interface to residuals, CPU time, and similar data for a given run directory

Call:
>>> hist = CaseResid()
Outputs:
hist: cape.pycart.dataBook.CaseResid

Instance of the run history class

Versions:
  • 2014-11-12 @ddalle: v1.0

Other cape.pycart.dataBook methods