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

Detailed Description

Function Documentation

◆ 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]analysisAnalysis name
Returns
Result ID

◆ 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]analysisAnalysis name
Returns
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]analysisAnalysis name
[in]nameInput name
Returns
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]analysisAnalysis name
Returns
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]analysisAnalysis name
[in]nameInput 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 > analysis_method = GetIntAnalysisInput( analysis_name, "AnalysisMethod" );
analysis_method[0] = ( VSPAERO_ANALYSIS_METHOD::VORTEX_LATTICE );
SetIntAnalysisInput( analysis_name, "AnalysisMethod", analysis_method );
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)
@ VORTEX_LATTICE
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
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]analysisAnalysis name
[in]nameInput name
Returns
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
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]analysisAnalysis 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 > analysis_method = GetIntAnalysisInput( analysis_name, "AnalysisMethod" );
analysis_method[0] = ( VSPAERO_ANALYSIS_METHOD::VORTEX_LATTICE );
SetIntAnalysisInput( analysis_name, "AnalysisMethod", analysis_method );
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