OpenVSP API Documentation  3.38.0
Functions
FEA Mesh Functions

The following group of API functions supports all functionality of the FEA Mesh Tool. Structures, FEA Parts, materials, and properties can be defined and manipulated. Mesh and output file settings can be adjusted, and an FEA mesh can be generated. Click here to return to the main page. More...

Functions

int vsp::AddFeaStruct (const std::string &geom_id, bool init_skin=true, int surfindex=0)
 
void vsp::SetFeaMeshStructIndex (int struct_index)
 
void vsp::DeleteFeaStruct (const std::string &geom_id, int fea_struct_ind)
 
std::string vsp::GetFeaStructID (const std::string &geom_id, int fea_struct_ind)
 
int vsp::GetFeaStructIndex (const std::string &struct_id)
 
std::string vsp::GetFeaStructParentGeomID (const std::string &struct_id)
 
std::string vsp::GetFeaStructName (const std::string &geom_id, int fea_struct_ind)
 
void vsp::SetFeaStructName (const std::string &geom_id, int fea_struct_ind, const std::string &name)
 
std::vector< std::string > vsp::GetFeaStructIDVec ()
 
void vsp::SetFeaPartName (const std::string &part_id, const std::string &name)
 
std::string vsp::AddFeaPart (const std::string &geom_id, int fea_struct_ind, int type)
 
void vsp::DeleteFeaPart (const std::string &geom_id, int fea_struct_ind, const std::string &part_id)
 
std::string vsp::GetFeaPartID (const std::string &fea_struct_id, int fea_part_index)
 
std::string vsp::GetFeaPartName (const std::string &part_id)
 
int vsp::GetFeaPartType (const std::string &part_id)
 
std::vector< std::string > vsp::GetFeaPartIDVec (const std::string &fea_struct_id)
 
std::vector< std::string > vsp::GetFeaSubSurfIDVec (const std::string &fea_struct_id)
 
void vsp::SetFeaPartPerpendicularSparID (const std::string &part_id, const std::string &perpendicular_spar_id)
 
std::string vsp::GetFeaPartPerpendicularSparID (const std::string &part_id)
 
std::string vsp::AddFeaSubSurf (const std::string &geom_id, int fea_struct_ind, int type)
 
void vsp::DeleteFeaSubSurf (const std::string &geom_id, int fea_struct_ind, const std::string &ss_id)
 
int vsp::GetFeaSubSurfIndex (const string &ss_id)
 
int vsp::NumFeaStructures ()
 
int vsp::NumFeaParts (const std::string &fea_struct_id)
 
int vsp::NumFeaSubSurfs (const std::string &fea_struct_id)
 
std::string vsp::AddFeaMaterial ()
 
std::string vsp::AddFeaProperty (int property_type=0)
 
void vsp::SetFeaMeshVal (const std::string &geom_id, int fea_struct_ind, int type, double val)
 
void vsp::SetFeaMeshFileName (const std::string &geom_id, int fea_struct_ind, int file_type, const string &file_name)
 
void vsp::ComputeFeaMesh (const std::string &geom_id, int fea_struct_ind, int file_type)
 
void vsp::ComputeFeaMesh (const std::string &struct_id, int file_type)
 

Detailed Description

Function Documentation

◆ AddFeaMaterial()

std::string vsp::AddFeaMaterial ( )

Add an FEA Material the FEA Mesh material library. Materials are available across all Geoms and Structures.

//==== Create FeaMaterial ====//
string mat_id = AddFeaMaterial();
SetParmVal( FindParm( mat_id, "MassDensity", "FeaMaterial" ), 0.016 );
std::string AddFeaMaterial()
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)
Returns
FEA Material ID

◆ AddFeaPart()

std::string vsp::AddFeaPart ( const std::string &  geom_id,
int  fea_struct_ind,
int  type 
)

