OpenVSP API Documentation 3.55.0
Loading...
Searching...
No Matches
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. Click here to return to the main page. More...

Functions

void vsp::SetAeroStructTargetID (const std::string &id)
std::string vsp::GetAeroStructTargetID ()
int vsp::GetNumAnalysis ()
std::vector< std::string > vsp::ListAnalysis ()
std::vector< std::string > vsp::GetAnalysisInputNames (const std::string &analysis)
std::string vsp::GetAnalysisDoc (const std::string &analysis)
std::string vsp::GetAnalysisInputDoc (const std::string &analysis, const std::string &name)
std::string vsp::ExecAnalysis (const std::string &analysis)
int vsp::GetNumAnalysisInputData (const std::string &analysis, const std::string &name)
int vsp::GetAnalysisInputType (const std::string &analysis, const std::string &name)
const std::vector< int > & vsp::GetIntAnalysisInput (const std::string &analysis, const std::string &name, int index=0)
const std::vector< double > & vsp::GetDoubleAnalysisInput (const std::string &analysis, const std::string &name, int index=0)
const std::vector< std::string > & vsp::GetStringAnalysisInput (const std::string &analysis, const std::string &name, int index=0)
const std::vector< vec3d > & vsp::GetVec3dAnalysisInput (const std::string &analysis, const std::string &name, int index=0)
void vsp::SetAnalysisInputDefaults (const std::string &analysis)
void vsp::SetIntAnalysisInput (const std::string &analysis, const std::string &name, const std::vector< int > &indata, int index=0)
void vsp::SetDoubleAnalysisInput (const std::string &analysis, const std::string &name, const std::vector< double > &indata, int index=0)
void vsp::SetStringAnalysisInput (const std::string &analysis, const std::string &name, const std::vector< std::string > &indata, int index=0)
void vsp::SetVec3dAnalysisInput (const std::string &analysis, const std::string &name, const std::vector< vec3d > &indata, int index=0)
void vsp::PrintAnalysisInputs (const std::string &analysis_name)
void vsp::PrintAnalysisDocs (const std::string &analysis_name)
std::string vsp::AddGeometryAnalysis ()
std::string vsp::AddGeometryAnalysisAzEl (const std::string &geom_analysis_id, double azimuth, double elevation)
void vsp::DeleteGeometryAnalysisAzEl (const std::string &geom_analysis_id, int index)
void vsp::DeleteGeometryAnalysisAzElByID (const std::string &geom_analysis_id, const std::string &azimuth_parm_id)
void vsp::DeleteAllGeometryAnalysisAzEl (const std::string &geom_analysis_id)
int vsp::GetNumGeometryAnalysisAzEl (const std::string &geom_analysis_id)
std::string vsp::GetGeometryAnalysisAzimuthParm (const std::string &geom_analysis_id, int index)
std::string vsp::GetGeometryAnalysisElevationParm (const std::string &geom_analysis_id, int index)
std::vector< std::string > vsp::GetGeometryAnalysisAzimuthParmVec (const std::string &geom_analysis_id)
std::vector< std::string > vsp::GetGeometryAnalysisElevationParmVec (const std::string &geom_analysis_id)
void vsp::SetGeometryAnalysisPrimaryModeID (const std::string &geom_analysis_id, const std::string &mode_id)
std::string vsp::GetGeometryAnalysisPrimaryModeID (const std::string &geom_analysis_id)
void vsp::SetGeometryAnalysisPrimaryGeomID (const std::string &geom_analysis_id, const std::string &geom_id)
std::string vsp::GetGeometryAnalysisPrimaryGeomID (const std::string &geom_analysis_id)
void vsp::SetGeometryAnalysisSecondaryGeomID (const std::string &geom_analysis_id, const std::string &geom_id)
std::string vsp::GetGeometryAnalysisSecondaryGeomID (const std::string &geom_analysis_id)
void vsp::SetGeometryAnalysisDirectionGeomID (const std::string &geom_analysis_id, const std::string &geom_id)
std::string vsp::GetGeometryAnalysisDirectionGeomID (const std::string &geom_analysis_id)
void vsp::AddGeometryAnalysisCutout (const std::string &geom_analysis_id, const std::string &ss_id)
void vsp::DeleteGeometryAnalysisCutout (const std::string &geom_analysis_id, const std::string &ss_id)
std::vector< std::string > vsp::GetGeometryAnalysisCutoutVec (const std::string &geom_analysis_id)
void vsp::DeleteGeometryAnalysis (const std::string &id)
void vsp::DeleteAllGeometryAnalyses ()
std::vector< std::string > vsp::GetAllGeometryAnalysesIDVec ()
void vsp::SetActiveGeometryAnalysis (const std::string &id)
std::string vsp::GetActiveGeometryAnalysis ()
std::string vsp::MakeMeshGeom (const std::string &ga_id)
void vsp::SetWaveDragRefWingID (const std::string &geom_id)
std::string vsp::GetWaveDragRefWingID ()
void vsp::SetWaveDragModeID (const std::string &mode_id)
std::string vsp::GetWaveDragModeID ()
void vsp::AddWaveDragFlowSubSurf (const std::string &ss_id)
void vsp::DeleteWaveDragFlowSubSurf (const std::string &ss_id)
std::vector< std::string > vsp::GetWaveDragFlowSubSurfVec ()

Detailed Description

Function Documentation

◆ AddGeometryAnalysis()

std::string vsp::AddGeometryAnalysis ( )
extern

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 ====//
string ga_id = AddGeometryAnalysis();
Print( "Added Geometry Analysis: ", false );
Print( ga_id );
if ( ga_id.length() == 0 || ga_id == "NONE" )
{
Print( "ERROR: AddGeometryAnalysis returned no id" );
__failure++;
}
void Print(const std::string &data, bool new_line=true)
std::string AddGeometryAnalysis()
See also
DeleteGeometryAnalysis, DeleteAllGeometryAnalyses, GetAllGeometryAnalysesIDVec
Returns
string ID of the newly created Geometry Analysis case
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddGeometryAnalysisAzEl()

std::string vsp::AddGeometryAnalysisAzEl ( const std::string & geom_analysis_id,
double azimuth,
double elevation )
extern

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

