|
pyCAPS
pyCAPS: A Python Extension Module for CAPS
|
Defines a CAPS Analysis Object. More...
Inherits object.
Inherited by capsAnalysis.
Public Member Functions | |
| preAnalysis (self) | |
| Run the pre-analysis function for the AIM. | |
| runAnalysis (self) | |
| Run the pre/exec/post functions for the AIM (if AIM execution is available). | |
| system (self, cmd, rpath=None) | |
| Execute the Command Line String Notes: | |
| postAnalysis (self) | |
| Run post-analysis function for the AIM. | |
| analysisDir (self) | |
| Property returns the path to the analysis directory. | |
| name (self) | |
| Property returns the name of the CAPS Analysis Object. | |
| history (self) | |
| Returns the history list of the CAPS Analysis Object. | |
| markForDelete (self) | |
| Mark a CAPS Analysis Object for deletion on the next Phase. | |
| dirty (self) | |
| Returns linked analyses that are dirty. | |
| info (self, printInfo=False, **kwargs) | |
| Gets analysis information for the analysis object. | |
| createTree (self, filename="name", **kwargs) | |
| Create a HTML dendrogram/tree of the current state of the analysis. | |
| createOpenMDAOComponent (self, inputVariable, outputVariable, **kwargs) | |
| Create an OpenMDAO Component[1.7.3]/ExplicitComponent[2.8+] object; an external code component (ExternalCode[1.7.2]/ExternalCodeComp[2.8+]) is created if the executeCommand keyword arguement is provided. | |
Defines a CAPS Analysis Object.
Created via Problem.analysis.create().
| Analysis.geometry | AnalysisGeometry instances representing the bodies associated with the analysis |
| Analysis.input | ValueInSequence of ValueIn inputs |
| Analysis.output | ValueOutSequence of ValueOut outputs |
| Analysis.attr | AttrSequence of ValueIn attributes |
| createOpenMDAOComponent | ( | self, | |
| inputVariable, | |||
| outputVariable, | |||
| ** | kwargs | ||
| ) |
Create an OpenMDAO Component[1.7.3]/ExplicitComponent[2.8+] object; an external code component (ExternalCode[1.7.2]/ExternalCodeComp[2.8+]) is created if the executeCommand keyword arguement is provided.
This functionality should work with either verison 1.7.3 or >=2.8 of OpenMDAO.
| inputVariable | Input variable(s)/parameter(s) to add to the OpenMDAO component. Variables may be either analysis input variables or geometry design parameters. Note, that the setting of analysis inputs supersedes the setting of geometry design parameters; issues may arise if analysis input and geometry design variables have the same name. If the analysis parameter wanting to be added to the OpenMDAO component is part of a capsTuple the following notation should be used: "AnalysisInput:TupleKey:DictionaryKey", for example "AVL_Control:ControlSurfaceA:deflectionAngle" would correspond to the AVL_Control input variable, the ControlSurfaceA element of the input values (that is the name of the control surface being created) and finally deflectionAngle corresponds to the name of the dictionary entry that is to be used as the component parameter. If the tuple's value isn't a dictionary just "AnalysisInput:TupleKey" is needed. |
| outputVariable | Output variable(s)/parameter(s) to add to the OpenMDAO component. Only scalar output variables are currently supported |
| **kwargs | See below. |
Valid keywords:
| changeDir | Automatically switch into the analysis directory set for the AIM when executing an external code (default - True). |
| saveIteration | If the generated OpenMDAO component is going to be called multiple times, the inputs and outputs from the analysis and the AIM will be automatically bookkept ( = True) by moving the files to a folder within the AIM's analysis directory ( analysisDir ) named "Iteration_#" were # represents the iteration number (default - False). By default ( = False) input and output files will be continously overwritten. Notes:
|
| executeCommand | Command to be executed when running an external code. Command must be a list of command line arguements (see OpenMDAO documentation). If provided an ExternalCode[1.7.2]/ExternalCodeComp[2.8+] object is created; if not provided or set to None a Component[1.7.3]/ExplicitComponent[2.8+] object is created (default - None). |
| inputFile | Optional list of input file names for OpenMDAO to check the existence of before OpenMDAO excutes the "solve_nonlinear"[1.7.3]/"compute"[2.8+] (default - None). This is redundant as the AIM automatically does this already. |
| outputFile | Optional list of output names for OpenMDAO to check the existence of before OpenMDAO excutes the "solve_nonlinear"[1.7.3]/"compute"[2.8+] (default - None). This is redundant as the AIM automatically does this already. |
| stdin | Set I/O connection for the standard input of an ExternalCode[1.7.2]/ExternalCodeComp[2.8+] component. The use of this depends on the expected AIM execution. |
| stdout | Set I/O connection for the standard ouput of an ExternalCode[1.7.2]/ExternalCodeComp[2.8+] component. The use of this depends on the expected AIM execution. |
| setSensitivity | Optional dictionary containing sensitivity/derivative settings/parameters. Currently only Finite difference is is supported!. See OpenMDAO documentation for addtional details of "deriv_options"(version 1.7) or "declare_partials"(version 2.8). Common values for a finite difference calculation would be setSensitivity['type'] = "fd" (Note in the version 2.8 documentation this varibale has been changed to "method" both variations will work when using version 2.8+), setSensitivity['form'] = "forward" or "backward" or "central", and setSensitivity['step_size'] = 1.0E-6 (Note in the version 2.8 documentation this varibale has been changed to "step" both variations will work when using version 2.8+). |
| createTree | ( | self, | |
filename = "name", |
|||
| ** | kwargs | ||
| ) |
Create a HTML dendrogram/tree of the current state of the analysis.
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.
| filename | Filename to use when saving the tree (default - "aimName"). Note an ".html" is automatically appended to the name (same with ".json" if embedJSON = False). |
| **kwargs | See below. |
Valid keywords:
| embedJSON | Embed 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. |
| internetAccess | Is internet access available (default - True)? If set to True internet access will be necessary to view the tree. |
| analysisGeom | Show the geometry currently load into the analysis in the tree (default - False). |
| internalGeomAttr | Show the internal attributes (denoted by starting with an underscore, for example "_AttrName") that exist on the geometry (default - False). Note: "analysisGeom" must also be set to True. |
| reverseMap | Reverse the attribute map (default - False). See attrMap for details. |
| dirty | ( | self | ) |
Returns linked analyses that are dirty.
| info | ( | self, | |
printInfo = False, |
|||
| ** | kwargs | ||
| ) |
Gets analysis information for the analysis object.
| printInfo | Print information to sceen (default - False). |
| **kwargs | See below. |
Valid keywords:
| infoDict | Return a dictionary containing analysis information instead of just the cleanliness state (default - False). |
| system | ( | self, | |
| cmd, | |||
rpath = None |
|||
| ) |
Execute the Command Line String Notes:
| cmd | the command line string to execute |
| rpath | the relative path from the Analysis' directory or None (in the Analysis path) |