Add an FEA Part to a Structure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Add Bulkead ====//
string bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE );
SetParmVal( FindParm( bulkhead_id, "IncludedElements", "FeaPart" ), FEA_SHELL_AND_BEAM );
SetParmVal( FindParm( bulkhead_id, "RelCenterLocation", "FeaPart" ), 0.15 );
@ FEA_SLICE
Definition: APIDefines.h:589
@ FEA_SHELL_AND_BEAM
Definition: APIDefines.h:571
std::string AddFeaPart(const std::string &geom_id, int fea_struct_ind, int type)
int AddFeaStruct(const std::string &geom_id, bool init_skin=true, int surfindex=0)
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
See also
FEA_PART_TYPE
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index
[in]typeFEA Part type enum (i.e. FEA_RIB)
Returns
FEA Part ID

◆ AddFeaProperty()

std::string vsp::AddFeaProperty ( int  property_type = 0)

Add aa FEA Property the FEA Mesh property library. Properties are available across all Geoms and Structures. Currently only beam and shell properties are available. Note FEA_SHELL_AND_BEAM is not a valid property type.

//==== Create FeaProperty ====//
string prop_id = AddFeaProperty();
SetParmVal( FindParm( prop_id, "Thickness", "FeaProperty" ), 0.01 );
std::string AddFeaProperty(int property_type=0)
See also
FEA_PART_ELEMENT_TYPE
Parameters
[in]property_typeFEA Property type enum (i.e. FEA_SHELL).
Returns
FEA Property ID

◆ AddFeaStruct()

int vsp::AddFeaStruct ( const std::string &  geom_id,
bool  init_skin = true,
int  surfindex = 0 
)

Add an FEA Structure to a specified Geom

Warning
init_skin should ALWAYS be set to true.
//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
Parameters
[in]geom_idstring Parent Geom ID
[in]init_skinFlag to initialize the FEA Structure by creating an FEA Skin from the parent Geom's OML at surfindex
[in]surfindexMain surface index for the FEA Structure
Returns
FEA Structure index

◆ AddFeaSubSurf()

std::string vsp::AddFeaSubSurf ( const std::string &  geom_id,
int  fea_struct_ind,
int  type 
)

Add an FEA SubSurface to a Structure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Add LineArray ====//
string line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY );
SetParmVal( FindParm( line_array_id, "ConstLineType", "SS_LineArray" ), 1 ); // Constant W
SetParmVal( FindParm( line_array_id, "Spacing", "SS_LineArray" ), 0.25 );
@ SS_LINE_ARRAY
Definition: APIDefines.h:1143
std::string AddFeaSubSurf(const std::string &geom_id, int fea_struct_ind, int type)
See also
SUBSURF_TYPE
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index
[in]typeFEA SubSurface type enum (i.e. SS_ELLIPSE)
Returns
FEA SubSurface ID

◆ ComputeFeaMesh() [1/2]

void vsp::ComputeFeaMesh ( const std::string &  geom_id,
int  fea_struct_ind,
int  file_type 
)

Compute an FEA Mesh for a Structure. Only a single output file can be generated with this function.

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
string struct_id = GetFeaStructID( pod_id, struct_ind );
//==== Generate FEA Mesh and Export ====//
Print( string( "--> Generating FeaMesh " ) );
//==== Get Parent Geom ID and Index ====//
string parent_id = GetFeaStructParentGeomID( struct_id ); // same as pod_id
ComputeFeaMesh( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME );
// Could also call ComputeFeaMesh ( struct_id, FEA_CALCULIX_FILE_NAME );
@ FEA_CALCULIX_FILE_NAME
Definition: APIDefines.h:509
std::string GetFeaStructParentGeomID(const std::string &struct_id)
void ComputeFeaMesh(const std::string &geom_id, int fea_struct_ind, int file_type)
std::string GetFeaStructID(const std::string &geom_id, int fea_struct_ind)
See also
SetFeaMeshFileName, FEA_EXPORT_TYPE
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indint FEA Structure index
[in]file_typeint FEA output file type enum (i.e. FEA_EXPORT_TYPE)

◆ ComputeFeaMesh() [2/2]

void vsp::ComputeFeaMesh ( const std::string &  struct_id,
int  file_type 
)