//==== GeometryAnalysis: Delete a specific case ====//
string ga_id = AddGeometryAnalysis();
if ( GetAllGeometryAnalysesIDVec().size() != 1 )
{
Print( "ERROR: AddGeometryAnalysis did not add a case" );
__failure++;
}
if ( GetAllGeometryAnalysesIDVec().size() != 0 )
{
Print( "ERROR: DeleteGeometryAnalysis did not remove the case" );
__failure++;
}
void DeleteGeometryAnalysis(const std::string &id)
std::vector< std::string > GetAllGeometryAnalysesIDVec()
See also
AddGeometryAnalysis, DeleteAllGeometryAnalyses, GetAllGeometryAnalysesIDVec
Parameters
[in]idstring 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.

string ga_id = AddGeometryAnalysis();
if ( GetNumGeometryAnalysisAzEl( ga_id ) != 0 )
{
Print( "ERROR: a new Geometry Analysis already carries az/el pairs" );
__failure++;
}
string az_id = AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 );
if ( az_id != GetGeometryAnalysisAzimuthParm( ga_id, 0 ) )
{
Print( "ERROR: AddGeometryAnalysisAzEl did not return the new pair's azimuth Parm" );
__failure++;
}
if ( GetNumGeometryAnalysisAzEl( ga_id ) != 1 )
{
Print( "ERROR: AddGeometryAnalysisAzEl did not add a pair" );
__failure++;
}
// Each pair is a pair of Parms, so the values can be read and changed.
string az_id = GetGeometryAnalysisAzimuthParm( ga_id, 0 );
string el_id = GetGeometryAnalysisElevationParm( ga_id, 0 );
if ( !closeTo( GetParmVal( az_id ), 30.0, 1e-6 ) || !closeTo( GetParmVal( el_id ), 15.0, 1e-6 ) )
{
Print( "ERROR: the az/el pair does not hold the values it was given" );
__failure++;
}
// An ID that is not a Geometry Analysis has to be rejected.
AddGeometryAnalysisAzEl( "NOSUCHANALYSIS", 0.0, 0.0 );
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: AddGeometryAnalysisAzEl accepted a bad ID" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
ErrorObj err = PopLastError();
}
std::string GetGeometryAnalysisElevationParm(const std::string &geom_analysis_id, int index)
std::string AddGeometryAnalysisAzEl(const std::string &geom_analysis_id, double azimuth, double elevation)
std::string GetGeometryAnalysisAzimuthParm(const std::string &geom_analysis_id, int index)
int GetNumGeometryAnalysisAzEl(const std::string &geom_analysis_id)
double GetParmVal(const std::string &parm_id)
See also
AddGeometryAnalysis, DeleteGeometryAnalysisAzEl, GetNumGeometryAnalysisAzEl
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]azimuthdouble Azimuth angle (degrees, -180 to 180)
[in]elevationdouble Elevation angle (degrees, -90 to 90)
Returns
string ID of the azimuth Parm of the new pair
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddGeometryAnalysisCutout()

void vsp::AddGeometryAnalysisCutout ( const std::string & geom_analysis_id,
const std::string & ss_id )
extern

Add a subsurface to the cutouts of a Geometry Analysis.

string ga_id = AddGeometryAnalysis();
string wid = AddGeom( "WING" );
string ss_id = AddSubSurf( wid, SS_RECTANGLE );
AddGeometryAnalysisCutout( ga_id, ss_id );
array< string > @ids = GetGeometryAnalysisCutoutVec( ga_id );
if ( ids.size() != 1 || ids[0] != ss_id )
{
Print( "ERROR: AddGeometryAnalysisCutout did not add the cutout" );
__failure++;
}
void AddGeometryAnalysisCutout(const std::string &geom_analysis_id, const std::string &ss_id)
std::vector< std::string > GetGeometryAnalysisCutoutVec(const std::string &geom_analysis_id)
@ SS_RECTANGLE
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::string AddSubSurf(const std::string &geom_id, int type, int surfindex=0)
See also
DeleteGeometryAnalysisCutout, GetGeometryAnalysisCutoutVec
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]ss_idstring SubSurface ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddWaveDragFlowSubSurf()

void vsp::AddWaveDragFlowSubSurf ( const std::string & ss_id)
extern

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

string wid = AddGeom( "WING" );
string ss_id = AddSubSurf( wid, SS_RECTANGLE );
array< string > @ids = GetWaveDragFlowSubSurfVec();
if ( ids.size() != 1 || ids[0] != ss_id )
{
Print( "ERROR: AddWaveDragFlowSubSurf did not add the face" );
__failure++;
}
void AddWaveDragFlowSubSurf(const std::string &ss_id)
std::vector< std::string > GetWaveDragFlowSubSurfVec()
See also
DeleteWaveDragFlowSubSurf, GetWaveDragFlowSubSurfVec
Parameters
[in]ss_idstring SubSurface ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteAllGeometryAnalyses()

void vsp::DeleteAllGeometryAnalyses ( )
extern

Delete all Geometry Analysis cases from the Geometry Analysis Manager.

//==== GeometryAnalysis: Delete all cases ====//
string ga_id_1 = AddGeometryAnalysis();
string ga_id_2 = AddGeometryAnalysis();
if ( ga_id_1 == ga_id_2 )
{
Print( "ERROR: AddGeometryAnalysis reused an ID" );
__failure++;
}
if ( GetAllGeometryAnalysesIDVec().size() != 2 )
{
Print( "ERROR: the two cases were not both added" );
__failure++;
}
array < string > @ga_ids = GetAllGeometryAnalysesIDVec();
Print( "Number of Geometry Analyses after delete: ", false );
Print( ga_ids.size() );
if ( ga_ids.size() != 0 )
{
Print( "ERROR: DeleteAllGeometryAnalyses left cases behind" );
__failure++;
}
void DeleteAllGeometryAnalyses()
See also
AddGeometryAnalysis, DeleteGeometryAnalysis, GetAllGeometryAnalysesIDVec
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteAllGeometryAnalysisAzEl()

void vsp::DeleteAllGeometryAnalysisAzEl ( const std::string & geom_analysis_id)
extern

Delete every azimuth and elevation pair from a Geometry Analysis case

string ga_id = AddGeometryAnalysis();
AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 );
AddGeometryAnalysisAzEl( ga_id, 60.0, 45.0 );
if ( GetNumGeometryAnalysisAzEl( ga_id ) != 0 )
{
Print( "ERROR: DeleteAllGeometryAnalysisAzEl left pairs behind" );
__failure++;
}
// Clearing an empty case is not an error.
if ( GetNumTotalErrors() != 0 )
{
Print( "ERROR: DeleteAllGeometryAnalysisAzEl complained about an empty case" );
__failure++;
}
void DeleteAllGeometryAnalysisAzEl(const std::string &geom_analysis_id)
See also
AddGeometryAnalysisAzEl, DeleteGeometryAnalysisAzEl
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteGeometryAnalysis()

