Analysis Manager Functions¶
This group is for functions included in the Analysis Manager. The Analysis Manager allows for OpenVSP analyses to be setup and run through the API without having to modify Parms directly. Examples are available for every available analysis type. The results of running an analysis can be accessed through the functions defined in the Results group.
Get the number of analysis types available in the Analysis Manager |
|
Get the name of every available analysis in the Analysis Manager |
|
|
Get the name of every available input for a particular analysis |
|
Get the analysis documentation string |
|
Get the documentation string for the particular analysis and input |
|
Execute an analysis through the Analysis Manager |
|
Get the documentation string for the particular analysis and input |
|
Get the data type for a particulat analysis type and input |
|
Get the current integer values for the particular analysis, input, and data index |
|
Get the current double values for the particular analysis, input, and data index |
|
Get the current string values for the particular analysis, input, and data index |
|
Get the current vec3d values for the particular analysis, input, and data index |
|
Set all input values to their defaults for a specific analysis |
|
Set the value of a particular analysis input of integer type |
|
Set the value of a particular analysis input of double type |
|
Set the value of a particular analysis input of string type |
|
Set the value of a particular analysis input of vec3d type |
|
Print to stdout all current input values for a specific analysis |
|
Print to stdout all current input documentation for a specific analysis |
Add a new Geometry Analysis case to the Geometry Analysis Manager. |
|
|
Delete a specific Geometry Analysis case from the Geometry Analysis Manager. |
|
Delete one azimuth and elevation pair from a Geometry Analysis case |
|
Delete every azimuth and elevation pair from a Geometry Analysis case |
|
Get the number of azimuth and elevation pairs in a Geometry Analysis case |
Get the Parm ID of the azimuth of one az/el pair, so its value can be read or changed |
|
Get the Parm ID of the elevation of one az/el pair, so its value can be read or changed |
|
Delete one geometry analysis case. |
|
Delete all Geometry Analysis cases from the Geometry Analysis Manager. |
|
Get a vector of all Geometry Analysis case IDs in the Geometry Analysis Manager. |
|
Set the active Geometry Analysis case. |
|
Get the ID of the active Geometry Analysis case. |
|
|
Create a MeshGeom from the results of the specified Geometry Analysis case and return the new Geom's ID. |
Details¶
- openvsp.GetNumAnalysis()[source]¶
Get the number of analysis types available in the Analysis Manager
nanalysis = GetNumAnalysis() print( f"Number of registered analyses: {nanalysis}" ) # The count has to match the list of names. analysis_array = ListAnalysis() assert nanalysis == len( analysis_array ), "GetNumAnalysis disagrees with ListAnalysis" assert nanalysis >= 1, "no analyses registered"
- Return type:
int
- Returns:
int Number of analyses
- openvsp.ListAnalysis()[source]¶
Get the name of every available analysis in the Analysis Manager
analysis_array = ListAnalysis() print( "List of Available Analyses: " ) for i in range(int( len(analysis_array) )): print( " " + analysis_array[i] ) assert len( analysis_array[i] ) > 0, "ListAnalysis returned an unnamed analysis" assert len( analysis_array ) == GetNumAnalysis(), "ListAnalysis disagrees with GetNumAnalysis" # The analyses the rest of these examples lean on have to be there. assert "VSPAEROComputeGeometry" in analysis_array, "VSPAEROComputeGeometry is not registered"
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
vector<string> Array of analysis names
- openvsp.GetAnalysisInputNames(analysis)[source]¶
Get the name of every available input for a particular analysis
analysis_name = "VSPAEROComputeGeometry" in_names = GetAnalysisInputNames( analysis_name ) assert len( in_names ) > 0, "GetAnalysisInputNames returned nothing" print("Analysis Inputs: ") for i in range(int( len(in_names) )): print( ( "\t" + in_names[i] + "\n" ) )
- Parameters:
[in] – analysis string Analysis name
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
vector<string> Array of input names
- openvsp.GetAnalysisDoc(analysis)[source]¶
Get the analysis documentation string
analysis_name = "VSPAEROComputeGeometry" doc = GetAnalysisDoc( analysis_name ) assert len( doc ) > 0, "GetAnalysisDoc returned nothing"
- Parameters:
[in] – analysis string Analysis name
- Return type:
string
- Returns:
string Documentation string
- openvsp.GetAnalysisInputDoc(analysis, name)[source]¶
Get the documentation string for the particular analysis and input
analysis_name = "CompGeom" in_array = GetAnalysisInputNames( analysis_name ) doc = GetAnalysisInputDoc( analysis_name, in_array[0] ) assert len( doc ) > 0, "GetAnalysisInputDoc returned nothing"
- Parameters:
[in] – analysis string Analysis name
[in] – name string Input name
- Return type:
string
- Returns:
string Documentation string
- openvsp.ExecAnalysis(analysis)[source]¶
Execute an analysis through the Analysis Manager
analysis_name = "VSPAEROComputeGeometry" res_id = ExecAnalysis( analysis_name ) assert len( res_id ) > 0, "ExecAnalysis returned no id"
- Parameters:
[in] – analysis string Analysis name
- Return type:
string
- Returns:
string Result ID
- openvsp.GetNumAnalysisInputData(analysis, name)[source]¶
Get the documentation string for the particular analysis and input
analysis_name = "CompGeom" in_array = GetAnalysisInputNames( analysis_name ) assert GetNumAnalysisInputData( analysis_name, in_array[0] ) >= 1, "GetNumAnalysisInputData reported nothing"
- Parameters:
[in] – analysis string Analysis name
[in] – name string Input name
- Return type:
int
- Returns:
int Documentation string
- openvsp.GetAnalysisInputType(analysis, name)[source]¶
Get the data type for a particulat analysis type and input
analysis = "VSPAEROComputeGeometry" inp_array = GetAnalysisInputNames( analysis ) assert len( inp_array ) > 0, "GetAnalysisInputNames returned nothing" for j in range(int( len(inp_array) )): typ = GetAnalysisInputType( analysis, inp_array[j] ) # Every input the analysis lists has to report a real data type. assert typ != INVALID_TYPE, "GetAnalysisInputType returned INVALID_TYPE for " + inp_array[j] # An input that does not exist has to report INVALID_TYPE. assert GetAnalysisInputType( analysis, "NoSuchInput" ) == INVALID_TYPE, "GetAnalysisInputType accepted an unknown input" # That lookup failure was raised deliberately, so take it back off the queue. err_mgr = ErrorMgrSingleton.getInstance() while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: RES_DATA_TYPE :param [in]: analysis string Analysis name :param [in]: name string Input name :rtype: int :return: int Data type enum (i.e. DOUBLE_DATA)
- openvsp.GetIntAnalysisInput(analysis, name, index=0)[source]¶
Get the current integer values for the particular analysis, input, and data index
#==== Analysis: VSPAero Compute Geometry ====// analysis_name = "VSPAEROComputeGeometry" # Set to panel method thick_set = GetIntAnalysisInput( analysis_name, "GeomSet" ) assert len( thick_set ) > 0, "GetIntAnalysisInput returned nothing" thin_set = GetIntAnalysisInput( analysis_name, "ThinGeomSet" ) thick_set = [vsp.SET_NONE] thin_set = [vsp.SET_ALL] SetIntAnalysisInput( analysis_name, "GeomSet", thick_set ) SetIntAnalysisInput( analysis_name, "ThinGeomSet", thin_set )
See also: RES_DATA_TYPE, SetIntAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: index int Data index :rtype: std::vector< int,std::allocator< int > > :return: vector<int> Array of analysis input values
- openvsp.GetDoubleAnalysisInput(analysis, name, index=0)[source]¶
Get the current double values for the particular analysis, input, and data index
vinfFCinput = list( GetDoubleAnalysisInput( "ParasiteDrag", "Vinf" ) ) vinfFCinput[0] = 629 SetDoubleAnalysisInput( "ParasiteDrag", "Vinf", vinfFCinput )
See also: RES_DATA_TYPE, SetDoubleAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: index int Data index :rtype: std::vector< double,std::allocator< double > > :return: vector<double> Array of analysis input values
- openvsp.GetStringAnalysisInput(analysis, name, index=0)[source]¶
Get the current string values for the particular analysis, input, and data index
fileNameInput = GetStringAnalysisInput( "ParasiteDrag", "FileName" ) assert len( fileNameInput ) > 0, "GetStringAnalysisInput returned nothing" fileNameInput = ["ParasiteDragExample"] SetStringAnalysisInput( "ParasiteDrag", "FileName", fileNameInput )
See also: RES_DATA_TYPE, SetStringAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: index int Data index :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of analysis input values
- openvsp.GetVec3dAnalysisInput(analysis, name, index=0)[source]¶
Get the current vec3d values for the particular analysis, input, and data index
# PlanarSlice norm = GetVec3dAnalysisInput( "PlanarSlice", "Norm" ) assert len( norm ) > 0, "GetVec3dAnalysisInput returned nothing" norm[0].set_xyz( 0.23, 0.6, 0.15 ) SetVec3dAnalysisInput( "PlanarSlice", "Norm", norm )
See also: RES_DATA_TYPE, SetVec3dAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: index int Data index :rtype: std::vector< vec3d,std::allocator< vec3d > > :return: vector<vec3d> Array of analysis input values
- openvsp.SetAnalysisInputDefaults(analysis)[source]¶
Set all input values to their defaults for a specific analysis
#==== Analysis: VSPAero Compute Geometry ====// analysis_name = "VSPAEROComputeGeometry" # Change an input away from its default... geom_set = GetIntAnalysisInput( analysis_name, "GeomSet" ) new_set = [ geom_set[0] + 1 ] SetIntAnalysisInput( analysis_name, "GeomSet", new_set ) check_set = GetIntAnalysisInput( analysis_name, "GeomSet" ) assert check_set[0] == new_set[0], "SetIntAnalysisInput did not take" # ...and set defaults, which has to put it back. SetAnalysisInputDefaults( analysis_name ) check_set = GetIntAnalysisInput( analysis_name, "GeomSet" ) assert check_set[0] == geom_set[0], "SetAnalysisInputDefaults did not restore the default"
- param [in]:
analysis string Analysis name
- openvsp.SetIntAnalysisInput(analysis, name, indata, index=0)[source]¶
Set the value of a particular analysis input of integer type
#==== Analysis: VSPAero Compute Geometry ====// analysis_name = "VSPAEROComputeGeometry" # Set to panel method thick_set = GetIntAnalysisInput( analysis_name, "GeomSet" ) thin_set = GetIntAnalysisInput( analysis_name, "ThinGeomSet" ) thick_set = [vsp.SET_NONE] thin_set = [vsp.SET_ALL] SetIntAnalysisInput( analysis_name, "GeomSet", thick_set ) assert list( GetIntAnalysisInput( analysis_name, "GeomSet" ) ) == list( thick_set ), "SetIntAnalysisInput did not take" SetIntAnalysisInput( analysis_name, "ThinGeomSet", thin_set )
See also: GetIntAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: indata vector<int> Array of integer values to set the input to :param [in]: index int Data index
- openvsp.SetDoubleAnalysisInput(analysis, name, indata, index=0)[source]¶
Set the value of a particular analysis input of double type
#==== Analysis: CpSlicer ====// analysis_name = "CpSlicer" # Setup cuts ycuts = [] ycuts.append( 2.0 ) ycuts.append( 4.5 ) ycuts.append( 8.0 ) SetDoubleAnalysisInput( analysis_name, "YSlicePosVec", ycuts, 0 ) assert list( GetDoubleAnalysisInput( analysis_name, "YSlicePosVec", 0 ) ) == list( ycuts ), "SetDoubleAnalysisInput did not take"
See also: GetDoubleAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: indata vector<double> Array of double values to set the input to :param [in]: index int Data index
- openvsp.SetStringAnalysisInput(analysis, name, indata, index=0)[source]¶
Set the value of a particular analysis input of string type
fileNameInput = GetStringAnalysisInput( "ParasiteDrag", "FileName" ) fileNameInput = ["ParasiteDragExample"] SetStringAnalysisInput( "ParasiteDrag", "FileName", fileNameInput ) assert list( GetStringAnalysisInput( "ParasiteDrag", "FileName" ) ) == list( fileNameInput ), "SetStringAnalysisInput did not take"
See also: GetStringAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: indata vector<string> Array of string values to set the input to :param [in]: index int Data index
- openvsp.SetVec3dAnalysisInput(analysis, name, indata, index=0)[source]¶
Set the value of a particular analysis input of vec3d type
# PlanarSlice norm = GetVec3dAnalysisInput( "PlanarSlice", "Norm" ) norm[0].set_xyz( 0.23, 0.6, 0.15 ) SetVec3dAnalysisInput( "PlanarSlice", "Norm", norm ) # The Python binding does not expose vec3d equality, so compare components. norm_back = GetVec3dAnalysisInput( "PlanarSlice", "Norm" ) assert len( norm_back ) == len( norm ), "SetVec3dAnalysisInput length" for i in range( len( norm ) ): assert abs( norm_back[i].x() - norm[i].x() ) < 1e-9, "SetVec3dAnalysisInput x" assert abs( norm_back[i].y() - norm[i].y() ) < 1e-9, "SetVec3dAnalysisInput y" assert abs( norm_back[i].z() - norm[i].z() ) < 1e-9, "SetVec3dAnalysisInput z"
See also: GetVec3dAnalysisInput :param [in]: analysis string Analysis name :param [in]: name string Input name :param [in]: indata vector<vec3d> Array of vec3d values to set the input to :param [in]: index int Data index
- openvsp.PrintAnalysisInputs(analysis_name)[source]¶
Print to stdout all current input values for a specific analysis
#==== Analysis: VSPAero Compute Geometry ====// analysis_name = "VSPAEROComputeGeometry" # list inputs, type, and current values PrintAnalysisInputs( analysis_name ) # There has to be something to list. inp_array = GetAnalysisInputNames( analysis_name ) assert len( inp_array ) > 0, "the analysis reports no inputs to print" # Printing an analysis that does not exist has to be rejected. The error # queue is reached through the error manager singleton in Python. err_mgr = ErrorMgrSingleton.getInstance() PrintAnalysisInputs( "NoSuchAnalysis" ) assert err_mgr.GetNumTotalErrors() > 0, "PrintAnalysisInputs accepted an unknown analysis" # That error was raised deliberately, so take it back off the queue. while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
- Parameters:
[in] – analysis_name string Name of analysis
- openvsp.PrintAnalysisDocs(analysis_name)[source]¶
Print to stdout all current input documentation for a specific analysis
#==== Analysis: VSPAero Compute Geometry ====// analysis_name = "VSPAEROComputeGeometry" # list inputs, type, and documentation PrintAnalysisDocs( analysis_name ) # The analysis itself has to carry documentation to print. assert len( GetAnalysisDoc( analysis_name ) ) > 0, "the analysis carries no documentation" # Printing an analysis that does not exist has to be rejected. The error # queue is reached through the error manager singleton in Python. err_mgr = ErrorMgrSingleton.getInstance() PrintAnalysisDocs( "NoSuchAnalysis" ) assert err_mgr.GetNumTotalErrors() > 0, "PrintAnalysisDocs accepted an unknown analysis" # That error was raised deliberately, so take it back off the queue. while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
- Parameters:
[in] – analysis_name string Name of analysis
- openvsp.AddGeometryAnalysis()[source]¶
Add a new Geometry Analysis case to the Geometry Analysis Manager. The Geometry Analysis Manager allows users to configure and execute geometric analysis tasks typical of the aircraft design process, such as wetted area, projected area, mass properties, clearance, and visibility analyses.
##==== GeometryAnalysis: Add and configure a case ====## ga_id = AddGeometryAnalysis() print( "Added Geometry Analysis: ", ga_id )
See also: DeleteGeometryAnalysis, DeleteAllGeometryAnalyses, GetAllGeometryAnalysesIDVec :rtype: string :return: string ID of the newly created Geometry Analysis case
- openvsp.AddGeometryAnalysisAzEl(geom_analysis_id, azimuth, elevation)[source]¶
Delete a specific Geometry Analysis case from the Geometry Analysis Manager.
##==== GeometryAnalysis: Delete a specific case ====## ga_id = AddGeometryAnalysis() assert len( GetAllGeometryAnalysesIDVec() ) == 1, "AddGeometryAnalysis did not add a case" DeleteGeometryAnalysis( ga_id ) assert len( GetAllGeometryAnalysesIDVec() ) == 0, "DeleteGeometryAnalysis did not remove the case"
See also: AddGeometryAnalysis, DeleteAllGeometryAnalyses, GetAllGeometryAnalysesIDVec :param [in]: id string ID of the Geometry Analysis case to delete
Add a discrete azimuth and elevation pair to a Geometry Analysis case. A visibility analysis with the discrete visibility flag set is evaluated at each pair that has been added.
ga_id = AddGeometryAnalysis() assert GetNumGeometryAnalysisAzEl( ga_id ) == 0, "a new Geometry Analysis already carries az/el pairs" AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 ) assert GetNumGeometryAnalysisAzEl( ga_id ) == 1, "AddGeometryAnalysisAzEl did not add a pair" # Each pair is a pair of Parms, so the values can be read and changed. az_id = GetGeometryAnalysisAzimuthParm( ga_id, 0 ) el_id = GetGeometryAnalysisElevationParm( ga_id, 0 ) assert abs( GetParmVal( az_id ) - 30.0 ) < 1e-6, "the az/el pair does not hold the values it was given" assert abs( GetParmVal( el_id ) - 15.0 ) < 1e-6, "the az/el pair does not hold the values it was given" # An ID that is not a Geometry Analysis has to be rejected. err_mgr = ErrorMgrSingleton.getInstance() AddGeometryAnalysisAzEl( "NOSUCHANALYSIS", 0.0, 0.0 ) assert err_mgr.GetNumTotalErrors() > 0, "AddGeometryAnalysisAzEl accepted a bad ID" while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: AddGeometryAnalysis, DeleteGeometryAnalysisAzEl, GetNumGeometryAnalysisAzEl :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: azimuth double Azimuth angle (degrees, -180 to 180) :param [in]: elevation double Elevation angle (degrees, -90 to 90)
- openvsp.DeleteGeometryAnalysisAzEl(geom_analysis_id, index)[source]¶
Delete one azimuth and elevation pair from a Geometry Analysis case
ga_id = AddGeometryAnalysis() AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 ) AddGeometryAnalysisAzEl( ga_id, 60.0, 45.0 ) DeleteGeometryAnalysisAzEl( ga_id, 0 ) # Only the indexed pair goes, and the rest slide down. assert GetNumGeometryAnalysisAzEl( ga_id ) == 1, "DeleteGeometryAnalysisAzEl did not remove one pair" assert abs( GetParmVal( GetGeometryAnalysisAzimuthParm( ga_id, 0 ) ) - 60.0 ) < 1e-6, "DeleteGeometryAnalysisAzEl removed the wrong pair" # An index past the end has to be rejected. err_mgr = ErrorMgrSingleton.getInstance() DeleteGeometryAnalysisAzEl( ga_id, GetNumGeometryAnalysisAzEl( ga_id ) ) assert err_mgr.GetNumTotalErrors() > 0, "DeleteGeometryAnalysisAzEl accepted an index past the end" while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: AddGeometryAnalysisAzEl, DeleteAllGeometryAnalysisAzEl :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: index int Az/El pair index
- openvsp.DeleteAllGeometryAnalysisAzEl(geom_analysis_id)[source]¶
Delete every azimuth and elevation pair from a Geometry Analysis case
ga_id = AddGeometryAnalysis() AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 ) AddGeometryAnalysisAzEl( ga_id, 60.0, 45.0 ) DeleteAllGeometryAnalysisAzEl( ga_id ) assert GetNumGeometryAnalysisAzEl( ga_id ) == 0, "DeleteAllGeometryAnalysisAzEl left pairs behind" # Clearing an empty case is not an error. err_mgr = ErrorMgrSingleton.getInstance() DeleteAllGeometryAnalysisAzEl( ga_id ) assert err_mgr.GetNumTotalErrors() == 0, "DeleteAllGeometryAnalysisAzEl complained about an empty case"
See also: AddGeometryAnalysisAzEl, DeleteGeometryAnalysisAzEl :param [in]: geom_analysis_id string Geometry Analysis case ID
- openvsp.GetNumGeometryAnalysisAzEl(geom_analysis_id)[source]¶
Get the number of azimuth and elevation pairs in a Geometry Analysis case
id = AddGeometryAnalysis() AddGeometryAnalysisAzEl( id, 10.0, 20.0 ) assert GetNumGeometryAnalysisAzEl( id ) == 1, "GetNumGeometryAnalysisAzEl did not count the pair"
See also: AddGeometryAnalysisAzEl :param [in]: geom_analysis_id string Geometry Analysis case ID :rtype: int :return: int Number of az/el pairs
- openvsp.GetGeometryAnalysisAzimuthParm(geom_analysis_id, index)[source]¶
Get the Parm ID of the azimuth of one az/el pair, so its value can be read or changed
id = AddGeometryAnalysis() AddGeometryAnalysisAzEl( id, 10.0, 20.0 ) azparm = GetGeometryAnalysisAzimuthParm( id, 0 ) assert abs( GetParmVal( azparm ) - 10.0 ) < 1e-6, "GetGeometryAnalysisAzimuthParm did not report the azimuth"
See also: AddGeometryAnalysisAzEl, GetGeometryAnalysisElevationParm :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: index int Az/El pair index :rtype: string :return: string Azimuth Parm ID
- openvsp.GetGeometryAnalysisElevationParm(geom_analysis_id, index)[source]¶
Get the Parm ID of the elevation of one az/el pair, so its value can be read or changed
id = AddGeometryAnalysis() AddGeometryAnalysisAzEl( id, 10.0, 20.0 ) elparm = GetGeometryAnalysisElevationParm( id, 0 ) assert abs( GetParmVal( elparm ) - 20.0 ) < 1e-6, "GetGeometryAnalysisElevationParm did not report the elevation"
See also: AddGeometryAnalysisAzEl, GetGeometryAnalysisAzimuthParm :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: index int Az/El pair index :rtype: string :return: string Elevation Parm ID
- openvsp.DeleteGeometryAnalysis(id)[source]¶
Delete one geometry analysis case.
id = AddGeometryAnalysis() SetActiveGeometryAnalysis( id ) assert GetActiveGeometryAnalysis() == id, "SetActiveGeometryAnalysis did not take" DeleteGeometryAnalysis( id ) # The case that was active is gone, so nothing is active. assert GetActiveGeometryAnalysis() != id, "DeleteGeometryAnalysis did not delete the case"
See also: AddGeometryAnalysis :param [in]: id string Geometry analysis case ID
- openvsp.DeleteAllGeometryAnalyses()[source]¶
Delete all Geometry Analysis cases from the Geometry Analysis Manager.
##==== GeometryAnalysis: Delete all cases ====## ga_id_1 = AddGeometryAnalysis() ga_id_2 = AddGeometryAnalysis() assert ga_id_1 != ga_id_2, "AddGeometryAnalysis reused an ID" assert len( GetAllGeometryAnalysesIDVec() ) == 2, "the two cases were not both added" DeleteAllGeometryAnalyses() ga_ids = GetAllGeometryAnalysesIDVec() print( "Number of Geometry Analyses after delete: ", len( ga_ids ) ) assert len( ga_ids ) == 0, "DeleteAllGeometryAnalyses left cases behind"
See also: AddGeometryAnalysis, DeleteGeometryAnalysis, GetAllGeometryAnalysesIDVec
- openvsp.GetAllGeometryAnalysesIDVec()[source]¶
Get a vector of all Geometry Analysis case IDs in the Geometry Analysis Manager.
##==== GeometryAnalysis: List all cases ====## ga_id_1 = AddGeometryAnalysis() ga_id_2 = AddGeometryAnalysis() ga_ids = GetAllGeometryAnalysesIDVec() assert len( ga_ids ) > 0, "GetAllGeometryAnalysesIDVec returned nothing" for ga_id in ga_ids: print( "Geometry Analysis ID: ", ga_id )
See also: AddGeometryAnalysis, DeleteGeometryAnalysis, DeleteAllGeometryAnalyses :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of all Geometry Analysis case IDs
- openvsp.SetActiveGeometryAnalysis(id)[source]¶
Set the active Geometry Analysis case. The active case is the one drawn in the Geometry Analysis GUI (and captured by ScreenGrab). Setting it does not require the GUI to be present.
ga_id = AddGeometryAnalysis() SetActiveGeometryAnalysis( ga_id ) assert GetActiveGeometryAnalysis() == ga_id, "SetActiveGeometryAnalysis did not take"
See also: GetActiveGeometryAnalysis, AddGeometryAnalysis :param [in]: id string Geometry Analysis case ID (empty string for none)
- openvsp.GetActiveGeometryAnalysis()[source]¶
Get the ID of the active Geometry Analysis case.
ga_id = AddGeometryAnalysis() SetActiveGeometryAnalysis( ga_id ) active = GetActiveGeometryAnalysis() assert len( active ) > 0, "GetActiveGeometryAnalysis returned nothing"
See also: SetActiveGeometryAnalysis :rtype: string :return: string Active Geometry Analysis case ID (empty string if none)
- openvsp.MakeMeshGeom(ga_id)[source]¶
Create a MeshGeom from the results of the specified Geometry Analysis case and return the new Geom’s ID. The case must have been evaluated first (run the “GeometryAnalysis” analysis for the case) so that its result meshes exist. The resulting MeshGeom is added to the model and made the active Geom.
#==== Add a Geom for the case to work on ====// pod_id = AddGeom( "POD" ) Update() ga_id = AddGeometryAnalysis() #==== Configure the case. Without a primary target the analysis has #==== nothing to mesh and reports an empty primary mesh. SetParmVal( FindParm( ga_id, "PrimaryType", "InterferenceCase" ), SET_TARGET ) SetParmVal( FindParm( ga_id, "PrimarySet", "InterferenceCase" ), SET_ALL ) SetParmVal( FindParm( ga_id, "SecondaryType", "InterferenceCase" ), SET_TARGET ) SetParmVal( FindParm( ga_id, "SecondarySet", "InterferenceCase" ), SET_ALL ) Update() # Evaluate the case through the Analysis framework so that its result meshes exist. SetAnalysisInputDefaults( "GeometryAnalysis" ) SetStringAnalysisInput( "GeometryAnalysis", "CaseID", [ga_id] ) ExecAnalysis( "GeometryAnalysis" ) # Turn the case's result meshes into a MeshGeom. mesh_id = MakeMeshGeom( ga_id ) assert len( mesh_id ) > 0, "MakeMeshGeom returned no id"
See also: AddGeometryAnalysis, SetActiveGeometryAnalysis :param [in]: ga_id string Geometry Analysis case ID :rtype: string :return: string Geom ID of the newly created MeshGeom