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.report.ImportLineLoad()

Import cape.pycart.lineLoad if not loaded

Call:
>>> pyCart.report.ImportLineLoad()
Versions:
  • 2016-06-10 @ddalle: First version

cape.pycart.report.ImportPointSensor()

Import cape.pycart.pointSensor if 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

Outputs:
R: pyCart.report.Report

Automated report interface

Versions:
  • 2015-03-07 @ddalle: Started

  • 2015-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

Outputs:
sym: str

TeX symbol (including $ chars) for this field

Versions:
  • 2015-12-18 @ddalle: First version

LinkVizFiles(sfig=None, i=None)

Create links to appropriate visualization files

Specifically, Components.i.plt and cutPlanes.plt or Components.i.dat and cutPlanes.dat are created.

Call:
>>> R.LinkVizFiles(sfig, i)
Inputs:
R: pyCart.report.Report

Automated report interface

sfig: str

Name of the subfigure

i: int

Case index

See Also:

pyCart.case.LinkPLT()

Versions:
  • 2016-02-06 @ddalle: First version

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

Outputs:
FM: None or cape.cfdx.dataBook.CaseFM derivative

Case iterative force & moment history for one component

Versions:
  • 2015-10-16 @ddalle: First version

  • 2017-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

Outputs:
hist: None or cape.cfdx.dataBook.CaseResid derivative

Case iterative residual history for one case

Versions:
  • 2015-10-16 @ddalle: First version

  • 2016-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:
R: pyCart.report.Report

Automated report interface

comp: str

Name of line load component

i: int

Case number

targ: {None} | str

Name of target data book to read, if not None

update: True | {False}

Whether or not to attempt an update if case not in data book

Outputs:
LL: pyCart.lineLoad.CaseLL

Individual case line load interface

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

Outputs:
P: pyCart.pointSensor.CasePointSensor

Iterative history of point sensors

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

Versions:
  • 2016-10-25 @ddalle: First version

SubfigPlotPoint(sfig, i, q)

Plot iterative history of a point sensor state

Call:
>>> lines = R.SubfigPlotPoint(sfig, i, q)
Inputs:
R: pyCart.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

Versions:
  • 2015-12-07 @ddalle: First version

SubfigPointSensorTable(sfig, i, q)

Create lines for a “PointSensorTable” subfigure

Call:
>>> lines = R.SubfigPointTable(sfig, i, q)
Inputs:
R: pyCart.report.Report

Automated report interface

sfig: str

Name of subfigure to update

i: int

Case index

q: True | False

Whether or not to redraw images

Versions:
  • 2015-12-07 @ddalle: First version

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

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:
R: pyCart.report.Report

Automated report interface

sfig: str

Name of subfigure to update

i: int

Case index

lines: list[str]

List of lines already in LaTeX file

q: True | False

Whether or not to redraw images

Outputs:
lines: list[str]

Updated list of lines for LaTeX file

Versions:
  • 2015-05-29 @ddalle: First version

  • 2016-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

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:
R: cape.cfdx.report.Report

Automated report interface

sfig: str

Name of subfigure to update

fswp: str

Name of sweep

I: numpy.ndarray (list)

List of case indices in the subsweep

lines: list[str]

List of lines already in LaTeX file

q: True | False

Whether or not to redraw images

Outputs:
lines: list[str]

Updated list of lines for LaTeX file

Versions:
  • 2015-05-29 @ddalle: First version

  • 2016-10-25 @ddalle: First version, from UpdateSubfig()