void vsp::DeleteGeometryAnalysis ( const std::string & id)
extern

Delete one geometry analysis case.

string id = AddGeometryAnalysis();
if ( GetActiveGeometryAnalysis() != id ) { Print( "ERROR: DeleteGeometryAnalysis" ); __failure++; }
// The case that was active is gone, so nothing is active.
if ( GetActiveGeometryAnalysis() == id ) { Print( "ERROR: DeleteGeometryAnalysis" ); __failure++; }
std::string GetActiveGeometryAnalysis()
void SetActiveGeometryAnalysis(const std::string &id)
See also
AddGeometryAnalysis
Parameters
[in]idstring Geometry analysis case ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteGeometryAnalysisAzEl()

void vsp::DeleteGeometryAnalysisAzEl ( const std::string & geom_analysis_id,
int index )
extern

Delete one azimuth and elevation pair from a Geometry Analysis case

string ga_id = AddGeometryAnalysis();
AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 );
AddGeometryAnalysisAzEl( ga_id, 60.0, 45.0 );
// Only the indexed pair goes, and the rest slide down.
if ( GetNumGeometryAnalysisAzEl( ga_id ) != 1 )
{
Print( "ERROR: DeleteGeometryAnalysisAzEl did not remove one pair" );
__failure++;
}
else
{
if ( !closeTo( GetParmVal( GetGeometryAnalysisAzimuthParm( ga_id, 0 ) ), 60.0, 1e-6 ) )
{
Print( "ERROR: DeleteGeometryAnalysisAzEl removed the wrong pair" );
__failure++;
}
}
// An index past the end has to be rejected.
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: DeleteGeometryAnalysisAzEl accepted an index past the end" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
ErrorObj err = PopLastError();
}
void DeleteGeometryAnalysisAzEl(const std::string &geom_analysis_id, int index)
See also
AddGeometryAnalysisAzEl, DeleteAllGeometryAnalysisAzEl, DeleteGeometryAnalysisAzElByID
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]indexint Az/El pair index
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteGeometryAnalysisAzElByID()

void vsp::DeleteGeometryAnalysisAzElByID ( const std::string & geom_analysis_id,
const std::string & azimuth_parm_id )
extern

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

string ga_id = AddGeometryAnalysis();
string az_id = AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 );
AddGeometryAnalysisAzEl( ga_id, 60.0, 5.0 );
if ( GetNumGeometryAnalysisAzEl( ga_id ) != 1 || abs( GetParmVal( GetGeometryAnalysisAzimuthParm( ga_id, 0 ) ) - 60.0 ) > 1e-6 )
{
Print( "ERROR: DeleteGeometryAnalysisAzElByID deleted the wrong pair" );
__failure++;
}
void DeleteGeometryAnalysisAzElByID(const std::string &geom_analysis_id, const std::string &azimuth_parm_id)
See also
AddGeometryAnalysisAzEl, GetGeometryAnalysisAzimuthParmVec, DeleteGeometryAnalysisAzEl
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]azimuth_parm_idstring ID of the azimuth Parm of the pair
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteGeometryAnalysisCutout()

void vsp::DeleteGeometryAnalysisCutout ( const std::string & geom_analysis_id,
const std::string & ss_id )
extern

Remove a subsurface from the cutouts of a Geometry Analysis.

string ga_id = AddGeometryAnalysis();
string wid = AddGeom( "WING" );
string ss_id = AddSubSurf( wid, SS_RECTANGLE );
AddGeometryAnalysisCutout( ga_id, ss_id );
if ( GetGeometryAnalysisCutoutVec( ga_id ).size() != 0 )
{
Print( "ERROR: DeleteGeometryAnalysisCutout did not remove the cutout" );
__failure++;
}
void DeleteGeometryAnalysisCutout(const std::string &geom_analysis_id, const std::string &ss_id)
See also
AddGeometryAnalysisCutout
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]ss_idstring SubSurface ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteWaveDragFlowSubSurf()

void vsp::DeleteWaveDragFlowSubSurf ( const std::string & ss_id)
extern

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

string wid = AddGeom( "WING" );
string ss_id = AddSubSurf( wid, SS_RECTANGLE );
if ( GetWaveDragFlowSubSurfVec().size() != 0 )
{
Print( "ERROR: DeleteWaveDragFlowSubSurf did not remove the face" );
__failure++;
}
void DeleteWaveDragFlowSubSurf(const std::string &ss_id)
See also
AddWaveDragFlowSubSurf
Parameters
[in]ss_idstring SubSurface ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExecAnalysis()

std::string vsp::ExecAnalysis ( const std::string & analysis)
extern

Execute an analysis through the Analysis Manager

string analysis_name = "VSPAEROComputeGeometry";
string res_id = ExecAnalysis( analysis_name );
if ( res_id.length() == 0 )
{
Print( "ERROR: ExecAnalysis returned no id" );
__failure++;
}
std::string ExecAnalysis(const std::string &analysis)
Parameters
[in]analysisstring Analysis name
Returns
string Result ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetActiveGeometryAnalysis()

std::string vsp::GetActiveGeometryAnalysis ( )
extern

Get the ID of the active Geometry Analysis case.

string ga_id = AddGeometryAnalysis();
string active = GetActiveGeometryAnalysis();
if ( active.length() == 0 )
{
Print( "ERROR: GetActiveGeometryAnalysis returned nothing" );
__failure++;
}
See also
SetActiveGeometryAnalysis
Returns
string Active Geometry Analysis case ID (empty string if none)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAeroStructTargetID()

std::string vsp::GetAeroStructTargetID ( )
extern

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

string pod_id = AddGeom( "POD" );
AddFeaStruct( pod_id );
string struct_id = AddFeaStructure( pod_id );
SetAeroStructTargetID( struct_id );
if ( GetAeroStructTargetID() != struct_id )
{
Print( "ERROR: GetAeroStructTargetID did not return the target set" );
__failure++;
}
std::string GetAeroStructTargetID()
void SetAeroStructTargetID(const std::string &id)
std::string AddFeaStructure(const std::string &geom_id, bool init_skin=true, int surfindex=0)
int AddFeaStruct(const std::string &geom_id, bool init_skin=true, int surfindex=0)
See also
SetAeroStructTargetID
Returns
string FEA Structure or FEA Assembly ID, or an empty string for none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAllGeometryAnalysesIDVec()

std::vector< std::string > vsp::GetAllGeometryAnalysesIDVec ( )
extern

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

//==== GeometryAnalysis: List all cases ====//
string ga_id_1 = AddGeometryAnalysis();
string ga_id_2 = AddGeometryAnalysis();
array < string > @ga_ids = GetAllGeometryAnalysesIDVec();
if ( ga_ids.length() == 0 )
{
Print( "ERROR: GetAllGeometryAnalysesIDVec returned nothing" );
__failure++;
}
for ( int i = 0; i < int( ga_ids.size() ); i++ )
{
Print( "Geometry Analysis ID: ", false );
Print( ga_ids[i] );
}
See also
AddGeometryAnalysis, DeleteGeometryAnalysis, DeleteAllGeometryAnalyses
Returns
vector<string> Array of all Geometry Analysis case IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAnalysisDoc()

std::string vsp::GetAnalysisDoc ( const std::string & analysis)
extern

Get the analysis documentation string

string analysis_name = "VSPAEROComputeGeometry";
string doc = GetAnalysisDoc( analysis_name );
if ( doc.length() == 0 )
{
Print( "ERROR: GetAnalysisDoc returned nothing" );
__failure++;
}
std::string GetAnalysisDoc(const std::string &analysis)
Parameters
[in]analysisstring Analysis name
Returns
string Documentation string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAnalysisInputDoc()

std::string vsp::GetAnalysisInputDoc ( const std::string & analysis,
const std::string & name )
extern

Get the documentation string for the particular analysis and input

string analysis_name = "CompGeom";
array < string > @in_array = GetAnalysisInputNames( analysis_name );
string doc = GetAnalysisInputDoc( analysis_name, in_array[0] );
if ( doc.length() == 0 ) { Print( "ERROR: GetAnalysisInputDoc" ); __failure++; }
std::vector< std::string > GetAnalysisInputNames(const std::string &analysis)
std::string GetAnalysisInputDoc(const std::string &analysis, const std::string &name)
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
Returns
string Documentation string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAnalysisInputNames()

std::vector< std::string > vsp::GetAnalysisInputNames ( const std::string & analysis)
extern

Get the name of every available input for a particular analysis

string analysis_name = "VSPAEROComputeGeometry";
array<string>@ in_names = GetAnalysisInputNames( analysis_name );
if ( in_names.length() == 0 )
{
Print( "ERROR: GetAnalysisInputNames returned nothing" );
__failure++;
}
Print("Analysis Inputs: ");
for ( int i = 0; i < int( in_names.size() ); i++)
{
Print( ( "\t" + in_names[i] + "\n" ) );
}
Parameters
[in]analysisstring Analysis name
Returns
vector<string> Array of input names
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAnalysisInputType()

int vsp::GetAnalysisInputType ( const std::string & analysis,
const std::string & name )
extern

Get the data type for a particulat analysis type and input

string analysis = "VSPAEROComputeGeometry";
array < string > @ inp_array = GetAnalysisInputNames( analysis );
if ( inp_array.size() == 0 )
{
Print( "ERROR: GetAnalysisInputNames returned nothing" );
__failure++;
}
for ( int j = 0; j < int( inp_array.size() ); j++ )
{
int typ = GetAnalysisInputType( analysis, inp_array[j] );
// Every input the analysis lists has to report a real data type.
if ( typ == INVALID_TYPE )
{
Print( "ERROR: GetAnalysisInputType returned INVALID_TYPE for " + inp_array[j] );
__failure++;
}
}
// An input that does not exist has to report INVALID_TYPE.
if ( GetAnalysisInputType( analysis, "NoSuchInput" ) != INVALID_TYPE )
{
Print( "ERROR: GetAnalysisInputType accepted an unknown input" );
__failure++;
}
// That lookup failure was raised deliberately, so take it back off the queue.
while ( GetNumTotalErrors() > 0 )
{
ErrorObj err = PopLastError();
}
int GetAnalysisInputType(const std::string &analysis, const std::string &name)
@ INVALID_TYPE
See also
RES_DATA_TYPE
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
Returns
int Data type enum (i.e. DOUBLE_DATA)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDoubleAnalysisInput()

const std::vector< double > & vsp::GetDoubleAnalysisInput ( const std::string & analysis,
const std::string & name,
int index = 0 )
extern

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

array<double> vinfFCinput = GetDoubleAnalysisInput( "ParasiteDrag", "Vinf" );
if ( vinfFCinput.length() == 0 )
{
Print( "ERROR: GetDoubleAnalysisInput returned nothing" );
__failure++;
}
vinfFCinput[0] = 629;
SetDoubleAnalysisInput( "ParasiteDrag", "Vinf", vinfFCinput );
const std::vector< double > & GetDoubleAnalysisInput(const std::string &analysis, const std::string &name, int index=0)
void SetDoubleAnalysisInput(const std::string &analysis, const std::string &name, const std::vector< double > &indata, int index=0)
See also
RES_DATA_TYPE, SetDoubleAnalysisInput
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
[in]indexint Data index
Returns
vector<double> Array of analysis input values
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGeometryAnalysisAzimuthParm()

std::string vsp::GetGeometryAnalysisAzimuthParm ( const std::string & geom_analysis_id,
int index )
extern

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

string id = AddGeometryAnalysis();
AddGeometryAnalysisAzEl( id, 10.0, 20.0 );
string azparm = GetGeometryAnalysisAzimuthParm( id, 0 );
if ( !closeTo( GetParmVal( azparm ), 10.0, 1e-6 ) ) { Print( "ERROR: GetGeometryAnalysisAzimuthParm" ); __failure++; }
See also
AddGeometryAnalysisAzEl, GetGeometryAnalysisElevationParm
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]indexint Az/El pair index
Returns
string Azimuth Parm ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGeometryAnalysisAzimuthParmVec()

std::vector< std::string > vsp::GetGeometryAnalysisAzimuthParmVec ( const std::string & geom_analysis_id)
extern

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

string ga_id = AddGeometryAnalysis();
string az_id = AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 );
array< string > @ids = GetGeometryAnalysisAzimuthParmVec( ga_id );
if ( ids.size() != 1 || ids[0] != az_id )
{
Print( "ERROR: GetGeometryAnalysisAzimuthParmVec did not return the Parm" );
__failure++;
}
std::vector< std::string > GetGeometryAnalysisAzimuthParmVec(const std::string &geom_analysis_id)
See also
GetGeometryAnalysisElevationParmVec
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
Returns
array<string> Array of azimuth Parm IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGeometryAnalysisCutoutVec()

std::vector< std::string > vsp::GetGeometryAnalysisCutoutVec ( const std::string & geom_analysis_id)
extern

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

string ga_id = AddGeometryAnalysis();
string wid = AddGeom( "WING" );
string ss_id = AddSubSurf( wid, SS_RECTANGLE );
AddGeometryAnalysisCutout( ga_id, ss_id );
array< string > @ids = GetGeometryAnalysisCutoutVec( ga_id );
if ( ids.size() != 1 || ids[0] != ss_id )
{
Print( "ERROR: GetGeometryAnalysisCutoutVec did not return the cutout" );
__failure++;
}
See also
AddGeometryAnalysisCutout
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
Returns
array<string> Array of SubSurface IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGeometryAnalysisDirectionGeomID()

std::string vsp::GetGeometryAnalysisDirectionGeomID ( const std::string & geom_analysis_id)
extern

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

string ga_id = AddGeometryAnalysis();
string pod_id = AddGeom( "POD" );
if ( GetGeometryAnalysisDirectionGeomID( ga_id ) != pod_id )
{
Print( "ERROR: GetGeometryAnalysisDirectionGeomID did not return the Geom set" );
__failure++;
}
std::string GetGeometryAnalysisDirectionGeomID(const std::string &geom_analysis_id)
void SetGeometryAnalysisDirectionGeomID(const std::string &geom_analysis_id, const std::string &geom_id)
See also
SetGeometryAnalysisDirectionGeomID
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
Returns
string Geom ID, or an empty string for none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGeometryAnalysisElevationParm()

std::string vsp::GetGeometryAnalysisElevationParm ( const std::string & geom_analysis_id,
int index )
extern

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

string id = AddGeometryAnalysis();
AddGeometryAnalysisAzEl( id, 10.0, 20.0 );
string elparm = GetGeometryAnalysisElevationParm( id, 0 );
if ( !closeTo( GetParmVal( elparm ), 20.0, 1e-6 ) ) { Print( "ERROR: GetGeometryAnalysisElevationParm" ); __failure++; }
See also
AddGeometryAnalysisAzEl, GetGeometryAnalysisAzimuthParm
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]indexint Az/El pair index
Returns
string Elevation Parm ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGeometryAnalysisElevationParmVec()

std::vector< std::string > vsp::GetGeometryAnalysisElevationParmVec ( const std::string & geom_analysis_id)
extern

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

string ga_id = AddGeometryAnalysis();
AddGeometryAnalysisAzEl( ga_id, 30.0, 15.0 );
array< string > @ids = GetGeometryAnalysisElevationParmVec( ga_id );
if ( ids.size() != 1 || ids[0] != GetGeometryAnalysisElevationParm( ga_id, 0 ) )
{
Print( "ERROR: GetGeometryAnalysisElevationParmVec did not return the Parm" );
__failure++;
}
std::vector< std::string > GetGeometryAnalysisElevationParmVec(const std::string &geom_analysis_id)
See also
GetGeometryAnalysisAzimuthParmVec
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
Returns
array<string> Array of elevation Parm IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGeometryAnalysisPrimaryGeomID()

std::string vsp::GetGeometryAnalysisPrimaryGeomID ( const std::string & geom_analysis_id)
extern

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

string ga_id = AddGeometryAnalysis();
string pod_id = AddGeom( "POD" );
if ( GetGeometryAnalysisPrimaryGeomID( ga_id ) != pod_id )
{
Print( "ERROR: GetGeometryAnalysisPrimaryGeomID did not return the Geom set" );
__failure++;
}
void SetGeometryAnalysisPrimaryGeomID(const std::string &geom_analysis_id, const std::string &geom_id)
std::string GetGeometryAnalysisPrimaryGeomID(const std::string &geom_analysis_id)
See also
SetGeometryAnalysisPrimaryGeomID
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
Returns
string Geom ID, or an empty string for none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGeometryAnalysisPrimaryModeID()

std::string vsp::GetGeometryAnalysisPrimaryModeID ( const std::string & geom_analysis_id)
extern

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

string ga_id = AddGeometryAnalysis();
if ( GetGeometryAnalysisPrimaryModeID( ga_id ) != "" )
{
Print( "ERROR: a new Geometry Analysis names a mode" );
__failure++;
}
std::string GetGeometryAnalysisPrimaryModeID(const std::string &geom_analysis_id)
See also
SetGeometryAnalysisPrimaryModeID
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
Returns
string Mode ID, or an empty string for none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGeometryAnalysisSecondaryGeomID()

std::string vsp::GetGeometryAnalysisSecondaryGeomID ( const std::string & geom_analysis_id)
extern

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

string ga_id = AddGeometryAnalysis();
string pod_id = AddGeom( "POD" );
if ( GetGeometryAnalysisSecondaryGeomID( ga_id ) != pod_id )
{
Print( "ERROR: GetGeometryAnalysisSecondaryGeomID did not return the Geom set" );
__failure++;
}
void SetGeometryAnalysisSecondaryGeomID(const std::string &geom_analysis_id, const std::string &geom_id)
std::string GetGeometryAnalysisSecondaryGeomID(const std::string &geom_analysis_id)
See also
SetGeometryAnalysisSecondaryGeomID
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
Returns
string Geom ID, or an empty string for none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIntAnalysisInput()

const std::vector< int > & vsp::GetIntAnalysisInput ( const std::string & analysis,
const std::string & name,
int index = 0 )
extern

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

//==== Analysis: VSPAero Compute Geometry ====//
string analysis_name = "VSPAEROComputeGeometry";
// Set to panel method
array< int > thick_set = GetIntAnalysisInput( analysis_name, "GeomSet" );
if ( thick_set.length() == 0 )
{
Print( "ERROR: GetIntAnalysisInput returned nothing" );
__failure++;
}
array< int > thin_set = GetIntAnalysisInput( analysis_name, "ThinGeomSet" );
thick_set[0] = ( SET_TYPE::SET_NONE );
thin_set[0] = ( SET_TYPE::SET_ALL );
SetIntAnalysisInput( analysis_name, "GeomSet", thick_set, 0);
SetIntAnalysisInput( analysis_name, "ThinGeomSet", thin_set, 0);
const std::vector< int > & GetIntAnalysisInput(const std::string &analysis, const std::string &name, int index=0)
void SetIntAnalysisInput(const std::string &analysis, const std::string &name, const std::vector< int > &indata, int index=0)
@ SET_NONE
@ SET_ALL
See also
RES_DATA_TYPE, SetIntAnalysisInput
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
[in]indexint Data index
Returns
vector<int> Array of analysis input values
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumAnalysis()

