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.

SetAeroStructTargetID(id)

Set the FEA Structure or FEA Assembly the aero-structural analysis loads.

GetAeroStructTargetID()

Get the FEA Structure or FEA Assembly the aero-structural analysis loads.

GetNumAnalysis()

Get the number of analysis types available in the Analysis Manager

ListAnalysis()

Get the name of every available analysis in the Analysis Manager

GetAnalysisInputNames(analysis)

Get the name of every available input for a particular analysis

GetAnalysisDoc(analysis)

Get the analysis documentation string

GetAnalysisInputDoc(analysis, name)

Get the documentation string for the particular analysis and input

ExecAnalysis(analysis)

Execute an analysis through the Analysis Manager

GetNumAnalysisInputData(analysis, name)

Get the documentation string for the particular analysis and input

GetAnalysisInputType(analysis, name)

Get the data type for a particulat analysis type and input

GetIntAnalysisInput(analysis, name[, index])

Get the current integer values for the particular analysis, input, and data index

GetDoubleAnalysisInput(analysis, name[, index])

Get the current double values for the particular analysis, input, and data index

GetStringAnalysisInput(analysis, name[, index])

Get the current string values for the particular analysis, input, and data index

GetVec3dAnalysisInput(analysis, name[, index])

Get the current vec3d values for the particular analysis, input, and data index

SetAnalysisInputDefaults(analysis)

Set all input values to their defaults for a specific analysis

SetIntAnalysisInput(analysis, name, indata)

Set the value of a particular analysis input of integer type

SetDoubleAnalysisInput(analysis, name, indata)

Set the value of a particular analysis input of double type

SetStringAnalysisInput(analysis, name, indata)

Set the value of a particular analysis input of string type

SetVec3dAnalysisInput(analysis, name, indata)

Set the value of a particular analysis input of vec3d type

PrintAnalysisInputs(analysis_name)

Print to stdout all current input values for a specific analysis

PrintAnalysisDocs(analysis_name)

Print to stdout all current input documentation for a specific analysis

AddGeometryAnalysis()

Add a new Geometry Analysis case to the Geometry Analysis Manager.

AddGeometryAnalysisAzEl(geom_analysis_id, ...)

Delete a specific Geometry Analysis case from the Geometry Analysis Manager.

DeleteGeometryAnalysisAzEl(geom_analysis_id, ...)

Delete one azimuth and elevation pair from a Geometry Analysis case

DeleteGeometryAnalysisAzElByID(...)

Delete an azimuth/elevation pair from a Geometry Analysis, by the ID of its azimuth Parm.

DeleteAllGeometryAnalysisAzEl(geom_analysis_id)

Delete every azimuth and elevation pair from a Geometry Analysis case

GetNumGeometryAnalysisAzEl(geom_analysis_id)

Get the number of azimuth and elevation pairs in a Geometry Analysis case

GetGeometryAnalysisAzimuthParm(...)

Get the Parm ID of the azimuth of one az/el pair, so its value can be read or changed

GetGeometryAnalysisElevationParm(...)

Get the Parm ID of the elevation of one az/el pair, so its value can be read or changed

GetGeometryAnalysisAzimuthParmVec(...)

Get the IDs of the azimuth Parms of a Geometry Analysis, in the order of their indexes.

GetGeometryAnalysisElevationParmVec(...)

Get the IDs of the elevation Parms of a Geometry Analysis, in the order of GetGeometryAnalysisAzimuthParmVec.

SetGeometryAnalysisPrimaryModeID(...)

Set the mode a Geometry Analysis uses for its primary target when that target is a mode, or an empty string for none.

GetGeometryAnalysisPrimaryModeID(...)

Get the mode a Geometry Analysis uses for its primary target when that target is a mode.

SetGeometryAnalysisPrimaryGeomID(...)

Set the Geom a Geometry Analysis uses for its primary target when that is a Geom, or an empty string for none.

GetGeometryAnalysisPrimaryGeomID(...)

Get the Geom a Geometry Analysis uses for its primary target when that is a Geom.

SetGeometryAnalysisSecondaryGeomID(...)

Set the Geom a Geometry Analysis uses for its secondary target when that is a Geom, or an empty string for none.

GetGeometryAnalysisSecondaryGeomID(...)