Compute an FEA Mesh for a Structure. Only a single output file can be generated with this function.

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
string struct_id = GetFeaStructID( pod_id, struct_ind );
//==== Generate FEA Mesh and Export ====//
Print( string( "--> Generating FeaMesh " ) );
//==== Get Parent Geom ID and Index ====//
string parent_id = GetFeaStructParentGeomID( struct_id ); // same as pod_id
ComputeFeaMesh( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME );
// Could also call ComputeFeaMesh ( struct_id, FEA_CALCULIX_FILE_NAME );
See also
SetFeaMeshFileName, FEA_EXPORT_TYPE
Parameters
[in]struct_idstring FEA Structure index
[in]file_typeint FEA output file type enum (i.e. FEA_EXPORT_TYPE)

◆ DeleteFeaPart()

void vsp::DeleteFeaPart ( const std::string &  geom_id,
int  fea_struct_ind,
const std::string &  part_id 
)

Delete an FEA Part from a Structure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Add Bulkead ====//
string bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE );
//==== Add Fixed Point ====//
string fixed_id = AddFeaPart( pod_id, struct_ind, FEA_FIX_POINT );
//==== Delete Bulkead ====//
DeleteFeaPart( pod_id, struct_ind, bulkhead_id );
@ FEA_FIX_POINT
Definition: APIDefines.h:592
void DeleteFeaPart(const std::string &geom_id, int fea_struct_ind, const std::string &part_id)
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index
[in]part_idFEA Part ID

◆ DeleteFeaStruct()

void vsp::DeleteFeaStruct ( const std::string &  geom_id,
int  fea_struct_ind 
)

Delete an FEA Structure and all FEA Parts and FEA SubSurfaces associated with it

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind_1 = AddFeaStruct( pod_id );
int struct_ind_2 = AddFeaStruct( pod_id );
DeleteFeaStruct( pod_id, struct_ind_1 );
void DeleteFeaStruct(const std::string &geom_id, int fea_struct_ind)
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index

◆ DeleteFeaSubSurf()

void vsp::DeleteFeaSubSurf ( const std::string &  geom_id,
int  fea_struct_ind,
const std::string &  ss_id 
)

Delete an FEA SubSurface from a Structure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Add LineArray ====//
string line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY );
//==== Add Rectangle ====//
string rect_id = AddFeaSubSurf( pod_id, struct_ind, SS_RECTANGLE );
//==== Delete LineArray ====//
DeleteFeaSubSurf( pod_id, struct_ind, line_array_id );
@ SS_RECTANGLE
Definition: APIDefines.h:1140
void DeleteFeaSubSurf(const std::string &geom_id, int fea_struct_ind, const std::string &ss_id)
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index
[in]ss_idFEA SubSurface ID

◆ GetFeaPartID()

std::string vsp::GetFeaPartID ( const std::string &  fea_struct_id,
int  fea_part_index 
)

Get the Parm ID of an FEA Part, identified from a FEA Structure Parm ID and FEA Part index.

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
string struct_id = GetFeaStructID( pod_id, struct_ind );
//==== Add Bulkead ====//
string bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE );
if ( bulkhead_id != GetFeaPartID( struct_id, 1 ) ) // These should be equivalent (index 0 is skin)
{
Print( "Error: GetFeaPartID" );
}
std::string GetFeaPartID(const std::string &fea_struct_id, int fea_part_index)
void Update(bool update_managers=true)
Parameters
[in]fea_struct_idFEA Structure ID
[in]fea_part_indexFEA Part index
Returns
FEA Part ID

◆ GetFeaPartIDVec()

std::vector< std::string > vsp::GetFeaPartIDVec ( const std::string &  fea_struct_id)

Get the IDs of all FEA Parts in the given FEA Structure

//==== Add Geometries ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
string struct_id = GetFeaStructID( pod_id, struct_ind );
//==== Add FEA Parts ====//
string slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE );
string dome_id = AddFeaPart( pod_id, struct_ind, FEA_DOME );
array < string > part_id_vec = GetFeaPartIDVec( struct_id ); // Should include slice_id & dome_id
@ FEA_DOME
Definition: APIDefines.h:593
std::vector< std::string > GetFeaPartIDVec(const std::string &fea_struct_id)
See also
NumFeaParts
Parameters
[in]fea_struct_idFEA Structure ID
Returns
Array of FEA Part IDs

◆ GetFeaPartName()

std::string vsp::GetFeaPartName ( const std::string &  part_id)

Get the name of an FEA Part

//==== Add Fuselage Geometry ====//
string fuse_id = AddGeom( "FUSELAGE" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( fuse_id );
//==== Add Bulkead ====//
string bulkhead_id = AddFeaPart( fuse_id, struct_ind, FEA_SLICE );
string name = "example_name";
SetFeaPartName( bulkhead_id, name );
if ( name != GetFeaPartName( bulkhead_id ) ) // These should be equivalent
{
Print( "Error: GetFeaPartName" );
}
void SetFeaPartName(const std::string &part_id, const std::string &name)
std::string GetFeaPartName(const std::string &part_id)
See also
SetFeaPartName
Parameters
[in]part_idFEA Part ID
Returns
FEA Part name

◆ GetFeaPartPerpendicularSparID()

std::string vsp::GetFeaPartPerpendicularSparID ( const std::string &  part_id)

Get the ID of the perpendicular spar for an FEA Rib or Rib Array. Note, the FEA Rib or Rib Array doesn't have to have "SPAR_NORMAL" set for the "PerpendicularEdgeType" Parm for this function to still return a value.

//==== Add Wing Geometry ====//
string wing_id = AddGeom( "WING" );
//==== Add FeaStructure to Wing ====//
int struct_ind = AddFeaStruct( wing_id );
//==== Add Rib ====//
string rib_id = AddFeaPart( wing_id, struct_ind, FEA_RIB );
//==== Add Spars ====//
string spar_id_1 = AddFeaPart( wing_id, struct_ind, FEA_SPAR );
string spar_id_2 = AddFeaPart( wing_id, struct_ind, FEA_SPAR );
SetParmVal( FindParm( spar_id_1, "RelCenterLocation", "FeaPart" ), 0.25 );
SetParmVal( FindParm( spar_id_2, "RelCenterLocation", "FeaPart" ), 0.75 );
//==== Set Perpendicular Edge type to SPAR ====//
SetParmVal( FindParm( rib_id, "PerpendicularEdgeType", "FeaRib" ), SPAR_NORMAL );
SetFeaPartPerpendicularSparID( rib_id, spar_id_2 );
if ( spar_id_2 != GetFeaPartPerpendicularSparID( rib_id ) )
{
Print( "Error: GetFeaPartPerpendicularSparID" );
}
@ SPAR_NORMAL
Definition: APIDefines.h:632
@ FEA_RIB
Definition: APIDefines.h:590
@ FEA_SPAR
Definition: APIDefines.h:591
std::string GetFeaPartPerpendicularSparID(const std::string &part_id)
void SetFeaPartPerpendicularSparID(const std::string &part_id, const std::string &perpendicular_spar_id)
See also
FEA_RIB_NORMAL, SetFeaPartPerpendicularSparID
Parameters
[in]part_idFEA Part ID (Rib or Rib Array Type)
Returns
Perpendicular FEA Spar ID

◆ GetFeaPartType()

int vsp::GetFeaPartType ( const std::string &  part_id)

Get the type of an FEA Part

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Add Slice ====//
string slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE );
if ( FEA_SLICE != GetFeaPartType( slice_id ) ) // These should be equivalent
{
Print( "Error: GetFeaPartType" );
}
int GetFeaPartType(const std::string &part_id)
See also
FEA_PART_TYPE
Parameters
[in]part_idFEA Part ID
Returns
FEA Part type enum

◆ GetFeaStructID()

std::string vsp::GetFeaStructID ( const std::string &  geom_id,
int  fea_struct_ind 
)

Get the ID of an FEA Structure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
string struct_id = GetFeaStructID( pod_id, struct_ind );
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index
Returns
FEA Structure ID

◆ GetFeaStructIDVec()

std::vector< std::string > vsp::GetFeaStructIDVec ( )

Get the IDs of all FEA Structures in the vehicle

//==== Add Geometries ====//
string pod_id = AddGeom( "POD" );
string wing_id = AddGeom( "WING" );
//==== Add FeaStructures ====//
int pod_struct_ind = AddFeaStruct( pod_id );
int wing_struct_ind = AddFeaStruct( wing_id );
array < string > struct_id_vec = GetFeaStructIDVec();
std::vector< std::string > GetFeaStructIDVec()
See also
NumFeaStructures
Returns
Array of FEA Structure IDs

◆ GetFeaStructIndex()

int vsp::GetFeaStructIndex ( const std::string &  struct_id)

Get the index of an FEA Structure in its Parent Geom's vector of Structures

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind_1 = AddFeaStruct( pod_id );
int struct_ind_2 = AddFeaStruct( pod_id );
string struct_id_2 = GetFeaStructID( pod_id, struct_ind_2 );
DeleteFeaStruct( pod_id, struct_ind_1 );
int struct_ind_2_new = GetFeaStructIndex( struct_id_2 );
int GetFeaStructIndex(const std::string &struct_id)
Parameters
[in]struct_idFEA Structure ID
Returns
FEA Structure index

◆ GetFeaStructName()

std::string vsp::GetFeaStructName ( const std::string &  geom_id,
int  fea_struct_ind 
)

Get the name of an FEA Structure. The FEA Structure name functions as the the Parm Container name

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Get Structure Name ====//
string parm_container_name = GetFeaStructName( pod_id, struct_ind );
string display_name = string("Current Structure Parm Container Name: ") + parm_container_name + string("\n");
Print( display_name );
std::string GetFeaStructName(const std::string &geom_id, int fea_struct_ind)
See also
FindContainer, SetFeaStructName
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index
Returns
Name for the FEA Structure

◆ GetFeaStructParentGeomID()

std::string vsp::GetFeaStructParentGeomID ( const std::string &  struct_id)

Get the Parent Geom ID for an FEA Structure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
string struct_id = GetFeaStructID( pod_id, struct_ind );
//==== Get Parent Geom ID and Index ====//
string parent_id = GetFeaStructParentGeomID( struct_id );
Parameters
[in]struct_idFEA Structure ID
Returns
Parent Geom ID

◆ GetFeaSubSurfIDVec()

std::vector< std::string > vsp::GetFeaSubSurfIDVec ( const std::string &  fea_struct_id)

Get the IDs of all FEA SubSurfaces in the given FEA Structure

//==== Add Geometries ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
string struct_id = GetFeaStructID( pod_id, struct_ind );
//==== Add SubSurfaces ====//
string line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY );
string rectangle_id = AddFeaSubSurf( pod_id, struct_ind, SS_RECTANGLE );
array < string > part_id_vec = GetFeaSubSurfIDVec( struct_id ); // Should include line_array_id & rectangle_id
std::vector< std::string > GetFeaSubSurfIDVec(const std::string &fea_struct_id)
See also
NumFeaSubSurfs
Parameters
[in]fea_struct_idFEA Structure ID
Returns
Array of FEA Part IDs

◆ GetFeaSubSurfIndex()

int vsp::GetFeaSubSurfIndex ( const string &  ss_id)

Get the index of an FEA SubSurface give the SubSurface ID

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Add Slice ====//
string slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE );
//==== Add LineArray ====//
string line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY );
//==== Add Rectangle ====//
string rect_id = AddFeaSubSurf( pod_id, struct_ind, SS_RECTANGLE );
if ( 1 != GetFeaSubSurfIndex( rect_id ) ) // These should be equivalent
{
Print( "Error: GetFeaSubSurfIndex" );
}
int GetFeaSubSurfIndex(const string &ss_id)
Parameters
[in]ss_idFEA SubSurface ID
Returns
FEA SubSurface Index

◆ NumFeaParts()

int vsp::NumFeaParts ( const std::string &  fea_struct_id)

Get the number of FEA Parts for a particular FEA Structure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
string struct_id = GetFeaStructID( pod_id, struct_ind );
//==== Add FEA Parts ====//
string slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE );
string dome_id = AddFeaPart( pod_id, struct_ind, FEA_DOME );
if ( NumFeaParts( struct_id ) != 3 ) // Includes FeaSkin
{
Print( "Error: NumFeaParts" );
}
int NumFeaParts(const std::string &fea_struct_id)
See also
GetFeaPartIDVec
Parameters
[in]fea_struct_idFEA Structure ID
Returns
Number of FEA Parts

◆ NumFeaStructures()

int vsp::NumFeaStructures ( )

Get the total number of FEA Subsurfaces in the vehicle

//==== Add Pod Geometry ====//
string wing_id = AddGeom( "WING" );
//==== Add FeaStructure to Pod ====//
int struct_1 = AddFeaStruct( wing_id );
int struct_2 = AddFeaStruct( wing_id );
if ( NumFeaStructures() != 2 )
{
Print( "Error: NumFeaStructures" );
}
int NumFeaStructures()
See also
GetFeaStructIDVec
Returns
Total Number of FEA Structures

◆ NumFeaSubSurfs()

int vsp::NumFeaSubSurfs ( const std::string &  fea_struct_id)

Get the number of FEA Subsurfaces for a particular FEA Structure

//==== Add Pod Geometry ====//
string wing_id = AddGeom( "WING" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( wing_id );
string struct_id = GetFeaStructID( wing_id, struct_ind );
//==== Add SubSurfaces ====//
string line_array_id = AddFeaSubSurf( wing_id, struct_ind, SS_LINE_ARRAY );
string rectangle_id = AddFeaSubSurf( wing_id, struct_ind, SS_RECTANGLE );
if ( NumFeaSubSurfs( struct_id ) != 2 )
{
Print( "Error: NumFeaSubSurfs" );
}
int NumFeaSubSurfs(const std::string &fea_struct_id)
See also
GetFeaSubSurfIDVec
Parameters
[in]fea_struct_idFEA Structure ID
Returns
Number of FEA SubSurfaces

◆ SetFeaMeshFileName()

void vsp::SetFeaMeshFileName ( const std::string &  geom_id,
int  fea_struct_ind,
int  file_type,
const string &  file_name 
)

Set the name of a particular FEA Mesh output file for a specified Structure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
string struct_id = GetFeaStructID( pod_id, struct_ind );
//=== Set Export File Name ===//
string export_name = "FEAMeshTest_calculix.dat";
//==== Get Parent Geom ID and Index ====//
string parent_id = GetFeaStructParentGeomID( struct_id ); // same as pod_id
SetFeaMeshFileName( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME, export_name );
void SetFeaMeshFileName(const std::string &geom_id, int fea_struct_ind, int file_type, const string &file_name)
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index
[in]file_typeFEA output file type enum (i.e. FEA_EXPORT_TYPE)
[in]file_nameName for the output file

◆ SetFeaMeshStructIndex()

void vsp::SetFeaMeshStructIndex ( int  struct_index)

Sets FeaMeshMgr m_FeaMeshStructIndex member using passed in index of a FeaStructure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
SetFeaMeshStructIndex( struct_ind );
if ( FindGeoms().size() != 0 ) { Print( "ERROR: VSPRenew" ); }
void SetFeaMeshStructIndex(int struct_index)
std::vector< std::string > FindGeoms()

◆ SetFeaMeshVal()

void vsp::SetFeaMeshVal ( const std::string &  geom_id,
int  fea_struct_ind,
int  type,
double  val 
)

Set the value of a particular FEA Mesh option for the specified Structure. Note, FEA Mesh makes use of enums initially created for CFD Mesh but not all CFD Mesh options are available for FEA Mesh.

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Adjust FeaMeshSettings ====//
SetFeaMeshVal( pod_id, struct_ind, CFD_MAX_EDGE_LEN, 0.75 );
SetFeaMeshVal( pod_id, struct_ind, CFD_MIN_EDGE_LEN, 0.2 );
@ CFD_MIN_EDGE_LEN
Definition: APIDefines.h:117
@ CFD_MAX_EDGE_LEN
Definition: APIDefines.h:118
void SetFeaMeshVal(const std::string &geom_id, int fea_struct_ind, int type, double val)
See also
CFD_CONTROL_TYPE
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index
[in]typeFEA Mesh option type enum (i.e. CFD_MAX_EDGE_LEN)
[in]valValue the option is set to

◆ SetFeaPartName()

void vsp::SetFeaPartName ( const std::string &  part_id,
const std::string &  name 
)

Set the name of an FEA Part

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Add Bulkead ====//
string bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE );
SetFeaPartName( bulkhead_id, "Bulkhead" );
See also
GetFeaPartName
Parameters
[in]part_idFEA Part ID
[in]nameNew name for the FEA Part

◆ SetFeaPartPerpendicularSparID()

void vsp::SetFeaPartPerpendicularSparID ( const std::string &  part_id,
const std::string &  perpendicular_spar_id 
)

Set the ID of the perpendicular spar for an FEA Rib or Rib Array. Note, the FEA Rib or Rib Array should have "SPAR_NORMAL" set for the "PerpendicularEdgeType" Parm. If it is not, the ID will still be set, but the orientation of the Rib or Rib Array will not change.

//==== Add Wing Geometry ====//
string wing_id = AddGeom( "WING" );
//==== Add FeaStructure to Wing ====//
int struct_ind = AddFeaStruct( wing_id );
//==== Add Rib ====//
string rib_id = AddFeaPart( wing_id, struct_ind, FEA_RIB );
//==== Add Spars ====//
string spar_id_1 = AddFeaPart( wing_id, struct_ind, FEA_SPAR );
string spar_id_2 = AddFeaPart( wing_id, struct_ind, FEA_SPAR );
SetParmVal( FindParm( spar_id_1, "RelCenterLocation", "FeaPart" ), 0.25 );
SetParmVal( FindParm( spar_id_2, "RelCenterLocation", "FeaPart" ), 0.75 );
//==== Set Perpendicular Edge type to SPAR ====//
SetParmVal( FindParm( rib_id, "PerpendicularEdgeType", "FeaRib" ), SPAR_NORMAL );
SetFeaPartPerpendicularSparID( rib_id, spar_id_2 );
if ( spar_id_2 != GetFeaPartPerpendicularSparID( rib_id ) )
{
Print( "Error: SetFeaPartPerpendicularSparID" );
}
See also
FEA_RIB_NORMAL, GetFeaPartPerpendicularSparID
Parameters
[in]part_idFEA Part ID (Rib or Rib Array Type)
[in]perpendicular_spar_idFEA Spar ID

◆ SetFeaStructName()

void vsp::SetFeaStructName ( const std::string &  geom_id,
int  fea_struct_ind,
const std::string &  name 
)

Set the name of an FEA Structure

//==== Add Pod Geometry ====//
string pod_id = AddGeom( "POD" );
//==== Add FeaStructure to Pod ====//
int struct_ind = AddFeaStruct( pod_id );
//==== Change the Structure Name ====//
SetFeaStructName( pod_id, struct_ind, "Example_Struct" );
string parm_container_id = FindContainer( "Example_Struct", struct_ind );
string display_id = string("New Structure Parm Container ID: ") + parm_container_id + string("\n");
Print( display_id );
void SetFeaStructName(const std::string &geom_id, int fea_struct_ind, const std::string &name)
std::string FindContainer(const std::string &name, int index)
See also
GetFeaStructName
Parameters
[in]geom_idstring Parent Geom ID
[in]fea_struct_indFEA Structure index
[in]nameNew name for the FEA Structure