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

Example use cases for the pyCAPS._capsAnalysis.createTree() function.

1 from __future__ import print_function
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 fun3d = myProblem.loadAIM(aim = "fun3dAIM",
18  altName = "fun3d",
19  analysisDir = "FUN3DAnalysisTest",
20  capsIntent = "CFD")
21 
22 inviscid = {"bcType" : "Inviscid", "wallTemperature" : 1.1}
23 fun3d.setAnalysisVal("Boundary_Condition", [("Skin", inviscid),
24  ("SymmPlane", "SymmetryY"),
25  ("Farfield","farfield")])
26 
27 # Create tree
28 fun3d.createTree(internetAccess = False, embedJSON = True, analysisGeom = True, reverseMap = True)
29 
30 
31 # Close our problems
32 print("Closing our problem")
33 myProblem.closeCAPS()
34