cape.pycart.report: Automated report interface¶
The pyCart module for generating automated results reports using PDFLaTeX
provides a single class pyCart.report.Report, which is based off the
CAPE version cape.cfdx.report.Report. The cape.cfdx.report.Report class
is a sort of dual-purpose object that contains a file interface using
cape.tex.Tex combined with a capability to create figures for each
case or sweep of cases mostly based on cape.cfdx.dataBook.
An automated report is a multi-page PDF generated using PDFLaTeX. Usually, each CFD case has one or more pages dedicated to results for that case. The user defines a list of figures, each with its own list of subfigures, and these are generated for each case in the run matrix (subject to any command-line constraints the user may specify). Types of subfigures include
Table of the values of the input variables for this case
Table of force and moment values and statistics
Iterative histories of forces or moments (for one or more coefficients)
Iterative histories of residuals
Images using a Tecplot layout
Many more
In addition, the user may also define “sweeps,” which analyze groups of cases defined by user-specified constraints. For example, a sweep may be used to plot results as a function of Mach number for sets of cases having matching angle of attack and sideslip angle. When using a sweep, the report contains one or more pages for each sweep (rather than one or more pages for each case).
Reports are usually created using system commands of the following format.
The class has an immense number of methods, which can be somewhat grouped into
bookkeeping methods and plotting methods. The main user-facing methods are
cape.cfdx.report.Report.UpdateCases() and
cape.cfdx.report.Report.UpdateSweep(). Each
type of subfigure has its own method, for
example cape.cfdx.report.Report.SubfigPlotCoeff() for "PlotCoeff" or
cape.cfdx.report.Report.SubfigPlotL2() for "PlotL2".
- See also:
cape.pycart.options.Reportcape.options.Report
- cape.pycart.report.ImportLineLoad()¶
Import
cape.pycart.lineLoadif not loaded- Call:
>>> pyCart.report.ImportLineLoad()
- Versions:
2016-06-10
@ddalle: First version
- cape.pycart.report.ImportPointSensor()¶
Import
cape.pycart.pointSensorif not loaded- Call:
>>> pyCart.report.ImportPointSensor()
- Versions:
2014-12-27
@ddalle: First version
- class cape.pycart.report.Report(cntl, rep)¶
Interface for automated report generation
- Call:
>>> R = pyCart.report.Report(cart3d, rep)
- Inputs:
- cart3d:
cape.pycart.cntl.Cntl Master Cart3D settings interface
- rep:
str Name of report to update
- cart3d:
- Outputs:
- R:
pyCart.report.Report Automated report interface
- R:
- Versions:
2015-03-07
@ddalle: Started2015-03-10
@ddalle: First version
- GetStateSymbol(coeff, fs)¶
Get a TeX symbol for a coefficient and statistical field
- Call:
>>> sym = R.GetStateSymbol(coeff, fs)
- Inputs:
- R:
pyCart.report.Report Automated report instance
- coeff: Cp | dp | rho | M | T | p
Name of coefficient
- fs: mu | std | err | min | max | u
Statistical quantity
- R:
- Outputs:
- sym:
str TeX symbol (including
$chars) for this field
- sym:
- Versions:
2015-12-18
@ddalle: First version
- LinkVizFiles(sfig=None, i=None)¶
Create links to appropriate visualization files
Specifically,
Components.i.pltandcutPlanes.pltorComponents.i.datandcutPlanes.datare created.
- ReadCaseFM(comp)¶
Read iterative history for a component
This function needs to be customized for each solver
- Call:
>>> FM = R.ReadCaseFM(comp)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- comp:
str Name of component to read
- R:
- Outputs:
- FM:
Noneorcape.cfdx.dataBook.CaseFMderivative Case iterative force & moment history for one component
- FM:
- Versions:
2015-10-16
@ddalle: First version2017-03-27
@ddalle: Added CompID option
- ReadCaseResid(sfig=None)¶
Read iterative residual history for a component
This function needs to be customized for each solver
- Call:
>>> hist = R.ReadCaseResid()
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- R:
- Outputs:
- hist:
Noneorcape.cfdx.dataBook.CaseResidderivative Case iterative residual history for one case
- hist:
- Versions:
2015-10-16
@ddalle: First version2016-02-04
@ddalle: Added argument
- ReadLineLoad(comp, i, targ=None, update=False)¶
Read line load for a case
- Call:
>>> LL = R.ReadLineLoad(comp, i, targ=None, update=False)
- Inputs:
- Outputs:
- LL:
pyCart.lineLoad.CaseLL Individual case line load interface
- LL:
- Versions:
2016-06-10
@ddalle: First version
- ReadPointSensor()¶
Read iterative history for a case
- Call:
>>> P = R.ReadPointSensor()
- Inputs:
- R:
pyCart.report.Report Automated report interface
- R:
- Outputs:
- P:
pyCart.pointSensor.CasePointSensor Iterative history of point sensors
- P:
- Versions:
2015-12-07
@ddalle: First version
- ReadTecscript(fsrc)¶
Read a Tecplot script interface
- Call:
>>> R.ReadTecscript(fsrc)
- Inputs:
- R:
pyCart.report.Report Automated report interface
- fscr:
str Name of file to read
- R:
- Versions:
2016-10-25
@ddalle: First version
- SubfigPlotPoint(sfig, i, q)¶
Plot iterative history of a point sensor state
- SubfigPointSensorTable(sfig, i, q)¶
Create lines for a “PointSensorTable” subfigure
- SubfigSweepPointHist(sfig, fswp, I, q)¶
Plot a histogram of a point sensor coefficient over several cases
- Call:
>>> R.SubfigSweepCoeff(sfig, fswp, I)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- fswp:
str Name of sweep
- I:
numpy.ndarray[int] List of indices in the sweep
- q:
True|False Whether or not to redraw images
- R:
- Versions:
2016-01-16
@ddalle: First version
- SubfigSwitch(sfig, i, lines, q)¶
Switch function to find the correct subfigure function
This function may need to be defined for each CFD solver
- Call:
>>> lines = R.SubfigSwitch(sfig, i, lines)
- Inputs:
- Outputs:
- Versions:
2015-05-29
@ddalle: First version2016-10-25
@ddalle: UpdateFigure -> SubfigSwitch
- SubfigTecplot3View(sfig, i, q)¶
Create image of surface for one component using Tecplot
- Call:
>>> lines = R.SubfigTecplot3View(sfig, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- q:
True|False Whether or not to redraw images
- R:
- Versions:
2014-03-10
@ddalle: First version
- SweepSubfigSwitch(sfig, fswp, I, lines, q)¶
Switch function to find the correct subfigure function
This function may need to be defined for each CFD solver
- Call:
>>> lines = R.SubfigSwitch(sfig, fswp, I, lines, q)
- Inputs:
- Outputs:
- Versions:
2015-05-29
@ddalle: First version2016-10-25
@ddalle: First version, fromUpdateSubfig()