int vsp::GetNumAnalysis ( )
extern

Get the number of analysis types available in the Analysis Manager

int nanalysis = GetNumAnalysis();
Print( "Number of registered analyses: " + nanalysis );
// The count has to match the list of names.
array< string > @analysis_array = ListAnalysis();
if ( nanalysis != int( analysis_array.size() ) )
{
Print( "ERROR: GetNumAnalysis disagrees with ListAnalysis" );
__failure++;
}
if ( nanalysis < 1 )
{
Print( "ERROR: no analyses registered" );
__failure++;
}
int GetNumAnalysis()
std::vector< std::string > ListAnalysis()
Returns
int Number of analyses
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumAnalysisInputData()

int vsp::GetNumAnalysisInputData ( const std::string & analysis,
const std::string & name )
extern

Get the documentation string for the particular analysis and input

string analysis_name = "CompGeom";
array < string > @in_array = GetAnalysisInputNames( analysis_name );
if ( GetNumAnalysisInputData( analysis_name, in_array[0] ) < 1 ) { Print( "ERROR: GetNumAnalysisInputData" ); __failure++; }
int GetNumAnalysisInputData(const std::string &analysis, const std::string &name)
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
Returns
int Documentation string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumGeometryAnalysisAzEl()

int vsp::GetNumGeometryAnalysisAzEl ( const std::string & geom_analysis_id)
extern

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

string id = AddGeometryAnalysis();
AddGeometryAnalysisAzEl( id, 10.0, 20.0 );
if ( GetNumGeometryAnalysisAzEl( id ) != 1 ) { Print( "ERROR: GetNumGeometryAnalysisAzEl" ); __failure++; }
See also
AddGeometryAnalysisAzEl
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
Returns
int Number of az/el pairs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStringAnalysisInput()

const std::vector< std::string > & vsp::GetStringAnalysisInput ( const std::string & analysis,
const std::string & name,
int index = 0 )
extern

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

array<string> fileNameInput = GetStringAnalysisInput( "ParasiteDrag", "FileName" );
if ( fileNameInput.length() == 0 )
{
Print( "ERROR: GetStringAnalysisInput returned nothing" );
__failure++;
}
fileNameInput[0] = "ParasiteDragExample";
SetStringAnalysisInput( "ParasiteDrag", "FileName", fileNameInput );
void SetStringAnalysisInput(const std::string &analysis, const std::string &name, const std::vector< std::string > &indata, int index=0)
const std::vector< std::string > & GetStringAnalysisInput(const std::string &analysis, const std::string &name, int index=0)
See also
RES_DATA_TYPE, SetStringAnalysisInput
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
[in]indexint Data index
Returns
vector<string> Array of analysis input values
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetVec3dAnalysisInput()

const std::vector< vec3d > & vsp::GetVec3dAnalysisInput ( const std::string & analysis,
const std::string & name,
int index = 0 )
extern

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

// PlanarSlice
array<vec3d> norm = GetVec3dAnalysisInput( "PlanarSlice", "Norm" );
if ( norm.length() == 0 )
{
Print( "ERROR: GetVec3dAnalysisInput returned nothing" );
__failure++;
}
norm[0].set_xyz( 0.23, 0.6, 0.15 );
SetVec3dAnalysisInput( "PlanarSlice", "Norm", norm );
void SetVec3dAnalysisInput(const std::string &analysis, const std::string &name, const std::vector< vec3d > &indata, int index=0)
const std::vector< vec3d > & GetVec3dAnalysisInput(const std::string &analysis, const std::string &name, int index=0)
See also
RES_DATA_TYPE, SetVec3dAnalysisInput
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
[in]indexint Data index
Returns
vector<vec3d> Array of analysis input values
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWaveDragFlowSubSurfVec()

std::vector< std::string > vsp::GetWaveDragFlowSubSurfVec ( )
extern

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.

string wid = AddGeom( "WING" );
string ss_id = AddSubSurf( wid, SS_RECTANGLE );
array< string > @ids = GetWaveDragFlowSubSurfVec();
if ( ids.size() != 1 || ids[0] != ss_id )
{
Print( "ERROR: GetWaveDragFlowSubSurfVec did not return the face" );
__failure++;
}
See also
AddWaveDragFlowSubSurf
Returns
array<string> Array of SubSurface IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWaveDragModeID()

std::string vsp::GetWaveDragModeID ( )
extern

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

AddGeom( "POD" );
string mid = CreateAndAddMode( "Clean", SET_ALL, SET_NONE );
if ( GetWaveDragModeID() != mid )
{
Print( "ERROR: GetWaveDragModeID did not return the mode set" );
__failure++;
}
std::string GetWaveDragModeID()
void SetWaveDragModeID(const std::string &mode_id)
std::string CreateAndAddMode(const std::string &name, int normal_set, int degen_set)
See also
SetWaveDragModeID
Returns
string Mode ID, or an empty string for none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWaveDragRefWingID()

std::string vsp::GetWaveDragRefWingID ( )
extern

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

string wid = AddGeom( "WING" );
if ( GetWaveDragRefWingID() != wid )
{
Print( "ERROR: GetWaveDragRefWingID did not return the reference wing set" );
__failure++;
}
std::string GetWaveDragRefWingID()
void SetWaveDragRefWingID(const std::string &geom_id)
See also
SetWaveDragRefWingID
Returns
string Geom ID, or an empty string for none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ListAnalysis()

std::vector< std::string > vsp::ListAnalysis ( )
extern

Get the name of every available analysis in the Analysis Manager

array< string > @analysis_array = ListAnalysis();
Print( "List of Available Analyses: " );
for ( int i = 0; i < int( analysis_array.size() ); i++ )
{
Print( " " + analysis_array[i] );
if ( analysis_array[i].length() == 0 )
{
Print( "ERROR: ListAnalysis returned an unnamed analysis" );
__failure++;
}
}
if ( int( analysis_array.size() ) != GetNumAnalysis() )
{
Print( "ERROR: ListAnalysis disagrees with GetNumAnalysis" );
__failure++;
}
// The analyses the rest of these examples lean on have to be there.
bool found = false;
for ( int i = 0; i < int( analysis_array.size() ); i++ )
{
if ( analysis_array[i] == "VSPAEROComputeGeometry" )
{
found = true;
}
}
if ( !found )
{
Print( "ERROR: VSPAEROComputeGeometry is not registered" );
__failure++;
}
Returns
vector<string> Array of analysis names
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeMeshGeom()