Get the Geom a Geometry Analysis uses for its secondary target when that is a Geom.

SetGeometryAnalysisDirectionGeomID(...)

Set the Geom a Geometry Analysis uses for its direction when that is a Geom, or an empty string for none.

GetGeometryAnalysisDirectionGeomID(...)

Get the Geom a Geometry Analysis uses for its direction when that is a Geom.

AddGeometryAnalysisCutout(geom_analysis_id, ...)

Add a subsurface to the cutouts of a Geometry Analysis.

DeleteGeometryAnalysisCutout(...)

Remove a subsurface from the cutouts of a Geometry Analysis.

GetGeometryAnalysisCutoutVec(geom_analysis_id)

Get the subsurface IDs of the cutouts of a Geometry Analysis.

DeleteGeometryAnalysis(id)

Delete one geometry analysis case.

DeleteAllGeometryAnalyses()

Delete all Geometry Analysis cases from the Geometry Analysis Manager.

GetAllGeometryAnalysesIDVec()

Get a vector of all Geometry Analysis case IDs in the Geometry Analysis Manager.

SetActiveGeometryAnalysis(id)

Set the active Geometry Analysis case.

GetActiveGeometryAnalysis()

Get the ID of the active Geometry Analysis case.

MakeMeshGeom(ga_id)

Create a MeshGeom from the results of the specified Geometry Analysis case and return the new Geom's ID.

SetWaveDragRefWingID(geom_id)

Set the Wave Drag reference wing, kept with the model, and use it for the reference quantities, as SetVSPAERORefWingID does.

GetWaveDragRefWingID()

Get the Wave Drag reference wing the analysis uses, kept with the model.

SetWaveDragModeID(mode_id)

Set the Wave Drag mode the analysis uses when its use-mode flag is on, kept with the model.

GetWaveDragModeID()

Get the Wave Drag mode the analysis uses, kept with the model.

AddWaveDragFlowSubSurf(ss_id)

Add a subsurface to the faces the Wave Drag analysis treats as flow through.

DeleteWaveDragFlowSubSurf(ss_id)

Remove a subsurface from the faces the Wave Drag analysis treats as flow through.

GetWaveDragFlowSubSurfVec()

Get the IDs of the subsurfaces the Wave Drag analysis treats as flow through, kept with the model.

Details

openvsp.SetAeroStructTargetID(id)[source]

Set the FEA Structure or FEA Assembly the aero-structural analysis loads. The model keeps it as a position in the list of Structures and Assemblies, so deleting an earlier one moves it to the next.

pod_id = AddGeom( "POD" )

AddFeaStruct( pod_id )
struct_id = AddFeaStructure( pod_id )

SetAeroStructTargetID( struct_id )

assert GetAeroStructTargetID() == struct_id, "SetAeroStructTargetID did not set the target"

See also: GetAeroStructTargetID :param [in]: id string FEA Structure or FEA Assembly ID

openvsp.GetAeroStructTargetID()[source]

Get the FEA Structure or FEA Assembly the aero-structural analysis loads.

pod_id = AddGeom( "POD" )

AddFeaStruct( pod_id )
struct_id = AddFeaStructure( pod_id )

SetAeroStructTargetID( struct_id )

assert GetAeroStructTargetID() == struct_id, "GetAeroStructTargetID did not return the target set"

See also: SetAeroStructTargetID :rtype: string :return: string FEA Structure or FEA Assembly ID, or an empty string for none

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"

az_id = AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 )

assert az_id == GetGeometryAnalysisAzimuthParm( ga_id, 0 ), "AddGeometryAnalysisAzEl did not return the new pair's azimuth Parm"

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) :rtype: string :return: string ID of the azimuth Parm of the new pair

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, DeleteGeometryAnalysisAzElByID :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: index int Az/El pair index

openvsp.DeleteGeometryAnalysisAzElByID(geom_analysis_id, azimuth_parm_id)[source]

Delete an azimuth/elevation pair from a Geometry Analysis, by the ID of its azimuth Parm.

ga_id = AddGeometryAnalysis()

az_id = AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 )

AddGeometryAnalysisAzEl( ga_id, 60.0, 5.0 )

DeleteGeometryAnalysisAzElByID( ga_id, az_id )

