pyCAPS
pyCAPS: A Python Extension Module for CAPS
Loading...
Searching...
No Matches
Problem Class Reference

Defines a CAPS Problem Object. More...

Inherits object.

Inherited by capsProblem.

Public Member Functions

 __init__ (self, problemName, phaseName=None, phaseStart=None, capsFile=None, outLevel=1, phaseContinuation=True, phaseReadOnly=False)
 Initialize the problem.
 
 close (self)
 Exlicitly closes CAPS Problem Object.
 
 closePhase (self, phaseName=None)
 Completes the Phase and closes the CAPS Problem Object.
 
 intentPhrase (self, lines)
 Set the current intent phrase.
 
 name (self)
 Property returns the name of the CAPS Problem Object.
 
 journaling (self)
 Boolean indicator if the CAPS Problem Object is currently journaling.
 
 setOutLevel (self, outLevel)
 Set the verbosity level of the CAPS output.
 
 autoLinkParameter (self, param=None)
 Create a link between a created CAPS parameter and analyis inputs of all loaded AIMs, automatically.
 
 createTree (self, filename="myProblem", **kwargs)
 Create a HTML dendrogram/tree of the current state of the problem.
 

Detailed Description

Defines a CAPS Problem Object.

The Problem Object is the top-level object for a single mission/problem. It maintains a single set of interrelated geometric models (see ProblemGeometry), analyses to be executed (see Analysis), connectivity and data (see Bound) associated with the run(s), which can be both multi-fidelity and multi-disciplinary.

Parameters
Problem.geometryProblemGeometry instances representing the CSM geometry
Problem.analysisAnalysisSequence of Analysis instances
Problem.parameterParamSequence of ValueIn parameters
Problem.boundBoundSequence of Bound instances
Problem.attrAttrSequence of ValueIn attributes

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  problemName,
  phaseName = None,
  phaseStart = None,
  capsFile = None,
  outLevel = 1,
  phaseContinuation = True,
  phaseReadOnly = False 
)

Initialize the problem.

Parameters
problemNameCAPS problem name that serves as the root directory for all file I/O.
phaseNamethe current phase name (None is equivalent to 'Scratch')
phaseStartname of the phase used to start the new phase
capsFileCAPS file to load. If starting a new phase then this file will replaced the csm file used in previous phases without checking for differences. Options: *.csm or *.egads.
outLevelLevel of output verbosity. See setOutLevel .
phaseContinuationuse continuation for a open phase, otherwise the phase is first deleted on disk
phaseReadOnlyopen a closed Phase in Read Only mode

Member Function Documentation

◆ autoLinkParameter()

autoLinkParameter (   self,
  param = None 
)

Create a link between a created CAPS parameter and analyis inputs of all loaded AIMs, automatically.

Valid CAPS value, parameter objects must be created with Problam.parameter.create(). Note, only links to ANALYSISIN inputs are currently made at this time.

Parameters
paramParameter to use when creating the link (default - None). A combination (i.e. a single or list) of ValueIn dictionary entries and/or value object instances (returned from a call to Problam.parameter.create()) can be used. If no value is provided, all entries in the ValueIn dictionary (ValueIn) will be used.

◆ close()

close (   self)

Exlicitly closes CAPS Problem Object.

This method is mainly useful for testing purposes

◆ closePhase()

closePhase (   self,
  phaseName = None 
)

Completes the Phase and closes the CAPS Problem Object.

Parameters
phaseNamePhase Name of the Scratch phase is closed as complete

◆ createTree()

createTree (   self,
  filename = "myProblem",
**  kwargs 
)

Create a HTML dendrogram/tree of the current state of the problem.

See example problem6.py for a representative use case. The HTML file relies on the open-source JavaScript library, D3, to visualize the data. This library is freely available from https://d3js.org/ and is dynamically loaded within the HTML file. If running on a machine without internet access a (miniaturized) copy of the library may be written to a file alongside the generated HTML file by setting the internetAccess keyword to False. If set to True, internet access will be necessary to view the tree.

Parameters
filenameFilename to use when saving the tree (default - "myProblem"). Note an ".html" is automatically appended to the name (same with ".json" if embedJSON = False).
**kwargsSee below.

Valid keywords:

Parameters
embedJSONEmbed the JSON tree data in the HTML file itself (default - True). If set to False a seperate file is generated for the JSON tree data.
internetAccessIs internet access available (default - True)? If set to True internet access will be necessary to view the tree.
analysisGeomShow the geometry for each analysis entity (default - False).
internalGeomAttrShow the internal attributes (denoted by starting with an underscore, for example "_AttrName") that exist on the geometry (default - False).
reverseMapReverse the geometry attribute map (default - False).

◆ intentPhrase()

intentPhrase (   self,
  lines 
)

Set the current intent phrase.

Parameters
linesString or list of strings describing the intent

◆ setOutLevel()

setOutLevel (   self,
  outLevel 
)

Set the verbosity level of the CAPS output.

See problem5.py for a representative use case.

Parameters
outLevelLevel of output verbosity. Options: 0 (or "minimal"), 1 (or "standard") [default], and 2 (or "debug").

The documentation for this class was generated from the following file: