cape.pycart.dataBook
: pyCart data book module¶
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
- class cape.pycart.dataBook.CaseFM(comp: str, **kw)¶
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
- comp:
- Outputs:
- fm:
cape.pycart.dataBook.CaseFM
Instance of the force and moment class
- fm.coeffs:
list
[str
] List of coefficients
- fm:
- class cape.pycart.dataBook.CaseResid(**kw)¶
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
- hist:
- class cape.pycart.dataBook.DBComp(comp, cntl, targ=None, check=False, lock=False, **kw)¶
- class cape.pycart.dataBook.DBTarget(targ, x, opts, RootDir=None)¶
- class cape.pycart.dataBook.DBTriqFM(x, opts, comp, **kw)¶
Force and moment component extracted from surface triangulation
- Call:
>>> DBF = DBTriqFM(x, opts, comp, RootDir=None)
- Inputs:
- x:
cape.runmatrix.RunMatrix
RunMatrix/run matrix interface
- opts:
cape.options.Options
Options interface
- comp:
str
Name of TriqFM component
- RootDir: {
None
} |st
Root directory for the configuration
- x:
- Outputs:
- DBF:
cape.pycart.dataBook.DBTriqFM
Instance of TriqFM data book
- DBF:
- Versions:
2017-03-29
@ddalle
: v1.0
- GetTriqFile()¶
Get most recent
triq
file and its associated iterations- Call:
>>> qtriq, ftriq, n, i0, i1 = DBF.GetTriqFile()
- Inputs:
- DBF:
cape.pycart.dataBook.DBTriqFM
Instance of TriqFM data book
- DBF:
- Outputs:
- Versions:
2016-12-19
@ddalle
: v1.0
- 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
- x:
- Outputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of the pyCart data book class
- DB:
- Versions:
2015-01-03
@ddalle
: v1.02015-10-16
@ddalle
: v1.1: subclass
- Delete(I)¶
Delete list of cases from data book
- Call:
>>> DB.Delete(I)
- Inputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of the pyCart data book class
- I:
list
[int
] List of trajectory indices or update all cases in trajectory
- DB:
- Versions:
2015-03-13
@ddalle
: v1.0
- GetCurrentIter()¶
Determine iteration number of current folder
- Call:
>>> n = DB.GetCurrentIter()
- Inputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of data book class
- DB:
- Outputs:
- n:
int
|None
Iteration number
- n:
- Versions:
2017-04-13
@ddalle
: v1.0
- ReadCaseFM(comp)¶
Read a
CaseFM
object- Call:
>>> FM = DB.ReadCaseFM(comp)
- Inputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of data book class
- comp:
str
Name of component
- DB:
- Outputs:
- FM:
pyFun.dataBook.CaseFM
Residual history class
- FM:
- Versions:
2017-04-13
@ddalle
: First separate version
- ReadCaseResid()¶
Read a
CaseResid
object- Call:
>>> H = DB.ReadCaseResid()
- Inputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of data book class
- DB:
- Outputs:
- H:
pyFun.dataBook.CaseResid
Residual history class
- H:
- Versions:
2017-04-13
@ddalle
: First separate version
- ReadDBComp(comp, check=False, lock=False)¶
Initialize data book for one component
- Call:
>>> DB.ReadDBComp(comp, check=False, lock=False)
- Inputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of the pyCart data book class
- comp:
str
Name of component
- check:
True
| {False
} Whether or not to check LOCK status
- lock:
True
| {False
} If
True
, wait if the LOCK file exists
- DB:
- Versions:
2015-11-10
@ddalle
: v1.02016-06-27
@ddalle
: v1.1; add targ keyword2017-04-13
@ddalle
: v2.0; self-contained
- ReadLineLoad(comp, conf=None, targ=None)¶
Read a line load data book target if not already present
- Call:
>>> DB.ReadLineLoad(comp)
- Inputs:
- Versions:
2015-09-16
@ddalle
: v1.02016-06-27
@ddalle
: v1.1; add targ
- ReadPointSensor(name, pts=None)¶
Read a point sensor group if it is not already present
- Call:
>>> DB.ReadPointSensor(name)
- Inputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of the pyCart data book class
- name:
str
Name of point sensor group
- DB:
- Versions:
2015-12-04
@ddalle
: v1.0
- ReadTarget(targ)¶
Read a data book target if it is not already present
- Call:
>>> DB.ReadTarget(targ)
- Inputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of the Cape data book class
- targ:
str
Target name
- DB:
- Versions:
2015-09-16
@ddalle
: v1.0
- ReadTriqFM(comp, check=False, lock=False)¶
Read a TriqFM data book if not already present
- Call:
>>> DB.ReadTriqFM(comp, check=False, lock=False)
- Inputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of pyCart data book class
- comp:
str
Name of TriqFM component
- check:
True
| {False
} Whether or not to check LOCK status
- lock:
True
| {False
} If
True
, wait if the LOCK file exists
- DB:
- Versions:
2017-03-29
@ddalle
: v1.0
- UpdatePointSensor(name, I=None)¶
Update a point sensor group data book for a list of cases
- Call:
>>> DB.UpdatePointSensorGroup(name) >>> DB.UpdatePointSensorGroup(name, I)
- Inputs:
- DB:
cape.pycart.dataBook.DataBook
Instance of the pyCart data book class
- I:
list
[int
] orNone
List of trajectory indices or update all cases in trajectory
- DB:
- Versions:
2015-10-04
@ddalle
: v1.0