assert GetNumGeometryAnalysisAzEl( ga_id ) == 1 and abs( GetParmVal( GetGeometryAnalysisAzimuthParm( ga_id, 0 ) ) - 60.0 ) < 1e-6, "DeleteGeometryAnalysisAzElByID deleted the wrong pair"

See also: AddGeometryAnalysisAzEl, GetGeometryAnalysisAzimuthParmVec, DeleteGeometryAnalysisAzEl :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: azimuth_parm_id string ID of the azimuth Parm of the pair

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.GetGeometryAnalysisAzimuthParmVec(geom_analysis_id)[source]

Get the IDs of the azimuth Parms of a Geometry Analysis, in the order of their indexes.

ga_id = AddGeometryAnalysis()

az_id = AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 )

assert list( GetGeometryAnalysisAzimuthParmVec( ga_id ) ) == [ az_id ], "GetGeometryAnalysisAzimuthParmVec did not return the Parm"

See also: GetGeometryAnalysisElevationParmVec :param [in]: geom_analysis_id string Geometry Analysis case ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of azimuth Parm IDs

openvsp.GetGeometryAnalysisElevationParmVec(geom_analysis_id)[source]

Get the IDs of the elevation Parms of a Geometry Analysis, in the order of GetGeometryAnalysisAzimuthParmVec.

ga_id = AddGeometryAnalysis()

AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 )

assert list( GetGeometryAnalysisElevationParmVec( ga_id ) ) == [ GetGeometryAnalysisElevationParm( ga_id, 0 ) ], "GetGeometryAnalysisElevationParmVec did not return the Parm"

See also: GetGeometryAnalysisAzimuthParmVec :param [in]: geom_analysis_id string Geometry Analysis case ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of elevation Parm IDs

openvsp.SetGeometryAnalysisPrimaryModeID(geom_analysis_id, mode_id)[source]

Set the mode a Geometry Analysis uses for its primary target when that target is a mode, or an empty string for none.

ga_id = AddGeometryAnalysis()

AddGeom( "POD" )

mid = CreateAndAddMode( "Clean", SET_ALL, SET_NONE )

SetGeometryAnalysisPrimaryModeID( ga_id, mid )

assert GetGeometryAnalysisPrimaryModeID( ga_id ) == mid, "SetGeometryAnalysisPrimaryModeID did not set the mode"

See also: GetGeometryAnalysisPrimaryModeID :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: mode_id string Mode ID, or an empty string

openvsp.GetGeometryAnalysisPrimaryModeID(geom_analysis_id)[source]

Get the mode a Geometry Analysis uses for its primary target when that target is a mode.

ga_id = AddGeometryAnalysis()

assert GetGeometryAnalysisPrimaryModeID( ga_id ) == "", "a new Geometry Analysis names a mode"

See also: SetGeometryAnalysisPrimaryModeID :param [in]: geom_analysis_id string Geometry Analysis case ID :rtype: string :return: string Mode ID, or an empty string for none

openvsp.SetGeometryAnalysisPrimaryGeomID(geom_analysis_id, geom_id)[source]

Set the Geom a Geometry Analysis uses for its primary target when that is a Geom, or an empty string for none.

ga_id = AddGeometryAnalysis()

pod_id = AddGeom( "POD" )

SetGeometryAnalysisPrimaryGeomID( ga_id, pod_id )

assert GetGeometryAnalysisPrimaryGeomID( ga_id ) == pod_id, "SetGeometryAnalysisPrimaryGeomID did not set the Geom"

See also: GetGeometryAnalysisPrimaryGeomID :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: geom_id string Geom ID, or an empty string

openvsp.GetGeometryAnalysisPrimaryGeomID(geom_analysis_id)[source]

Get the Geom a Geometry Analysis uses for its primary target when that is a Geom.

ga_id = AddGeometryAnalysis()

pod_id = AddGeom( "POD" )

SetGeometryAnalysisPrimaryGeomID( ga_id, pod_id )

assert GetGeometryAnalysisPrimaryGeomID( ga_id ) == pod_id, "GetGeometryAnalysisPrimaryGeomID did not return the Geom set"

See also: SetGeometryAnalysisPrimaryGeomID :param [in]: geom_analysis_id string Geometry Analysis case ID :rtype: string :return: string Geom ID, or an empty string for none

openvsp.SetGeometryAnalysisSecondaryGeomID(geom_analysis_id, geom_id)[source]

