OpenVSP API Documentation 3.50.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

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)
string vsp::AddGeometryAnalysis ()
void vsp::DeleteGeometryAnalysis (const string &id)
void vsp::DeleteAllGeometryAnalyses ()
vector< string > vsp::GetAllGeometryAnalysesIDVec ()

Detailed Description

Function Documentation

◆ AddGeometryAnalysis()

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 );
string AddGeometryAnalysis()
See also
DeleteGeometryAnalysis, DeleteAllGeometryAnalyses, GetAllGeometryAnalysesIDVec
Returns
string ID of the newly created Geometry Analysis case

◆ 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();
array < string > @ga_ids = GetAllGeometryAnalysesIDVec();
Print( "Number of Geometry Analyses after delete: ", false );
Print( ga_ids.size() );
void DeleteAllGeometryAnalyses()
vector< string > GetAllGeometryAnalysesIDVec()
See also
AddGeometryAnalysis, DeleteGeometryAnalysis, GetAllGeometryAnalysesIDVec

◆ DeleteGeometryAnalysis()

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

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

//==== GeometryAnalysis: Delete a specific case ====//
string ga_id = AddGeometryAnalysis();
void DeleteGeometryAnalysis(const string &id)
See also
AddGeometryAnalysis, DeleteAllGeometryAnalyses, GetAllGeometryAnalysesIDVec
Parameters
[in]idstring ID of the Geometry Analysis case to delete

◆ 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 );
std::string ExecAnalysis(const std::string &analysis)
Parameters
[in]analysisstring Analysis name
Returns
string Result ID

◆ GetAllGeometryAnalysesIDVec()

vector< 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();
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

◆ GetAnalysisDoc()

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

Get the analysis documentation string

string analysis_name = "VSPAEROComputeGeometry";
string doc = GetAnalysisDoc( analysis_name );
std::string GetAnalysisDoc(const std::string &analysis)
Parameters
[in]analysisstring Analysis name
Returns
string Documentation string

◆ GetAnalysisInputDoc()

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

Get the documentation string for the particular analysis and input

Parameters
[in]analysisstring Analysis name
[in]namestring Input name
Returns
string Documentation string

◆ 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 );
Print("Analysis Inputs: ");
for ( int i = 0; i < int( in_names.size() ); i++)
{
Print( ( "\t" + in_names[i] + "\n" ) );
}
std::vector< std::string > GetAnalysisInputNames(const std::string &analysis)
Parameters
[in]analysisstring Analysis name
Returns
vector<string> Array of input names

◆ 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 );
for ( int j = 0; j < int( inp_array.size() ); j++ )
{
int typ = GetAnalysisInputType( analysis, inp_array[j] );
}
int GetAnalysisInputType(const std::string &analysis, const std::string &name)
See also
RES_DATA_TYPE
Parameters
[in]analysisstring Analysis name
[in]namestring Input name
Returns
int Data type enum (i.e. DOUBLE_DATA)

◆ 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" );
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

◆ 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" );
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

◆ 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 );
int GetNumAnalysis()
Returns
int Number of analyses

◆ GetNumAnalysisInputData()

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

Get the documentation string for the particular analysis and input

Parameters
[in]analysisstring Analysis name
[in]namestring Input name
Returns
int Documentation string

◆ 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" );
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

◆ 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" );
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

◆ 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] );
}
std::vector< std::string > ListAnalysis()
Returns
vector<string> Array of analysis names

◆ 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 );
void PrintAnalysisDocs(const std::string &analysis_name)
Parameters
[in]analysis_namestring Name of analysis

◆ 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 );
void PrintAnalysisInputs(const std::string &analysis_name)
Parameters
[in]analysis_namestring Name of analysis

◆ 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";
// Set defaults
SetAnalysisInputDefaults( analysis_name );
void SetAnalysisInputDefaults(const std::string &analysis)
Parameters
[in]analysisstring Analysis name

◆ 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 );
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

◆ 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);
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

◆ 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 );
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

◆ 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 );
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