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

Duplicate an AIM using the $copyAIM keyword argument of the pyCAPS.capsProblem.loadAIM() function.

1 # Use: Duplicate an AIM
2 
3 from __future__ import print_function
4 
5 # Import pyCAPS module (Linux and OSx = pyCAPS.so file; Windows = pyCAPS.pyd file)
6 import pyCAPS
7 
8 # Instantiate our CAPS problem "myProblem"
9 print("Initiating capsProblem")
10 myProblem = pyCAPS.capsProblem()
11 
12 # Load a *.csm file "./csmData/cfdMultiBody.csm" into our newly created problem. The
13 # project name "basicTest" may be optionally set here; if no argument is provided
14 # the CAPS file provided is used as the project name.
15 print("Loading file into our capsProblem")
16 myGeometry = myProblem.loadCAPS("./csmData/cfdMultiBody.csm", "basicTest")
17 
18 # Load FUN3D aim
19 fun3d = myProblem.loadAIM(aim = "fun3dAIM",
20  altName = "fun3d",
21  analysisDir = "FUN3DAnalysisTest",
22  capsIntent = "CFD")
23 
24 # Print out memory
25 print(fun3d)
26 
27 print("Duplicate")
28 # Duplicate the fun3d aim using the caps_dupAnalysis function
29 fun3d2 = myProblem.loadAIM(altName = "fun3d2",
30  analysisDir = "FUN3DAnalysisTest2",
31  copyAIM = "fun3d")
32 # Print out memory
33 print(fun3d2)
34 
35 # Close our problems
36 print("Closing our problem")
37 myProblem.closeCAPS()
38