Set the Geom a Geometry Analysis uses for its secondary target when that is a Geom, or an empty string for none.

ga_id = AddGeometryAnalysis()

pod_id = AddGeom( "POD" )

SetGeometryAnalysisSecondaryGeomID( ga_id, pod_id )

assert GetGeometryAnalysisSecondaryGeomID( ga_id ) == pod_id, "SetGeometryAnalysisSecondaryGeomID did not set the Geom"

See also: GetGeometryAnalysisSecondaryGeomID :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: geom_id string Geom ID, or an empty string

openvsp.GetGeometryAnalysisSecondaryGeomID(geom_analysis_id)[source]

Get the Geom a Geometry Analysis uses for its secondary target when that is a Geom.

ga_id = AddGeometryAnalysis()

pod_id = AddGeom( "POD" )

SetGeometryAnalysisSecondaryGeomID( ga_id, pod_id )

assert GetGeometryAnalysisSecondaryGeomID( ga_id ) == pod_id, "GetGeometryAnalysisSecondaryGeomID did not return the Geom set"

See also: SetGeometryAnalysisSecondaryGeomID :param [in]: geom_analysis_id string Geometry Analysis case ID :rtype: string :return: string Geom ID, or an empty string for none

openvsp.SetGeometryAnalysisDirectionGeomID(geom_analysis_id, geom_id)[source]

Set the Geom a Geometry Analysis uses for its direction when that is a Geom, or an empty string for none.

ga_id = AddGeometryAnalysis()

pod_id = AddGeom( "POD" )

SetGeometryAnalysisDirectionGeomID( ga_id, pod_id )

assert GetGeometryAnalysisDirectionGeomID( ga_id ) == pod_id, "SetGeometryAnalysisDirectionGeomID did not set the Geom"

See also: GetGeometryAnalysisDirectionGeomID :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: geom_id string Geom ID, or an empty string

openvsp.GetGeometryAnalysisDirectionGeomID(geom_analysis_id)[source]

Get the Geom a Geometry Analysis uses for its direction when that is a Geom.

ga_id = AddGeometryAnalysis()

pod_id = AddGeom( "POD" )

SetGeometryAnalysisDirectionGeomID( ga_id, pod_id )

assert GetGeometryAnalysisDirectionGeomID( ga_id ) == pod_id, "GetGeometryAnalysisDirectionGeomID did not return the Geom set"

See also: SetGeometryAnalysisDirectionGeomID :param [in]: geom_analysis_id string Geometry Analysis case ID :rtype: string :return: string Geom ID, or an empty string for none

openvsp.AddGeometryAnalysisCutout(geom_analysis_id, ss_id)[source]

Add a subsurface to the cutouts of a Geometry Analysis.

ga_id = AddGeometryAnalysis()

wid = AddGeom( "WING" )

ss_id = AddSubSurf( wid, SS_RECTANGLE )

AddGeometryAnalysisCutout( ga_id, ss_id )

assert list( GetGeometryAnalysisCutoutVec( ga_id ) ) == [ ss_id ], "AddGeometryAnalysisCutout did not add the cutout"

See also: DeleteGeometryAnalysisCutout, GetGeometryAnalysisCutoutVec :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: ss_id string SubSurface ID

openvsp.DeleteGeometryAnalysisCutout(geom_analysis_id, ss_id)[source]

Remove a subsurface from the cutouts of a Geometry Analysis.

ga_id = AddGeometryAnalysis()

wid = AddGeom( "WING" )

ss_id = AddSubSurf( wid, SS_RECTANGLE )

AddGeometryAnalysisCutout( ga_id, ss_id )

DeleteGeometryAnalysisCutout( ga_id, ss_id )

assert len( GetGeometryAnalysisCutoutVec( ga_id ) ) == 0, "DeleteGeometryAnalysisCutout did not remove the cutout"

See also: AddGeometryAnalysisCutout :param [in]: geom_analysis_id string Geometry Analysis case ID :param [in]: ss_id string SubSurface ID

openvsp.GetGeometryAnalysisCutoutVec(geom_analysis_id)[source]

Get the subsurface IDs of the cutouts of a Geometry Analysis.

ga_id = AddGeometryAnalysis()

wid = AddGeom( "WING" )