std::string vsp::MakeMeshGeom ( const std::string & ga_id)
extern

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 ====//
string pod_id = AddGeom( "POD" );
string 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 );
// Evaluate the case through the Analysis framework so that its result meshes exist.
SetAnalysisInputDefaults( "GeometryAnalysis" );
array<string> case_input = { ga_id };
SetStringAnalysisInput( "GeometryAnalysis", "CaseID", case_input );
ExecAnalysis( "GeometryAnalysis" );
// Turn the case's result meshes into a MeshGeom.
string mesh_id = MakeMeshGeom( ga_id );
if ( mesh_id.length() == 0 )
{
Print( "ERROR: MakeMeshGeom returned no id" );
__failure++;
}
std::string MakeMeshGeom(const std::string &ga_id)
void SetAnalysisInputDefaults(const std::string &analysis)
@ SET_TARGET
std::string FindParm(const std::string &parm_container_id, const std::string &parm_name, const std::string &group_name)
double SetParmVal(const std::string &parm_id, double val)
void Update(bool update_managers=true)
See also
AddGeometryAnalysis, SetActiveGeometryAnalysis
Parameters
[in]ga_idstring Geometry Analysis case ID
Returns
string Geom ID of the newly created MeshGeom
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAnalysisDocs()

void vsp::PrintAnalysisDocs ( const std::string & analysis_name)
extern

Print to stdout all current input documentation for a specific analysis

//==== Analysis: VSPAero Compute Geometry ====//
string analysis_name = "VSPAEROComputeGeometry";
// list inputs, type, and documentation
PrintAnalysisDocs( analysis_name );
// The analysis itself has to carry documentation to print.
if ( GetAnalysisDoc( analysis_name ).length() == 0 )
{
Print( "ERROR: the analysis carries no documentation" );
__failure++;
}
// Printing an analysis that does not exist has to be rejected.
PrintAnalysisDocs( "NoSuchAnalysis" );
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: PrintAnalysisDocs accepted an unknown analysis" );
__failure++;
}
// That error was raised deliberately, so take it back off the queue.
while ( GetNumTotalErrors() > 0 )
{
ErrorObj err = PopLastError();
}
void PrintAnalysisDocs(const std::string &analysis_name)
Parameters
[in]analysis_namestring Name of analysis
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAnalysisInputs()

void vsp::PrintAnalysisInputs ( const std::string & analysis_name)
extern

Print to stdout all current input values for a specific analysis

//==== Analysis: VSPAero Compute Geometry ====//
string analysis_name = "VSPAEROComputeGeometry";
// list inputs, type, and current values
PrintAnalysisInputs( analysis_name );
// There has to be something to list.
array< string > @inp_array = GetAnalysisInputNames( analysis_name );
if ( inp_array.size() == 0 )
{
Print( "ERROR: the analysis reports no inputs to print" );
__failure++;
}
// Printing an analysis that does not exist has to be rejected.
PrintAnalysisInputs( "NoSuchAnalysis" );
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: PrintAnalysisInputs accepted an unknown analysis" );
__failure++;
}
// That error was raised deliberately, so take it back off the queue.
while ( GetNumTotalErrors() > 0 )
{
ErrorObj err = PopLastError();
}
void PrintAnalysisInputs(const std::string &analysis_name)
Parameters
[in]analysis_namestring Name of analysis
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetActiveGeometryAnalysis()

void vsp::SetActiveGeometryAnalysis ( const std::string & id)
extern

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.

string ga_id = AddGeometryAnalysis();
if ( GetActiveGeometryAnalysis() != ga_id )
{
Print( "ERROR: SetActiveGeometryAnalysis did not take" );
__failure++;
}
See also
GetActiveGeometryAnalysis, AddGeometryAnalysis
Parameters
[in]idstring Geometry Analysis case ID (empty string for none)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAeroStructTargetID()

void vsp::SetAeroStructTargetID ( const std::string & id)
extern

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.

string pod_id = AddGeom( "POD" );
AddFeaStruct( pod_id );
string struct_id = AddFeaStructure( pod_id );
SetAeroStructTargetID( struct_id );
if ( GetAeroStructTargetID() != struct_id )
{
Print( "ERROR: SetAeroStructTargetID did not set the target" );
__failure++;
}
See also
GetAeroStructTargetID
Parameters
[in]idstring FEA Structure or FEA Assembly ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAnalysisInputDefaults()

void vsp::SetAnalysisInputDefaults ( const std::string & analysis)
extern

Set all input values to their defaults for a specific analysis

//==== Analysis: VSPAero Compute Geometry ====//
string analysis_name = "VSPAEROComputeGeometry";
// Change an input away from its default...
array< int > geom_set = GetIntAnalysisInput( analysis_name, "GeomSet" );
array< int > new_set = geom_set;
new_set[0] = new_set[0] + 1;
SetIntAnalysisInput( analysis_name, "GeomSet", new_set );
array< int > check_set = GetIntAnalysisInput( analysis_name, "GeomSet" );
if ( check_set[0] != new_set[0] )
{
Print( "ERROR: SetIntAnalysisInput did not take" );
__failure++;
}
// ...and set defaults, which has to put it back.
SetAnalysisInputDefaults( analysis_name );
check_set = GetIntAnalysisInput( analysis_name, "GeomSet" );
if ( check_set[0] != geom_set[0] )
{
Print( "ERROR: SetAnalysisInputDefaults did not restore the default" );
__failure++;
}
Parameters
[in]analysisstring Analysis name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDoubleAnalysisInput()

void vsp::SetDoubleAnalysisInput ( const std::string & analysis,
const std::string & name,
const std::vector< double > & indata,
int index = 0 )
extern

Set the value of a particular analysis input of double type

//==== Analysis: CpSlicer ====//
string analysis_name = "CpSlicer";
// Setup cuts
array < double > ycuts;
ycuts.push_back( 2.0 );
ycuts.push_back( 4.5 );
ycuts.push_back( 8.0 );
SetDoubleAnalysisInput( analysis_name, "YSlicePosVec", ycuts, 0 );
if ( GetDoubleAnalysisInput( analysis_name, "YSlicePosVec", 0 ) != ycuts )
{
Print( "ERROR: SetDoubleAnalysisInput did not take" );
__failure++;
}
See also
GetDoubleAnalysisInput
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
[in]indatavector<double> Array of double values to set the input to
[in]indexint Data index
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetGeometryAnalysisDirectionGeomID()

