pyCAPS
pyCAPS: A Python Extension Module for CAPS
problem4.py

Example use cases for the pyCAPS.capsProblem.loadAIM() function - compare analyis dictionary entry with returned analyis object

1 # Use: Load a analysis module (AIM) into the problem - compare analyis dictionary with returned analyis object
2 
3 # Import pyCAPS module (Linux and OSx = pyCAPS.so file; Windows = pyCAPS.pyd file)
4 import pyCAPS
5 
6 # Instantiate our CAPS problem "myProblem"
7 print("Initiating capsProblem")
8 myProblem = pyCAPS.capsProblem()
9 
10 # Load a *.csm file "./csmData/cfdMultiBody.csm" into our newly created problem. The
11 # project name "basicTest" may be optionally set here; if no argument is provided
12 # the CAPS file provided is used as the project name.
13 print("Loading file into our capsProblem")
14 myGeometry = myProblem.loadCAPS("./csmData/cfdMultiBody.csm", "basicTest")
15 
16 # Load FUN3D aim
17 
18 fun3d = myProblem.loadAIM(aim = "fun3dAIM",
19  altName = "fun3d",
20  analysisDir = "FUN3DAnalysisTest",
21  capsIntent = "CFD")
22 
23 print(fun3d.analysisDir)
24 
25 
26 print(fun3d)
27 print(myProblem.analysis["fun3d"])
28 
29 # Close our problems
30 print("Closing our problem")
31 myProblem.closeCAPS()
32