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

Example use case for the pyCAPS.capsProblem.loadCAPS() function - compare "geometry" attribute with returned geometry object.

1 # Use: Load geometry into the problem - compare geometry with returned geometry 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 
15 
16 myGeometry = myProblem.loadCAPS("./csmData/cfdMultiBody.csm", "basicTest")
17 
18 
19 print(myGeometry)
20 print(myProblem.geometry)
21 
22 # Close our problems
23 print("Closing our problem")
24 myProblem.closeCAPS()
25