void vsp::SetGeometryAnalysisDirectionGeomID ( const std::string & geom_analysis_id,
const std::string & geom_id )
extern

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

string ga_id = AddGeometryAnalysis();
string pod_id = AddGeom( "POD" );
if ( GetGeometryAnalysisDirectionGeomID( ga_id ) != pod_id )
{
Print( "ERROR: SetGeometryAnalysisDirectionGeomID did not set the Geom" );
__failure++;
}
See also
GetGeometryAnalysisDirectionGeomID
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]geom_idstring Geom ID, or an empty string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetGeometryAnalysisPrimaryGeomID()

void vsp::SetGeometryAnalysisPrimaryGeomID ( const std::string & geom_analysis_id,
const std::string & geom_id )
extern

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

string ga_id = AddGeometryAnalysis();
string pod_id = AddGeom( "POD" );
if ( GetGeometryAnalysisPrimaryGeomID( ga_id ) != pod_id )
{
Print( "ERROR: SetGeometryAnalysisPrimaryGeomID did not set the Geom" );
__failure++;
}
See also
GetGeometryAnalysisPrimaryGeomID
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]geom_idstring Geom ID, or an empty string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetGeometryAnalysisPrimaryModeID()

void vsp::SetGeometryAnalysisPrimaryModeID ( const std::string & geom_analysis_id,
const std::string & mode_id )
extern

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

string ga_id = AddGeometryAnalysis();
AddGeom( "POD" );
string mid = CreateAndAddMode( "Clean", SET_ALL, SET_NONE );
if ( GetGeometryAnalysisPrimaryModeID( ga_id ) != mid )
{
Print( "ERROR: SetGeometryAnalysisPrimaryModeID did not set the mode" );
__failure++;
}
void SetGeometryAnalysisPrimaryModeID(const std::string &geom_analysis_id, const std::string &mode_id)
See also
GetGeometryAnalysisPrimaryModeID
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]mode_idstring Mode ID, or an empty string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetGeometryAnalysisSecondaryGeomID()

void vsp::SetGeometryAnalysisSecondaryGeomID ( const std::string & geom_analysis_id,
const std::string & geom_id )
extern

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

string ga_id = AddGeometryAnalysis();
string pod_id = AddGeom( "POD" );
if ( GetGeometryAnalysisSecondaryGeomID( ga_id ) != pod_id )
{
Print( "ERROR: SetGeometryAnalysisSecondaryGeomID did not set the Geom" );
__failure++;
}
See also
GetGeometryAnalysisSecondaryGeomID
Parameters
[in]geom_analysis_idstring Geometry Analysis case ID
[in]geom_idstring Geom ID, or an empty string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetIntAnalysisInput()

void vsp::SetIntAnalysisInput ( const std::string & analysis,
const std::string & name,
const std::vector< int > & indata,
int index = 0 )
extern

Set the value of a particular analysis input of integer type

//==== Analysis: VSPAero Compute Geometry ====//
string analysis_name = "VSPAEROComputeGeometry";
// Set to panel method
array< int > thick_set = GetIntAnalysisInput( analysis_name, "GeomSet" );
array< int > thin_set = GetIntAnalysisInput( analysis_name, "ThinGeomSet" );
thick_set[0] = ( SET_TYPE::SET_NONE );
thin_set[0] = ( SET_TYPE::SET_ALL );
SetIntAnalysisInput( analysis_name, "GeomSet", thick_set, 0);
if ( GetIntAnalysisInput( analysis_name, "GeomSet", 0 ) != thick_set )
{
Print( "ERROR: SetIntAnalysisInput did not take" );
__failure++;
}
SetIntAnalysisInput( analysis_name, "ThinGeomSet", thin_set, 0);
See also
GetIntAnalysisInput
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
[in]indatavector<int> Array of integer values to set the input to
[in]indexint Data index
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetStringAnalysisInput()

void vsp::SetStringAnalysisInput ( const std::string & analysis,
const std::string & name,
const std::vector< std::string > & indata,
int index = 0 )
extern

Set the value of a particular analysis input of string type

array<string> fileNameInput = GetStringAnalysisInput( "ParasiteDrag", "FileName" );
fileNameInput[0] = "ParasiteDragExample";
SetStringAnalysisInput( "ParasiteDrag", "FileName", fileNameInput );
if ( GetStringAnalysisInput( "ParasiteDrag", "FileName" ) != fileNameInput )
{
Print( "ERROR: SetStringAnalysisInput did not take" );
__failure++;
}
See also
GetStringAnalysisInput
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
[in]indatavector<string> Array of string values to set the input to
[in]indexint Data index
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVec3dAnalysisInput()

void vsp::SetVec3dAnalysisInput ( const std::string & analysis,
const std::string & name,
const std::vector< vec3d > & indata,
int index = 0 )
extern

Set the value of a particular analysis input of vec3d type

// PlanarSlice
array<vec3d> norm = GetVec3dAnalysisInput( "PlanarSlice", "Norm" );
norm[0].set_xyz( 0.23, 0.6, 0.15 );
SetVec3dAnalysisInput( "PlanarSlice", "Norm", norm );
if ( GetVec3dAnalysisInput( "PlanarSlice", "Norm" ) != norm )
{
Print( "ERROR: SetVec3dAnalysisInput did not take" );
__failure++;
}
See also
GetVec3dAnalysisInput
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
[in]indatavector<vec3d> Array of vec3d values to set the input to
[in]indexint Data index
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetWaveDragModeID()

void vsp::SetWaveDragModeID ( const std::string & mode_id)
extern

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" );
string mid = CreateAndAddMode( "Clean", SET_ALL, SET_NONE );
if ( GetWaveDragModeID() != mid )
{
Print( "ERROR: SetWaveDragModeID did not set the mode" );
__failure++;
}
See also
GetWaveDragModeID
Parameters
[in]mode_idstring Mode ID, or an empty string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetWaveDragRefWingID()

void vsp::SetWaveDragRefWingID ( const std::string & geom_id)
extern

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.

string wid = AddGeom( "WING" );
if ( GetWaveDragRefWingID() != wid )
{
Print( "ERROR: SetWaveDragRefWingID did not set the reference wing" );
__failure++;
}
See also
GetWaveDragRefWingID
Parameters
[in]geom_idstring Wing Geom ID, or an empty string
Here is the call graph for this function:
Here is the caller graph for this function: