This group of functions is available for manipulating VSPAERO control surface groups through the API. Note, VSPAERO also includes rectangle type sub-surfaces as possible control surfaces. Click here to return to the main page.
More...
◆ AddAllToVSPAEROControlSurfaceGroup()
void vsp::AddAllToVSPAEROControlSurfaceGroup |
( |
int | CSGroupIndex | ) |
|
|
extern |
Add all available control surfaces to the control surface group at the specified index
string wid =
AddGeom(
"WING",
"" );
void AddAllToVSPAEROControlSurfaceGroup(int CSGroupIndex)
int CreateVSPAEROControlSurfaceGroup()
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)
- Parameters
-
[in] | CSGroupIndex | Index of the control surface group |
◆ AddSelectedToCSGroup()
void vsp::AddSelectedToCSGroup |
( |
const vector< int > & | selected, |
|
|
int | CSGroupIndex ) |
|
extern |
Add each control surfaces in the array of control surface indexes to the control surface group at the specified index.
- Warning
- The indexes in input "selected" must be matched with available control surfaces identified by GetAvailableCSNameVec. The "selected" input uses one- based indexing to associate available control surfaces.
string wid =
AddGeom(
"WING",
"" );
array < int > cs_ind_vec( cs_name_vec.size() );
for ( int i = 0; i < int( cs_name_vec.size() ); i++ )
{
cs_ind_vec[i] = i + 1;
}
void AddSelectedToCSGroup(const vector< int > &selected, int CSGroupIndex)
std::vector< std::string > GetAvailableCSNameVec(int CSGroupIndex)
- See also
- GetAvailableCSNameVec
- Parameters
-
[in] | selected | Array of control surface indexes to add to the group. Note, the integer values are one based. |
[in] | CSGroupIndex | Index of the control surface group |
◆ AutoGroupVSPAEROControlSurfaces()
void vsp::AutoGroupVSPAEROControlSurfaces |
( |
| ) |
|
|
extern |
Creates the initial default grouping for the control surfaces. The initial grouping collects all surface copies of the sub-surface into a single group. For example if a wing is defined with an aileron and that wing is symmetrical about the xz plane there will be a surface copy of the master wing surface as well as a copy of the sub-surface. The two sub-surfaces may get deflected differently during analysis routines and can be identified uniquely by their full name.
string wid =
AddGeom(
"WING",
"" );
string vert_id =
AddGeom(
"WING" );
Print( "COMPLETE\n" );
string control_group_settings_container_id =
FindContainer(
"VSPAEROSettings", 0 );
Print( "\tSetting control surface group deflection angles..." );
string deflection_gain_id;
deflection_gain_id =
FindParm( control_group_settings_container_id,
"Surf_" + aileron_id +
"_0_Gain",
"ControlSurfaceGroup_0" );
deflection_gain_id =
FindParm( control_group_settings_container_id,
"Surf_" + aileron_id +
"_1_Gain",
"ControlSurfaceGroup_0" );
string deflection_angle_id =
FindParm( control_group_settings_container_id,
"DeflectionAngle",
"ControlSurfaceGroup_0" );
void AutoGroupVSPAEROControlSurfaces()
void SetGeomName(const std::string &geom_id, const std::string &name)
std::string FindContainer(const std::string &name, int index)
std::string FindParm(const std::string &parm_container_id, const std::string &parm_name, const std::string &group_name)
double SetParmValUpdate(const std::string &parm_id, double val)
void Update(bool update_managers=true)
- See also
- CreateVSPAEROControlSurfaceGroup
◆ CreateVSPAEROControlSurfaceGroup()
int vsp::CreateVSPAEROControlSurfaceGroup |
( |
| ) |
|
|
extern |
Add a new VSPAERO control surface group using the default naming convention. The control surface group will not contain any control surfaces until they are added.
string wid =
AddGeom(
"WING",
"" );
if ( num_group != 1 ) { Print( "Error: CreateVSPAEROControlSurfaceGroup" ); }
int GetNumControlSurfaceGroups()
- See also
- AddSelectedToCSGroup
- Returns
- Index of the new VSPAERO control surface group
◆ GetActiveCSNameVec()
std::vector< std::string > vsp::GetActiveCSNameVec |
( |
int | CSGroupIndex | ) |
|
|
extern |
Get the names of each active (used) control surface in the control surface group at the specified index
string wid =
AddGeom(
"WING",
"" );
Print( "Active CS in Group Index #", false );
Print( group_index );
for ( int i = 0; i < int( cs_name_vec.size() ); i++ )
{
Print( cs_name_vec[i] );
}
std::vector< std::string > GetActiveCSNameVec(int CSGroupIndex)
- Parameters
-
[in] | CSGroupIndex | Index of the control surface group |
- Returns
- Array of active control surface names
◆ GetAvailableCSNameVec()
std::vector< std::string > vsp::GetAvailableCSNameVec |
( |
int | CSGroupIndex | ) |
|
|
extern |
Get the names of each available (not used) control surface in the control surface group at the specified index
string wid =
AddGeom(
"WING",
"" );
array < int > cs_ind_vec(1);
cs_ind_vec[0] = 1;
- Parameters
-
[in] | CSGroupIndex | Index of the control surface group |
- Returns
- Array of active control surface names
◆ GetCompleteCSNameVec()
std::vector< std::string > vsp::GetCompleteCSNameVec |
( |
| ) |
|
|
extern |
Get the names of all control surfaces. Some may be active (used) while others may be available.
string wid =
AddGeom(
"WING",
"" );
Print( "All Control Surfaces: ", false );
for ( int i = 0; i < int( cs_name_vec.size() ); i++ )
{
Print( cs_name_vec[i] );
}
std::vector< std::string > GetCompleteCSNameVec()
- Returns
- Array of all control surface names
◆ GetNumControlSurfaceGroups()
int vsp::GetNumControlSurfaceGroups |
( |
| ) |
|
|
extern |
Get the total number of control surface groups
string wid =
AddGeom(
"WING",
"" );
string horiz_id =
AddGeom(
"WING",
"" );
if ( num_group != 2 ) { Print( "Error: GetNumControlSurfaceGroups" ); }
- Returns
- Number of control surface groups
◆ GetVSPAEROControlGroupName()
std::string vsp::GetVSPAEROControlGroupName |
( |
int | CSGroupIndex | ) |
|
|
extern |
Get the name of the control surface group at the specified index
string wid =
AddGeom(
"WING",
"" );
Print( "CS Group name: ", false );
void SetVSPAEROControlGroupName(const string &name, int CSGroupIndex)
std::string GetVSPAEROControlGroupName(int CSGroupIndex)
- Parameters
-
[in] | CSGroupIndex | Index of the control surface group |
◆ RemoveAllFromVSPAEROControlSurfaceGroup()
void vsp::RemoveAllFromVSPAEROControlSurfaceGroup |
( |
int | CSGroupIndex | ) |
|
|
extern |
Remove all used control surfaces from the control surface group at the specified index
string wid =
AddGeom(
"WING",
"" );
void RemoveAllFromVSPAEROControlSurfaceGroup(int CSGroupIndex)
- Parameters
-
[in] | CSGroupIndex | Index of the control surface group |
◆ RemoveSelectedFromCSGroup()
void vsp::RemoveSelectedFromCSGroup |
( |
const vector< int > & | selected, |
|
|
int | CSGroupIndex ) |
|
extern |
Remove each control surfaces in the array of control surface indexes from the control surface group at the specified index.
- Warning
- The indexes in input "selected" must be matched with active control surfaces identified by GetActiveCSNameVec. The "selected" input uses one-based indexing to associate available control surfaces.
string wid =
AddGeom(
"WING",
"" );
array < int > cs_ind_vec( cs_name_vec.size() );
for ( int i = 0; i < int( cs_name_vec.size() ); i++ )
{
cs_ind_vec[i] = i + 1;
}
array < int > remove_cs_ind_vec( 1 );
remove_cs_ind_vec[0] = 1;
void RemoveSelectedFromCSGroup(const vector< int > &selected, int CSGroupIndex)
- See also
- GetActiveCSNameVec
- Parameters
-
[in] | selected | Array of control surface indexes to remove from the group. Note, the integer values are one based. |
[in] | CSGroupIndex | Index of the control surface group |
◆ SetVSPAEROControlGroupName()
void vsp::SetVSPAEROControlGroupName |
( |
const string & | name, |
|
|
int | CSGroupIndex ) |
|
extern |
Set the name for the control surface group at the specified index
string wid =
AddGeom(
"WING",
"" );
Print( "CS Group name: ", false );
- Parameters
-
[in] | name | Name to set for the control surface group |
[in] | CSGroupIndex | Index of the control surface group |