ss_id = AddSubSurf( wid, SS_RECTANGLE )

AddGeometryAnalysisCutout( ga_id, ss_id )

assert list( GetGeometryAnalysisCutoutVec( ga_id ) ) == [ ss_id ], "GetGeometryAnalysisCutoutVec did not return the cutout"

See also: AddGeometryAnalysisCutout :param [in]: geom_analysis_id string Geometry Analysis case ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of SubSurface IDs

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

openvsp.SetWaveDragRefWingID(geom_id)[source]

Set the Wave Drag reference wing, kept with the model, and use it for the reference quantities, as SetVSPAERORefWingID does. An empty string goes back to manual reference quantities. The WingID analysis input overrides the wing for one run.

wid = AddGeom( "WING" )

SetWaveDragRefWingID( wid )

assert GetWaveDragRefWingID() == wid, "SetWaveDragRefWingID did not set the reference wing"

See also: GetWaveDragRefWingID :param [in]: geom_id string Wing Geom ID, or an empty string

openvsp.GetWaveDragRefWingID()[source]

Get the Wave Drag reference wing the analysis uses, kept with the model.

wid = AddGeom( "WING" )

SetWaveDragRefWingID( wid )

assert GetWaveDragRefWingID() == wid, "GetWaveDragRefWingID did not return the reference wing set"

See also: SetWaveDragRefWingID :rtype: string :return: string Geom ID, or an empty string for none

openvsp.SetWaveDragModeID(mode_id)[source]

Set the Wave Drag mode the analysis uses when its use-mode flag is on, kept with the model. The ModeID analysis input overrides it for one run. The flag is the “UseMode” Parm, group “WaveDrag”, of the “WaveDragSettings” container.

AddGeom( "POD" )

mid = CreateAndAddMode( "Clean", SET_ALL, SET_NONE )

SetWaveDragModeID( mid )

assert GetWaveDragModeID() == mid, "SetWaveDragModeID did not set the mode"

See also: GetWaveDragModeID :param [in]: mode_id string Mode ID, or an empty string

openvsp.GetWaveDragModeID()[source]

Get the Wave Drag mode the analysis uses, kept with the model.

AddGeom( "POD" )

mid = CreateAndAddMode( "Clean", SET_ALL, SET_NONE )

SetWaveDragModeID( mid )

assert GetWaveDragModeID() == mid, "GetWaveDragModeID did not return the mode set"

See also: SetWaveDragModeID :rtype: string :return: string Mode ID, or an empty string for none

openvsp.AddWaveDragFlowSubSurf(ss_id)[source]

Add a subsurface to the faces the Wave Drag analysis treats as flow through.

wid = AddGeom( "WING" )

ss_id = AddSubSurf( wid, SS_RECTANGLE )

AddWaveDragFlowSubSurf( ss_id )

assert list( GetWaveDragFlowSubSurfVec() ) == [ ss_id ], "AddWaveDragFlowSubSurf did not add the face"

See also: DeleteWaveDragFlowSubSurf, GetWaveDragFlowSubSurfVec :param [in]: ss_id string SubSurface ID

openvsp.DeleteWaveDragFlowSubSurf(ss_id)[source]

Remove a subsurface from the faces the Wave Drag analysis treats as flow through.

wid = AddGeom( "WING" )

ss_id = AddSubSurf( wid, SS_RECTANGLE )

AddWaveDragFlowSubSurf( ss_id )

DeleteWaveDragFlowSubSurf( ss_id )

assert len( GetWaveDragFlowSubSurfVec() ) == 0, "DeleteWaveDragFlowSubSurf did not remove the face"

See also: AddWaveDragFlowSubSurf :param [in]: ss_id string SubSurface ID

openvsp.GetWaveDragFlowSubSurfVec()[source]

Get the IDs of the subsurfaces the Wave Drag analysis treats as flow through, kept with the model. The SSFlow_vec analysis input overrides them for one run.

wid = AddGeom( "WING" )

ss_id = AddSubSurf( wid, SS_RECTANGLE )

AddWaveDragFlowSubSurf( ss_id )

assert list( GetWaveDragFlowSubSurfVec() ) == [ ss_id ], "GetWaveDragFlowSubSurfVec did not return the face"

See also: AddWaveDragFlowSubSurf :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of SubSurface IDs