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.
|
Add an FEA Structure to a specified Geom Warning: init_skin should ALWAYS be set to true. |
|
Add an FEA Structure to a Geom and return its ID. |
Sets FeaMeshMgr m_FeaMeshStructIndex member using passed in index of a FeaStructure |
|
|
Choose which structure the FEA Mesh tool works on, by index. |
Get the ID of the FEA Structure that FEA Mesh works on. |
|
|
Set the FEA Structure that FEA Mesh works on, by ID. |
|
Delete an FEA Structure and all FEA Parts and FEA SubSurfaces associated with it |
|
Delete an FEA Structure, by ID. |
|
Get the ID of an FEA Structure |
|
Get the index of an FEA Structure in its Parent Geom's vector of Structures |
|
Get the Parent Geom ID for an FEA Structure |
|
Get the name of an FEA Structure. |
|
Get the name of an FEA Structure, by ID. |
|
Set the name of an FEA Structure |
|
Set the name of an FEA Structure, by ID. |
Get the IDs of all FEA Structures in the vehicle |
|
|
Get the IDs of the FEA Structures of one Geom, in the order of their indexes. |
|
Set the name of an FEA Part |
|
Add an FEA Part to a Structure |
|
Add an FEA Part to a Structure, by Structure ID. |
|
Delete an FEA Part from a Structure |
|
Delete an FEA Part, by ID alone. |
|
Move an FEA part within its structure's part list, the way the move buttons on the Structure tab do. |
|
Move an FEA Part within its Structure's list, by ID alone. |
|
Replace an FEA array part with the individual parts it stands for, the way the Individualize buttons on the array panels do. |
|
Break a rib array, slice array or line array into its individual members, by ID alone. |
|
Get the Parm ID of an FEA Part, identified from a FEA Structure Parm ID and FEA Part index. |
|
Get the name of an FEA Part |
|
Get the type of an FEA Part |
|
Get the IDs of all FEA Parts in the given FEA Structure |
|
Get the IDs of all FEA SubSurfaces in the given FEA Structure |
|
Set the ID of the perpendicular spar for an FEA Rib or Rib Array. |
|
Get the ID of the perpendicular spar for an FEA Rib or Rib Array. |
|
Set the wing section a spar, rib or rib array starts at, by the section's XSec ID. |
|
Get the XSec ID of the wing section a spar, rib or rib array starts at. |
|
Set the wing section a spar, rib or rib array ends at, by the section's XSec ID. |
|
Get the XSec ID of the wing section a spar, rib or rib array ends at. |
|
Set the shell property of an FEA Part or FEA SubSurface, by property ID. |
|
Get the shell property of an FEA Part or FEA SubSurface. |
|
Set the cap (beam) property of an FEA Part or FEA SubSurface, by property ID. |
|
Get the cap (beam) property of an FEA Part or FEA SubSurface. |
|
Set the FEA Part a fixed point lies on. |
|
Get the FEA Part a fixed point lies on. |
|
Set the other Geom a fixed point refers to, or an empty string for none. |
|
Get the other Geom a fixed point refers to. |
|
Set the name of an FEA SubSurface |
|
Set the name of an FEA SubSurface |
|
Add an FEA SubSurface to a Structure |
|
Add an FEA SubSurface to a Structure, by Structure ID. |
|
Delete an FEA SubSurface from a Structure |
|
Delete an FEA SubSurface, by ID alone. |
|
Get the index of an FEA SubSurface give the SubSurface ID |
|
Get the number of points in an FEA Poly Spar. |
|
Add a point to the end of an FEA Poly Spar and return its ID. |
|
Insert a point into an FEA Poly Spar before the given index and return its ID. |
|
Insert a point into an FEA Poly Spar before the point with the given ID and return the new point's ID. |
|
Delete the point at the given index from an FEA Poly Spar. |
|
Delete a point of an FEA Poly Spar, by point ID. |
|
Delete all points from an FEA Poly Spar. |
|
Move a point within an FEA Poly Spar using a reorder type and return the new index of the moved point. |
|
Move a point of an FEA Poly Spar within its list, by point ID, and return its new index. |
|
Set the name of a point in an FEA Poly Spar. |
|
Set the name of a point of an FEA Poly Spar, by point ID. |
|
Get the name of a point in an FEA Poly Spar. |
|
Get the name of a point of an FEA Poly Spar, by point ID. |
|
Get the ID of a point in an FEA Poly Spar. |
|
Get a vector of IDs for all points in an FEA Poly Spar. |
|
Get the total number of FEA Structures in the vehicle |
|
Remove an entry from the list a Trim part trims against |
|
Stop an FEA Part from trimming a Trim part, by the trimming part's ID. |
|
Get the FEA Parts a Trim part trims against |
Add an FEA assembly, which gathers structures together so they can be meshed as one. |
|
|
Delete an FEA Assembly. |
Get the number of FEA Assemblies in the model |
|
Get the IDs of every FEA Assembly in the model |
|
|
Get the name of an FEA Assembly |
|
Set the name of an FEA Assembly. |
|
Add an FEA Structure to an FEA Assembly |
|
Remove an FEA Structure from an FEA Assembly. |
|
Put a structure into an FEA assembly. |
|
Take a structure back out of an FEA assembly. |
|
Get the IDs of the FEA Structures gathered by an FEA Assembly |
|
Connect two FEA Fixed Points, each belonging to a Structure in the assembly, so the Structures are tied together where they meet. |
|
Delete a connection from an FEA Assembly |
|
Delete a connection from an FEA Assembly, by connection ID. |
|
Get the number of connections in an FEA Assembly |
|
Get the ID of one of an assembly's connections, so that its Parms can be reached the way any other container's are. |
|
Get the IDs of the connections of an FEA Assembly, in order. |
|
Get the fixed point at the start of an FEA Assembly connection. |
|
Get the Structure of the fixed point at the start of an FEA Assembly connection. |
|
Get the fixed point at the end of an FEA Assembly connection. |
|
Get the Structure of the fixed point at the end of an FEA Assembly connection. |
|
Mesh and write out an FEA Assembly. |
|
Set the name of an FEA Assembly output file |
|
Mesh an FEA assembly, meshing every structure it holds and joining them at their connections. |
Get the number of FEA structures in the model, counting those on every Geom. |
|
|
Get the number of FEA Parts for a particular FEA Structure |
|
Get the number of FEA Subsurfaces for a particular FEA Structure |
|
Add an FEA BC to a Structure |
|
Delete an FEA BC from a Structure |
|
Return a vector of FEA BC ID's for a structure |
|
Return number of FEA BC's in a structure |
|
Set the FEA Part a part boundary condition applies to. |
|
Get the FEA Part a part boundary condition applies to. |
|
Set the FEA SubSurface a subsurface boundary condition applies to. |
|
Get the FEA SubSurface a subsurface boundary condition applies to. |
|
Add an FEA Material the FEA Mesh material library. |
|
Delete a layer from an FEA laminate material |
|
Move a layer within an FEA laminate's stack, the way the move buttons on the material editor do. |
|
Get the number of layers in an FEA laminate material |
|
Get the IDs of every layer in an FEA laminate material |
|
Set the material of an FEA Layer, by material ID. |
|
Get the material of an FEA Layer. |
Get the IDs of every FEA material, the built in ones as well as any added. |
|
Delete an FEA Material from the FEA Mesh material library. |
|
Add an FEA material to the material library, with default properties. |
|
Add aa FEA Property the FEA Mesh property library. |
|
Delete an FEA Property from the FEA Mesh property library |
|
|
Add an FEA property to the property library. |
|
Set the material of an FEA Property, by material ID. |
|
Get the material of an FEA Property. |
|
Set the value of a particular FEA Mesh option for the specified Structure. |
|
Get an FEA Mesh setting of a Structure, by Structure ID. |
|
Set one of the FEA Mesh settings for a structure. |
|
Set an FEA Mesh setting of a Structure, by Structure ID. |
|
Set the name of a particular FEA Mesh output file for a specified Structure |
|
Get the name of an FEA Mesh output file of a Structure, by Structure ID. |
|
Set the file name an FEA Mesh writes for one export type. |
|
Set the name of an FEA Mesh output file of a Structure, by Structure ID. |
|
Overload 1: |
Details¶
- openvsp.AddFeaStruct(geom_id, init_skin=True, surfindex=0)[source]¶
Add an FEA Structure to a specified Geom Warning: init_skin should ALWAYS be set to true.
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) # The first structure on this Geom lands at index 0, and its ID has to lead # back to that index. assert struct_ind == 0, "AddFeaStruct did not add a structure" assert NumFeaStructures() == 1, "AddFeaStruct did not add a structure" struct_id = GetFeaStructID( pod_id, struct_ind ) assert len( struct_id ) > 0, "AddFeaStruct did not give the structure a usable ID" assert GetFeaStructIndex( struct_id ) == struct_ind, "AddFeaStruct did not give the structure a usable ID" # init_skin defaults to true, so the structure starts with an FEA Skin. assert NumFeaParts( struct_id ) == 1, "AddFeaStruct did not initialize the skin"
See also: AddFeaStructure :param [in]: geom_id string Parent Geom ID :param [in]: init_skin bool Flag to initialize the FEA Structure by creating an FEA Skin from the parent Geom’s OML at surfindex :param [in]: surfindex int Main surface index for the FEA Structure :rtype: int :return: int FEA Structure index
- openvsp.AddFeaStructure(geom_id, init_skin=True, surfindex=0)[source]¶
Add an FEA Structure to a Geom and return its ID.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) assert GetFeaStructID( pod_id, 0 ) == struct_id, "AddFeaStructure did not return the new Structure"
See also: AddFeaStruct, DeleteFeaStruct :param [in]: geom_id string Parent Geom ID :param [in]: init_skin bool Flag to initialize the FEA Skin :param [in]: surfindex int Main surface index for the FEA Structure :rtype: string :return: string FEA Structure ID
- openvsp.GetFeaMeshStructIndex()[source]¶
Sets FeaMeshMgr m_FeaMeshStructIndex member using passed in index of a FeaStructure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) SetFeaMeshStructIndex( struct_ind ) if len(FindGeoms()) != 1 : print( "ERROR: SetFeaMeshStructIndex" ) assert False, "ERROR: SetFeaMeshStructIndex"
Get the index of the FEA Structure the FEA Mesh Manager is currently pointed at
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_ind_2 = AddFeaStruct( pod_id ) SetFeaMeshStructIndex( struct_ind_2 ) assert GetFeaMeshStructIndex() == struct_ind_2, "GetFeaMeshStructIndex did not report the Structure that was set" SetFeaMeshStructIndex( struct_ind ) assert GetFeaMeshStructIndex() == struct_ind, "GetFeaMeshStructIndex did not follow a second set"
See also: SetFeaMeshStructIndex :rtype: int :return: int FEA Structure index
- openvsp.SetFeaMeshStructIndex(struct_index)[source]¶
Choose which structure the FEA Mesh tool works on, by index.
pid = AddGeom( "POD" ) AddFeaStruct( pid ) Update() SetFeaMeshStructIndex( 0 )
See also: AddFeaStruct, NumFeaStructures :param [in]: struct_index int Index of the structure to work on
- openvsp.GetFeaMeshStructID()[source]¶
Get the ID of the FEA Structure that FEA Mesh works on.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) SetFeaMeshStructID( struct_id ) assert GetFeaMeshStructID() == struct_id, "GetFeaMeshStructID did not return the Structure set"
See also: SetFeaMeshStructID, GetFeaMeshStructIndex :rtype: string :return: string FEA Structure ID, or an empty string when no Structure is current
- openvsp.SetFeaMeshStructID(struct_id)[source]¶
Set the FEA Structure that FEA Mesh works on, by ID.
pod_id = AddGeom( "POD" ) AddFeaStruct( pod_id ) struct_id = AddFeaStructure( pod_id ) SetFeaMeshStructID( struct_id ) assert GetFeaMeshStructIndex() == GetFeaStructIndex( struct_id ), "SetFeaMeshStructID did not make the Structure current"
See also: GetFeaMeshStructID, SetFeaMeshStructIndex :param [in]: struct_id string FEA Structure ID
- openvsp.DeleteFeaStruct(geom_id, fea_struct_ind)[source]¶
Delete an FEA Structure and all FEA Parts and FEA SubSurfaces associated with it
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind_1 = AddFeaStruct( pod_id ) struct_ind_2 = AddFeaStruct( pod_id ) struct_id_2 = GetFeaStructID( pod_id, struct_ind_2 ) assert NumFeaStructures() == 2, "the two structures were not both added" DeleteFeaStruct( pod_id, struct_ind_1 ) # Deleting the first structure leaves the second one, which slides down to # take its index. assert NumFeaStructures() == 1, "DeleteFeaStruct did not remove the structure" assert GetFeaStructID( pod_id, 0 ) == struct_id_2, "DeleteFeaStruct removed the wrong structure"
See also: DeleteFeaStructByID :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index
- openvsp.DeleteFeaStructByID(struct_id)[source]¶
Delete an FEA Structure, by ID.
pod_id = AddGeom( "POD" ) struct_id_1 = AddFeaStructure( pod_id ) struct_id_2 = AddFeaStructure( pod_id ) DeleteFeaStructByID( struct_id_1 ) assert list( GetFeaStructIDVecByGeom( pod_id ) ) == [ struct_id_2 ], "DeleteFeaStructByID removed the wrong structure"
See also: AddFeaStructure, GetFeaStructIDVec, DeleteFeaStruct :param [in]: struct_id string FEA Structure ID
- openvsp.GetFeaStructID(geom_id, fea_struct_ind)[source]¶
Get the ID of an FEA Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) assert len( struct_id ) > 0, "GetFeaStructID returned nothing"
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – fea_struct_ind int FEA Structure index
- Return type:
string
- Returns:
string FEA Structure ID
- openvsp.GetFeaStructIndex(struct_id)[source]¶
Get the index of an FEA Structure in its Parent Geom’s vector of Structures
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind_1 = AddFeaStruct( pod_id ) struct_ind_2 = AddFeaStruct( pod_id ) struct_id_2 = GetFeaStructID( pod_id, struct_ind_2 ) DeleteFeaStruct( pod_id, struct_ind_1 ) struct_ind_2_new = GetFeaStructIndex( struct_id_2 ) # The second structure slides down to fill the gap the first one left. assert struct_ind_2 == 1, "GetFeaStructIndex did not follow the delete" assert struct_ind_2_new == 0, "GetFeaStructIndex did not follow the delete" # The index has to lead back to the same structure. assert GetFeaStructID( pod_id, struct_ind_2_new ) == struct_id_2, "GetFeaStructIndex disagrees with GetFeaStructID" # An ID that is not a structure has to report -1. assert GetFeaStructIndex( "NOSUCHSTRUCT" ) == -1, "GetFeaStructIndex accepted a bad ID" # That lookup failure was raised deliberately, so take it back off the queue. err_mgr = ErrorMgrSingleton.getInstance() while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
- Parameters:
[in] – struct_id string FEA Structure ID
- Return type:
int
- Returns:
int FEA Structure index
- openvsp.GetFeaStructParentGeomID(struct_id)[source]¶
Get the Parent Geom ID for an FEA Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Get Parent Geom ID and Index ====// parent_id = GetFeaStructParentGeomID( struct_id ) assert len( parent_id ) > 0, "GetFeaStructParentGeomID returned nothing"
- Parameters:
[in] – struct_id string FEA Structure ID
- Return type:
string
- Returns:
string Parent Geom ID
- openvsp.GetFeaStructName(geom_id, fea_struct_ind)[source]¶
Get the name of an FEA Structure. The FEA Structure name functions as the the Parm Container name
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Get Structure Name ====// parm_container_name = GetFeaStructName( pod_id, struct_ind ) assert len( parm_container_name ) > 0, "GetFeaStructName returned nothing" display_name = "Current Structure Parm Container Name: " + parm_container_name + "\n" print( display_name )
See also: FindContainer, SetFeaStructName, GetFeaStructNameByID :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :rtype: string :return: string Name for the FEA Structure
- openvsp.GetFeaStructNameByID(struct_id)[source]¶
Get the name of an FEA Structure, by ID.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) SetFeaStructNameByID( struct_id, "Spine" ) assert GetFeaStructNameByID( struct_id ) == "Spine", "GetFeaStructNameByID did not return the name set"
See also: SetFeaStructName, GetFeaStructName :param [in]: struct_id string FEA Structure ID :rtype: string :return: string FEA Structure name
- openvsp.SetFeaStructName(geom_id, fea_struct_ind, name)[source]¶
Set the name of an FEA Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Change the Structure Name ====// SetFeaStructName( pod_id, struct_ind, "Example_Struct" ) assert GetFeaStructName( pod_id, struct_ind ) == "Example_Struct", "SetFeaStructName did not take" parm_container_id = FindContainer( "Example_Struct", struct_ind ) display_id = "New Structure Parm Container ID: " + parm_container_id + "\n" print( display_id )
See also: GetFeaStructName, SetFeaStructNameByID :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: name string New name for the FEA Structure
- openvsp.SetFeaStructNameByID(struct_id, name)[source]¶
Set the name of an FEA Structure, by ID.
pod_id = AddGeom( "POD" ) struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) SetFeaStructNameByID( struct_id, "Spine" ) assert GetFeaStructName( pod_id, struct_ind ) == "Spine", "SetFeaStructNameByID did not rename the Structure"
See also: GetFeaStructName, SetFeaStructName :param [in]: struct_id string FEA Structure ID :param [in]: name string New name for the FEA Structure
- openvsp.GetFeaStructIDVec()[source]¶
Get the IDs of all FEA Structures in the vehicle
#==== Add Geometries ====// pod_id = AddGeom( "POD" ) wing_id = AddGeom( "WING" ) #==== Add FeaStructures ====// pod_struct_ind = AddFeaStruct( pod_id ) wing_struct_ind = AddFeaStruct( wing_id ) struct_id_vec = GetFeaStructIDVec() assert len( struct_id_vec ) > 0, "GetFeaStructIDVec returned nothing"
See also: NumFeaStructures, GetFeaStructIDVecByGeom :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of FEA Structure IDs
- openvsp.GetFeaStructIDVecByGeom(geom_id)[source]¶
Get the IDs of the FEA Structures of one Geom, in the order of their indexes.
pod_id = AddGeom( "POD" ) other_id = AddGeom( "POD" ) AddFeaStruct( other_id ) struct_id = AddFeaStructure( pod_id ) assert list( GetFeaStructIDVecByGeom( pod_id ) ) == [ struct_id ], "GetFeaStructIDVecByGeom did not return the Geom's Structures"
See also: GetFeaStructID, AddFeaStructure, GetFeaStructIDVec :param [in]: geom_id string Parent Geom ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of FEA Structure IDs
- openvsp.SetFeaPartName(part_id, name)[source]¶
Set the name of an FEA Part
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add Bulkead ====// bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) SetFeaPartName( bulkhead_id, "Bulkhead" ) assert GetFeaPartName( bulkhead_id ) == "Bulkhead", "SetFeaPartName did not take"
See also: GetFeaPartName :param [in]: part_id string FEA Part ID :param [in]: name string New name for the FEA Part
- openvsp.AddFeaPart(geom_id, fea_struct_ind, type)[source]¶
Add an FEA Part to a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add Bulkead ====// 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 )
See also: FEA_PART_TYPE, AddFeaPartByID :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: type int FEA Part type enum (i.e. FEA_RIB) :rtype: string :return: string FEA Part ID
- openvsp.AddFeaPartByID(struct_id, type)[source]¶
Add an FEA Part to a Structure, by Structure ID.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) slice_id = AddFeaPartByID( struct_id, FEA_SLICE ) assert GetFeaPartType( slice_id ) == FEA_SLICE, "AddFeaPartByID did not add a slice"
See also: FEA_PART_TYPE, AddFeaPart :param [in]: struct_id string FEA Structure ID :param [in]: type int FEA Part type enum (i.e. FEA_RIB) :rtype: string :return: string FEA Part ID
- openvsp.DeleteFeaPart(geom_id, fea_struct_ind, part_id)[source]¶
Delete an FEA Part from a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add Bulkead ====// bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) #==== Add Fixed Point ====// fixed_id = AddFeaPart( pod_id, struct_ind, FEA_FIX_POINT ) struct_id = GetFeaStructID( pod_id, struct_ind ) # The skin, the bulkhead and the fixed point. num_before = NumFeaParts( struct_id ) assert num_before == 3, "the parts were not all added" #==== Delete Bulkead ====// DeleteFeaPart( pod_id, struct_ind, bulkhead_id ) # Only the named part goes; the fixed point stays. assert NumFeaParts( struct_id ) == num_before - 1, "DeleteFeaPart did not remove the part" assert len( GetFeaPartName( fixed_id ) ) > 0, "DeleteFeaPart removed the wrong part"
See also: DeleteFeaPartByID :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: part_id string FEA Part ID
- openvsp.DeleteFeaPartByID(part_id)[source]¶
Delete an FEA Part, by ID alone.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) slice_id = AddFeaPartByID( struct_id, FEA_SLICE ) n = NumFeaParts( struct_id ) DeleteFeaPartByID( slice_id ) assert NumFeaParts( struct_id ) == n - 1, "DeleteFeaPartByID did not remove the part"
See also: AddFeaPart, GetFeaPartIDVec, DeleteFeaPart :param [in]: part_id string FEA Part ID
- openvsp.ReorderFeaPart(geom_id, fea_struct_ind, part_id, reorder_type)[source]¶
Move an FEA part within its structure’s part list, the way the move buttons on the Structure tab do. Parts are meshed in list order, so where a part sits decides which of two intersecting parts is trimmed by the other.
pod_id = AddGeom( "POD", "" ) struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) bulkhead = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) skin = GetFeaPartID( struct_id, 0 ) ReorderFeaPart( pod_id, struct_ind, bulkhead, REORDER_MOVE_TOP ) assert GetFeaPartID( struct_id, 0 ) == bulkhead, "ReorderFeaPart did not move the part" ReorderFeaPart( pod_id, struct_ind, bulkhead, REORDER_MOVE_BOTTOM ) assert GetFeaPartID( struct_id, 0 ) == skin, "ReorderFeaPart did not move the part back"
See also: AddFeaPart, DeleteFeaPart, GetFeaPartIDVec, ReorderFeaPartByID :param [in]: geom_id string Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: part_id string FEA Part ID :param [in]: reorder_type int Reorder type enum (see REORDER_TYPE)
- openvsp.ReorderFeaPartByID(part_id, reorder_type)[source]¶
Move an FEA Part within its Structure’s list, by ID alone.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) slice_id = AddFeaPartByID( struct_id, FEA_SLICE ) ReorderFeaPartByID( slice_id, REORDER_MOVE_TOP ) assert GetFeaPartID( struct_id, 0 ) == slice_id, "ReorderFeaPartByID did not move the part to the top"
See also: REORDER_TYPE, ReorderFeaPart :param [in]: part_id string FEA Part ID :param [in]: reorder_type int Reorder type enum (i.e. REORDER_MOVE_UP)
- openvsp.IndividualizeFeaPart(geom_id, fea_struct_ind, part_id)[source]¶
Replace an FEA array part with the individual parts it stands for, the way the Individualize buttons on the array panels do. A rib array, slice array or SSLine array is a compact way of laying down a regular set of parts; individualizing turns it into that set, so each one can then be edited on its own. The array part itself goes away.
pod_id = AddGeom( "POD", "" ) struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) array_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE_ARRAY ) SetParmVal( FindParm( array_id, "SliceRelSpacing", "FeaSliceArray" ), 0.25 ) Update() num_before = NumFeaParts( struct_id ) IndividualizeFeaPart( pod_id, struct_ind, array_id ) # The array is replaced by the slices it stood for, so the part count goes up. assert NumFeaParts( struct_id ) > num_before, "IndividualizeFeaPart did not expand the array"
See also: AddFeaPart, AddFeaSubSurf, NumFeaParts, IndividualizeFeaPartByID :param [in]: geom_id string Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: part_id string FEA Part or FEA Sub-Surface ID of an array part
- openvsp.IndividualizeFeaPartByID(part_id)[source]¶
Break a rib array, slice array or line array into its individual members, by ID alone.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) array_id = AddFeaPartByID( struct_id, FEA_SLICE_ARRAY ) n = NumFeaParts( struct_id ) IndividualizeFeaPartByID( array_id ) assert NumFeaParts( struct_id ) > n, "IndividualizeFeaPartByID did not break up the array"
See also: AddFeaPart, IndividualizeFeaPart :param [in]: part_id string FEA Part ID of a rib array, slice array or line array
- openvsp.GetFeaPartID(fea_struct_id, fea_part_index)[source]¶
Get the Parm ID of an FEA Part, identified from a FEA Structure Parm ID and FEA Part index.
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Add Bulkead ====// bulkhead_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) Update() if bulkhead_id != GetFeaPartID( struct_id, 1 ) : # These should be equivalent (index 0 is skin) print( "Error: GetFeaPartID" ) assert False, "Error: GetFeaPartID"
- Parameters:
[in] – fea_struct_id string FEA Structure ID
[in] – fea_part_index int FEA Part index
- Return type:
string
- Returns:
string FEA Part ID
- openvsp.GetFeaPartName(part_id)[source]¶
Get the name of an FEA Part
#==== Add Fuselage Geometry ====// fuse_id = AddGeom( "FUSELAGE" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( fuse_id ) #==== Add Bulkead ====// bulkhead_id = AddFeaPart( fuse_id, struct_ind, FEA_SLICE ) name = "example_name" SetFeaPartName( bulkhead_id, name ) if name != GetFeaPartName( bulkhead_id ) : # These should be equivalent print( "Error: GetFeaPartName" ) assert False, "Error: GetFeaPartName"
See also: SetFeaPartName :param [in]: part_id string FEA Part ID :rtype: string :return: string FEA Part name
- openvsp.GetFeaPartType(part_id)[source]¶
Get the type of an FEA Part
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add Slice ====// slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) if FEA_SLICE != GetFeaPartType( slice_id ) : # These should be equivalent print( "Error: GetFeaPartType" ) assert False, "Error: GetFeaPartType"
See also: FEA_PART_TYPE :param [in]: part_id string FEA Part ID :rtype: int :return: int FEA Part type enum
- openvsp.GetFeaPartIDVec(fea_struct_id)[source]¶
Get the IDs of all FEA Parts in the given FEA Structure
#==== Add Geometries ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Add FEA Parts ====// slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) dome_id = AddFeaPart( pod_id, struct_ind, FEA_DOME ) part_id_vec = GetFeaPartIDVec( struct_id ) # Should include slice_id & dome_id assert len( part_id_vec ) > 0, "GetFeaPartIDVec returned nothing"
See also: NumFeaParts :param [in]: fea_struct_id string FEA Structure ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of FEA Part IDs
- openvsp.GetFeaSubSurfIDVec(fea_struct_id)[source]¶
Get the IDs of all FEA SubSurfaces in the given FEA Structure
#==== Add Geometries ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Add SubSurfaces ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) rectangle_id = AddFeaSubSurf( pod_id, struct_ind, SS_RECTANGLE ) part_id_vec = GetFeaSubSurfIDVec( struct_id ) # Should include line_array_id & rectangle_id assert len( part_id_vec ) > 0, "GetFeaSubSurfIDVec returned nothing"
See also: NumFeaSubSurfs :param [in]: fea_struct_id string FEA Structure ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of FEA Part IDs
- openvsp.SetFeaPartPerpendicularSparID(part_id, perpendicular_spar_id)[source]¶
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 ====// wing_id = AddGeom( "WING" ) #==== Add FeaStructure to Wing ====// struct_ind = AddFeaStruct( wing_id ) #==== Add Rib ====// rib_id = AddFeaPart( wing_id, struct_ind, FEA_RIB ) #==== Add Spars ====// spar_id_1 = AddFeaPart( wing_id, struct_ind, FEA_SPAR ) 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" ) assert False, "Error: SetFeaPartPerpendicularSparID"
See also: FEA_RIB_NORMAL, GetFeaPartPerpendicularSparID :param [in]: part_id string FEA Part ID (Rib or Rib Array Type) :param [in]: perpendicular_spar_id string FEA Spar ID
- openvsp.GetFeaPartPerpendicularSparID(part_id)[source]¶
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 ====// wing_id = AddGeom( "WING" ) #==== Add FeaStructure to Wing ====// struct_ind = AddFeaStruct( wing_id ) #==== Add Rib ====// rib_id = AddFeaPart( wing_id, struct_ind, FEA_RIB ) #==== Add Spars ====// spar_id_1 = AddFeaPart( wing_id, struct_ind, FEA_SPAR ) 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" ) assert False, "Error: GetFeaPartPerpendicularSparID"
See also: FEA_RIB_NORMAL, SetFeaPartPerpendicularSparID :param [in]: part_id string FEA Part ID (Rib or Rib Array Type) :rtype: string :return: string Perpendicular FEA Spar ID
- openvsp.SetFeaPartStartWingSectionID(part_id, xsec_id)[source]¶
Set the wing section a spar, rib or rib array starts at, by the section’s XSec ID.
wing_id = AddGeom( "WING" ) InsertXSec( wing_id, 1, XS_FOUR_SERIES ) xsec_surf = GetXSecSurf( wing_id, 0 ) struct_id = AddFeaStructure( wing_id ) spar_id = AddFeaPartByID( struct_id, FEA_SPAR ) SetFeaPartStartWingSectionID( spar_id, GetXSec( xsec_surf, 1 ) ) assert GetFeaPartStartWingSectionID( spar_id ) == GetXSec( xsec_surf, 1 ), "SetFeaPartStartWingSectionID did not set the section"
See also: GetFeaPartStartWingSectionID :param [in]: part_id string FEA spar, rib or rib array ID :param [in]: xsec_id string XSec ID of a section of the part’s wing
- openvsp.GetFeaPartStartWingSectionID(part_id)[source]¶
Get the XSec ID of the wing section a spar, rib or rib array starts at.
wing_id = AddGeom( "WING" ) InsertXSec( wing_id, 1, XS_FOUR_SERIES ) xsec_surf = GetXSecSurf( wing_id, 0 ) struct_id = AddFeaStructure( wing_id ) spar_id = AddFeaPartByID( struct_id, FEA_SPAR ) assert GetFeaPartStartWingSectionID( spar_id ) == GetXSec( xsec_surf, 1 ), "GetFeaPartStartWingSectionID did not return the first section"
See also: SetFeaPartStartWingSectionID :param [in]: part_id string FEA spar, rib or rib array ID :rtype: string :return: string XSec ID
- openvsp.SetFeaPartEndWingSectionID(part_id, xsec_id)[source]¶
Set the wing section a spar, rib or rib array ends at, by the section’s XSec ID.
wing_id = AddGeom( "WING" ) InsertXSec( wing_id, 1, XS_FOUR_SERIES ) xsec_surf = GetXSecSurf( wing_id, 0 ) struct_id = AddFeaStructure( wing_id ) spar_id = AddFeaPartByID( struct_id, FEA_SPAR ) SetFeaPartEndWingSectionID( spar_id, GetXSec( xsec_surf, 2 ) ) assert GetFeaPartEndWingSectionID( spar_id ) == GetXSec( xsec_surf, 2 ), "SetFeaPartEndWingSectionID did not set the section"
See also: GetFeaPartEndWingSectionID :param [in]: part_id string FEA spar, rib or rib array ID :param [in]: xsec_id string XSec ID of a section of the part’s wing
- openvsp.GetFeaPartEndWingSectionID(part_id)[source]¶
Get the XSec ID of the wing section a spar, rib or rib array ends at.
wing_id = AddGeom( "WING" ) InsertXSec( wing_id, 1, XS_FOUR_SERIES ) xsec_surf = GetXSecSurf( wing_id, 0 ) struct_id = AddFeaStructure( wing_id ) spar_id = AddFeaPartByID( struct_id, FEA_SPAR ) assert GetFeaPartEndWingSectionID( spar_id ) == GetXSec( xsec_surf, 1 ), "GetFeaPartEndWingSectionID did not return the first section"
See also: SetFeaPartEndWingSectionID :param [in]: part_id string FEA spar, rib or rib array ID :rtype: string :return: string XSec ID
- openvsp.SetFeaPartPropertyID(part_id, property_id)[source]¶
Set the shell property of an FEA Part or FEA SubSurface, by property ID.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) slice_id = AddFeaPartByID( struct_id, FEA_SLICE ) prop_id = AddFeaProperty( FEA_SHELL ) SetFeaPartPropertyID( slice_id, prop_id ) assert GetFeaPartPropertyID( slice_id ) == prop_id, "SetFeaPartPropertyID did not set the property"
See also: GetFeaPartPropertyID, SetFeaPartCapPropertyID :param [in]: part_id string FEA Part or FEA SubSurface ID :param [in]: property_id string FEA Property ID
- openvsp.GetFeaPartPropertyID(part_id)[source]¶
Get the shell property of an FEA Part or FEA SubSurface.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) line_id = AddFeaSubSurfByID( struct_id, SS_LINE ) prop_id = AddFeaProperty( FEA_SHELL ) SetFeaPartPropertyID( line_id, prop_id ) assert GetFeaPartPropertyID( line_id ) == prop_id, "GetFeaPartPropertyID did not return the property set"
See also: SetFeaPartPropertyID :param [in]: part_id string FEA Part or FEA SubSurface ID :rtype: string :return: string FEA Property ID
- openvsp.SetFeaPartCapPropertyID(part_id, property_id)[source]¶
Set the cap (beam) property of an FEA Part or FEA SubSurface, by property ID.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) slice_id = AddFeaPartByID( struct_id, FEA_SLICE ) prop_id = AddFeaProperty( FEA_BEAM ) SetFeaPartCapPropertyID( slice_id, prop_id ) assert GetFeaPartCapPropertyID( slice_id ) == prop_id, "SetFeaPartCapPropertyID did not set the property"
See also: GetFeaPartCapPropertyID, SetFeaPartPropertyID :param [in]: part_id string FEA Part or FEA SubSurface ID :param [in]: property_id string FEA Property ID
- openvsp.GetFeaPartCapPropertyID(part_id)[source]¶
Get the cap (beam) property of an FEA Part or FEA SubSurface.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) line_id = AddFeaSubSurfByID( struct_id, SS_LINE ) prop_id = AddFeaProperty( FEA_BEAM ) SetFeaPartCapPropertyID( line_id, prop_id ) assert GetFeaPartCapPropertyID( line_id ) == prop_id, "GetFeaPartCapPropertyID did not return the property set"
See also: SetFeaPartCapPropertyID :param [in]: part_id string FEA Part or FEA SubSurface ID :rtype: string :return: string FEA Property ID
- openvsp.SetFeaFixPointParentID(fixpt_id, part_id)[source]¶
Set the FEA Part a fixed point lies on. The part must be a surface in the fixed point’s Structure.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) slice_id = AddFeaPartByID( struct_id, FEA_SLICE ) fixpt_id = AddFeaPartByID( struct_id, FEA_FIX_POINT ) SetFeaFixPointParentID( fixpt_id, slice_id ) assert GetFeaFixPointParentID( fixpt_id ) == slice_id, "SetFeaFixPointParentID did not set the parent"
See also: GetFeaFixPointParentID :param [in]: fixpt_id string FEA Fixed Point ID :param [in]: part_id string FEA Part ID of the surface the point lies on
- openvsp.GetFeaFixPointParentID(fixpt_id)[source]¶
Get the FEA Part a fixed point lies on.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) fixpt_id = AddFeaPartByID( struct_id, FEA_FIX_POINT ) # A new fixed point lies on the skin, the Structure's first part. assert GetFeaFixPointParentID( fixpt_id ) == GetFeaPartID( struct_id, 0 ), "GetFeaFixPointParentID did not return the skin"
See also: SetFeaFixPointParentID :param [in]: fixpt_id string FEA Fixed Point ID :rtype: string :return: string FEA Part ID
- openvsp.SetFeaFixPointOtherGeomID(fixpt_id, geom_id)[source]¶
Set the other Geom a fixed point refers to, or an empty string for none.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) other_id = AddGeom( "POD" ) fixpt_id = AddFeaPartByID( struct_id, FEA_FIX_POINT ) SetFeaFixPointOtherGeomID( fixpt_id, other_id ) assert GetFeaFixPointOtherGeomID( fixpt_id ) == other_id, "SetFeaFixPointOtherGeomID did not set the Geom"
See also: GetFeaFixPointOtherGeomID :param [in]: fixpt_id string FEA Fixed Point ID :param [in]: geom_id string Geom ID, or an empty string
- openvsp.GetFeaFixPointOtherGeomID(fixpt_id)[source]¶
Get the other Geom a fixed point refers to.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) fixpt_id = AddFeaPartByID( struct_id, FEA_FIX_POINT ) assert GetFeaFixPointOtherGeomID( fixpt_id ) == "", "a new fixed point refers to another Geom"
See also: SetFeaFixPointOtherGeomID :param [in]: fixpt_id string FEA Fixed Point ID :rtype: string :return: string Geom ID, or an empty string for none
- openvsp.SetFeaSubSurfName(subsurf_id, name)[source]¶
Set the name of an FEA SubSurface
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add LineArray ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) SetFeaSubSurfName( line_array_id, "Stiffener_array" ) assert GetFeaSubSurfName( line_array_id ) == "Stiffener_array", "SetFeaSubSurfName did not take"
- Parameters:
[in] – subsurf_id string FEA SubSurface ID
[in] – name string New name for the FEA SubSurface
- openvsp.GetFeaSubSurfName(subsurf_id)[source]¶
Set the name of an FEA SubSurface
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add LineArray ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) name = "example_name" SetFeaSubSurfName( line_array_id, name ) if name != GetFeaSubSurfName( line_array_id ) : # These should be equivalent print( "Error: GetFeaSubSurfName" ) assert False, "Error: GetFeaSubSurfName"
- Parameters:
[in] – subsurf_id string FEA SubSurface ID
- Return type:
string
- Returns:
string FEA SubSurf name
- openvsp.AddFeaSubSurf(geom_id, fea_struct_ind, type)[source]¶
Add an FEA SubSurface to a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add LineArray ====// 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 )
See also: SUBSURF_TYPE, AddFeaSubSurfByID :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: type int FEA SubSurface type enum (i.e. SS_ELLIPSE) :rtype: string :return: string FEA SubSurface ID
- openvsp.AddFeaSubSurfByID(struct_id, type)[source]¶
Add an FEA SubSurface to a Structure, by Structure ID.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) line_id = AddFeaSubSurfByID( struct_id, SS_LINE ) assert list( GetFeaSubSurfIDVec( struct_id ) ) == [ line_id ], "AddFeaSubSurfByID did not add the line"
See also: SUBSURF_TYPE, AddFeaSubSurf :param [in]: struct_id string FEA Structure ID :param [in]: type int FEA SubSurface type enum (i.e. SS_ELLIPSE) :rtype: string :return: string FEA SubSurface ID
- openvsp.DeleteFeaSubSurf(geom_id, fea_struct_ind, ss_id)[source]¶
Delete an FEA SubSurface from a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add LineArray ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) #==== Add Rectangle ====// rect_id = AddFeaSubSurf( pod_id, struct_ind, SS_RECTANGLE ) struct_id = GetFeaStructID( pod_id, struct_ind ) num_before = NumFeaSubSurfs( struct_id ) #==== Delete LineArray ====// DeleteFeaSubSurf( pod_id, struct_ind, line_array_id ) assert NumFeaSubSurfs( struct_id ) == num_before - 1, "DeleteFeaSubSurf did not remove the sub-surface"
See also: DeleteFeaSubSurfByID :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: ss_id string FEA SubSurface ID
- openvsp.DeleteFeaSubSurfByID(ss_id)[source]¶
Delete an FEA SubSurface, by ID alone.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) line_id = AddFeaSubSurfByID( struct_id, SS_LINE ) DeleteFeaSubSurfByID( line_id ) assert NumFeaSubSurfs( struct_id ) == 0, "DeleteFeaSubSurfByID did not remove the line"
See also: AddFeaSubSurf, GetFeaSubSurfIDVec, DeleteFeaSubSurf :param [in]: ss_id string FEA SubSurface ID
- openvsp.GetFeaSubSurfIndex(ss_id)[source]¶
Get the index of an FEA SubSurface give the SubSurface ID
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) #==== Add Slice ====// slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) #==== Add LineArray ====// line_array_id = AddFeaSubSurf( pod_id, struct_ind, SS_LINE_ARRAY ) #==== Add Rectangle ====// rect_id = AddFeaSubSurf( pod_id, struct_ind, SS_RECTANGLE ) if 1 != GetFeaSubSurfIndex( rect_id ) : # These should be equivalent print( "Error: GetFeaSubSurfIndex" ) assert False, "Error: GetFeaSubSurfIndex"
- Parameters:
[in] – ss_id string FEA SubSurface ID
- Return type:
int
- Returns:
int FEA SubSurface Index
- openvsp.GetFeaPolySparNumPt(pspar_id)[source]¶
Get the number of points in an FEA Poly Spar. A newly created Poly Spar contains two points (the inboard and outboard endpoints).
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) # A new Poly Spar starts with 2 points if GetFeaPolySparNumPt( pspar_id ) != 2: print( "Error: GetFeaPolySparNumPt" ) assert False, "Error: GetFeaPolySparNumPt"
See also: AddFeaPolySparPt, InsertFeaPolySparPt, DelFeaPolySparPt, DelAllFeaPolySparPt :param [in]: pspar_id string FEA Poly Spar part ID :rtype: int :return: int Number of points in the Poly Spar
- openvsp.AddFeaPolySparPt(pspar_id)[source]¶
Add a point to the end of an FEA Poly Spar and return its ID. The new point is appended after all existing points.
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) pt_id = AddFeaPolySparPt( pspar_id ) if GetFeaPolySparNumPt( pspar_id ) != 3: print( "Error: AddFeaPolySparPt" ) assert False, "Error: AddFeaPolySparPt"
See also: InsertFeaPolySparPt, DelFeaPolySparPt, GetFeaPolySparNumPt :param [in]: pspar_id string FEA Poly Spar part ID :rtype: string :return: string ID of the newly added Poly Spar point
- openvsp.InsertFeaPolySparPt(pspar_id, index)[source]¶
Insert a point into an FEA Poly Spar before the given index and return its ID.
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) # Insert a new intermediate point between the two default endpoints pt_id = InsertFeaPolySparPt( pspar_id, 1 ) if GetFeaPolySparNumPt( pspar_id ) != 3: print( "Error: InsertFeaPolySparPt" ) assert False, "Error: InsertFeaPolySparPt"
See also: AddFeaPolySparPt, DelFeaPolySparPt, GetFeaPolySparNumPt, InsertFeaPolySparPtByID :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: index int Index before which the new point is inserted :rtype: string :return: string ID of the newly inserted Poly Spar point
- openvsp.InsertFeaPolySparPtByID(pspar_id, before_pt_id)[source]¶
Insert a point into an FEA Poly Spar before the point with the given ID and return the new point’s ID.
wing_id = AddGeom( "WING" ) struct_id = AddFeaStructure( wing_id ) pspar_id = AddFeaPartByID( struct_id, FEA_POLY_SPAR ) # A new Poly Spar has two points, root and tip pts = GetAllFeaPolySparPtIDVec( pspar_id ) pt_id = InsertFeaPolySparPtByID( pspar_id, pts[1] ) assert GetFeaPolySparPtID( pspar_id, 1 ) == pt_id, "InsertFeaPolySparPtByID did not put the point before the tip"
See also: AddFeaPolySparPt, DelFeaPolySparPt, InsertFeaPolySparPt :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: before_pt_id string ID of the point the new point goes before :rtype: string :return: string ID of the newly inserted Poly Spar point
- openvsp.DelFeaPolySparPt(pspar_id, index)[source]¶
Delete the point at the given index from an FEA Poly Spar.
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) AddFeaPolySparPt( pspar_id ) AddFeaPolySparPt( pspar_id ) # Delete the point at index 2 (leaving 3 points) DelFeaPolySparPt( pspar_id, 2 ) if GetFeaPolySparNumPt( pspar_id ) != 3: print( "Error: DelFeaPolySparPt" ) assert False, "Error: DelFeaPolySparPt"
See also: DelAllFeaPolySparPt, AddFeaPolySparPt, GetFeaPolySparNumPt, DelFeaPolySparPtByID :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: index int Index of the point to delete
- openvsp.DelFeaPolySparPtByID(pspar_id, pt_id)[source]¶
Delete a point of an FEA Poly Spar, by point ID.
wing_id = AddGeom( "WING" ) struct_id = AddFeaStructure( wing_id ) pspar_id = AddFeaPartByID( struct_id, FEA_POLY_SPAR ) # A new Poly Spar has two points, root and tip pts = GetAllFeaPolySparPtIDVec( pspar_id ) pt_id = InsertFeaPolySparPtByID( pspar_id, pts[1] ) DelFeaPolySparPtByID( pspar_id, pt_id ) assert GetFeaPolySparNumPt( pspar_id ) == 2, "DelFeaPolySparPtByID did not remove the point"
See also: InsertFeaPolySparPt, DelFeaPolySparPt :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: pt_id string ID of the point to delete
- openvsp.DelAllFeaPolySparPt(pspar_id)[source]¶
Delete all points from an FEA Poly Spar.
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) AddFeaPolySparPt( pspar_id ) AddFeaPolySparPt( pspar_id ) DelAllFeaPolySparPt( pspar_id ) if GetFeaPolySparNumPt( pspar_id ) != 0: print( "Error: DelAllFeaPolySparPt" ) assert False, "Error: DelAllFeaPolySparPt"
See also: DelFeaPolySparPt, AddFeaPolySparPt, GetFeaPolySparNumPt :param [in]: pspar_id string FEA Poly Spar part ID
- openvsp.MoveFeaPolySparPt(pspar_id, index, reorder_type)[source]¶
Move a point within an FEA Poly Spar using a reorder type and return the new index of the moved point.
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) AddFeaPolySparPt( pspar_id ) # Move point at index 2 up one position new_index = MoveFeaPolySparPt( pspar_id, 2, REORDER_MOVE_UP ) if new_index != 1: print( "Error: MoveFeaPolySparPt" ) assert False, "Error: MoveFeaPolySparPt"
See also: REORDER_TYPE, AddFeaPolySparPt, GetFeaPolySparNumPt, MoveFeaPolySparPtByID :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: index int Index of the point to move :param [in]: reorder_type int Reorder type enum (i.e. REORDER_MOVE_UP, REORDER_MOVE_DOWN, REORDER_MOVE_TOP, REORDER_MOVE_BOTTOM) :rtype: int :return: int New index of the moved point
- openvsp.MoveFeaPolySparPtByID(pspar_id, pt_id, reorder_type)[source]¶
Move a point of an FEA Poly Spar within its list, by point ID, and return its new index.
wing_id = AddGeom( "WING" ) struct_id = AddFeaStructure( wing_id ) pspar_id = AddFeaPartByID( struct_id, FEA_POLY_SPAR ) # A new Poly Spar has two points, root and tip pts = GetAllFeaPolySparPtIDVec( pspar_id ) index = MoveFeaPolySparPtByID( pspar_id, pts[1], REORDER_MOVE_TOP ) assert index == 0 and GetFeaPolySparPtID( pspar_id, 0 ) == pts[1], "MoveFeaPolySparPtByID did not move the point to the top"
See also: REORDER_TYPE, MoveFeaPolySparPt :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: pt_id string ID of the point to move :param [in]: reorder_type int Reorder type enum (i.e. REORDER_MOVE_UP) :rtype: int :return: int New index of the point
- openvsp.SetFeaPolySparPtName(pspar_id, index, name)[source]¶
Set the name of a point in an FEA Poly Spar.
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) SetFeaPolySparPtName( pspar_id, 0, "InboardPt" ) SetFeaPolySparPtName( pspar_id, 1, "OutboardPt" ) if GetFeaPolySparPtName( pspar_id, 0 ) != "InboardPt": print( "Error: SetFeaPolySparPtName" ) assert False, "Error: SetFeaPolySparPtName"
See also: GetFeaPolySparPtName, SetFeaPolySparPtNameByID :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: index int Index of the point :param [in]: name string New name for the point
- openvsp.SetFeaPolySparPtNameByID(pspar_id, pt_id, name)[source]¶
Set the name of a point of an FEA Poly Spar, by point ID.
wing_id = AddGeom( "WING" ) struct_id = AddFeaStructure( wing_id ) pspar_id = AddFeaPartByID( struct_id, FEA_POLY_SPAR ) # A new Poly Spar has two points, root and tip pts = GetAllFeaPolySparPtIDVec( pspar_id ) SetFeaPolySparPtNameByID( pspar_id, pts[1], "Tip" ) assert GetFeaPolySparPtName( pspar_id, 1 ) == "Tip", "SetFeaPolySparPtNameByID did not name the point"
See also: GetFeaPolySparPtName, SetFeaPolySparPtName :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: pt_id string Point ID :param [in]: name string New name for the point
- openvsp.GetFeaPolySparPtName(pspar_id, index)[source]¶
Get the name of a point in an FEA Poly Spar.
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) SetFeaPolySparPtName( pspar_id, 0, "InboardPt" ) name = GetFeaPolySparPtName( pspar_id, 0 ) assert len( name ) > 0, "GetFeaPolySparPtName returned nothing" print( "Point 0 name: " + name )
See also: SetFeaPolySparPtName, GetFeaPolySparPtNameByID :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: index int Index of the point :rtype: string :return: string Name of the point
- openvsp.GetFeaPolySparPtNameByID(pspar_id, pt_id)[source]¶
Get the name of a point of an FEA Poly Spar, by point ID.
wing_id = AddGeom( "WING" ) struct_id = AddFeaStructure( wing_id ) pspar_id = AddFeaPartByID( struct_id, FEA_POLY_SPAR ) # A new Poly Spar has two points, root and tip pts = GetAllFeaPolySparPtIDVec( pspar_id ) SetFeaPolySparPtName( pspar_id, 0, "Root" ) assert GetFeaPolySparPtNameByID( pspar_id, pts[0] ) == "Root", "GetFeaPolySparPtNameByID did not return the name set"
See also: SetFeaPolySparPtName, GetFeaPolySparPtName :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: pt_id string Point ID :rtype: string :return: string Name of the point
- openvsp.GetFeaPolySparPtID(pspar_id, index)[source]¶
Get the ID of a point in an FEA Poly Spar. The returned ID is a ParmContainer ID that can be used with FindParm to access the point’s parameters such as Eta, U01, U0N, and XoC.
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) pt_id = GetFeaPolySparPtID( pspar_id, 0 ) assert len( pt_id ) > 0, "GetFeaPolySparPtID returned nothing" # Set the spanwise location of the inboard point to eta = 0.1 SetParmVal( FindParm( pt_id, "Eta", "FeaPolySparPoint" ), 0.1 ) pt_id_1 = GetFeaPolySparPtID( pspar_id, 1 ) # Set the spanwise location of the outboard point to eta = 0.9 SetParmVal( FindParm( pt_id_1, "Eta", "FeaPolySparPoint" ), 0.9 )
See also: GetAllFeaPolySparPtIDVec, FindParm, SetParmVal :param [in]: pspar_id string FEA Poly Spar part ID :param [in]: index int Index of the point :rtype: string :return: string ID of the Poly Spar point ParmContainer
- openvsp.GetAllFeaPolySparPtIDVec(pspar_id)[source]¶
Get a vector of IDs for all points in an FEA Poly Spar. Each ID is a ParmContainer ID that can be used with FindParm to access the point’s parameters such as Eta, U01, U0N, and XoC.
wing_id = AddGeom( "WING" ) struct_ind = AddFeaStruct( wing_id ) pspar_id = AddFeaPart( wing_id, struct_ind, FEA_POLY_SPAR ) AddFeaPolySparPt( pspar_id ) pt_ids = GetAllFeaPolySparPtIDVec( pspar_id ) if len( pt_ids ) != 3: print( "Error: GetAllFeaPolySparPtIDVec" ) assert False, "Error: GetAllFeaPolySparPtIDVec" # Set each point's spanwise eta location SetParmVal( FindParm( pt_ids[0], "Eta", "FeaPolySparPoint" ), 0.1 ) SetParmVal( FindParm( pt_ids[1], "Eta", "FeaPolySparPoint" ), 0.5 ) SetParmVal( FindParm( pt_ids[2], "Eta", "FeaPolySparPoint" ), 0.9 )
See also: GetFeaPolySparPtID, FindParm, SetParmVal :param [in]: pspar_id string FEA Poly Spar part ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector <string> Vector of Poly Spar point ParmContainer IDs
- openvsp.AddFeaTrimPart(trim_id, part_id)[source]¶
Get the total number of FEA Structures in the vehicle
#==== Add Pod Geometry ====// wing_id = AddGeom( "WING" ) #==== Add FeaStructure to Pod ====// struct_1 = AddFeaStruct( wing_id ) struct_2 = AddFeaStruct( wing_id ) if NumFeaStructures() != 2 : print( "Error: NumFeaStructures" ) assert False, "Error: NumFeaStructures"
See also: GetFeaStructIDVec :rtype: void :return: int Total Number of FEA Structures
Add an FEA Assembly. An assembly gathers several FEA Structures and the connections between them so they can be meshed and written out as one model.
assembly_id = AddFeaAssembly() assert len( assembly_id ) > 0, "AddFeaAssembly did not add an assembly" assert NumFeaAssemblies() == 1, "AddFeaAssembly did not add an assembly" assy_ids = GetFeaAssemblyIDVec() assert len( assy_ids ) == 1 and assy_ids[0] == assembly_id, "the assembly is not in the assembly list" # A new assembly is named and holds nothing yet. assert len( GetFeaAssemblyName( assembly_id ) ) > 0, "AddFeaAssembly did not name the assembly" assert len( GetFeaAssemblyStructureIDVec( assembly_id ) ) == 0, "a new assembly already holds structures"
See also: DeleteFeaAssembly, AddFeaStructureToAssembly, ComputeFeaAssemblyMesh :rtype: void :return: string FEA Assembly ID
Add an FEA Part to the list a Trim part trims against. This is the Trim part’s Add button.
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) struct_ind = AddFeaStruct( pod_id ) #==== A Trim part and something for it to trim against ====// trim_id = AddFeaPart( pod_id, struct_ind, FEA_TRIM ) slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) assert len( GetFeaTrimPartIDVec( trim_id ) ) == 0, "a new Trim part already trims against something" AddFeaTrimPart( trim_id, slice_id ) trim_parts = GetFeaTrimPartIDVec( trim_id ) assert len( trim_parts ) == 1, "AddFeaTrimPart did not add the part" assert trim_parts[0] == slice_id, "AddFeaTrimPart did not add the part" DeleteFeaTrimPart( trim_id, 0 ) assert len( GetFeaTrimPartIDVec( trim_id ) ) == 0, "DeleteFeaTrimPart did not remove the part" # An FEA Part that is not a Trim part has to be rejected. err_mgr = ErrorMgrSingleton.getInstance() AddFeaTrimPart( slice_id, slice_id ) assert err_mgr.GetNumTotalErrors() > 0, "AddFeaTrimPart accepted a part that is not a Trim part" while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: DeleteFeaTrimPart, GetFeaTrimPartIDVec :param [in]: trim_id string FEA Trim part ID :param [in]: part_id string FEA Part ID to trim against
- openvsp.DeleteFeaTrimPart(trim_id, index)[source]¶
Remove an entry from the list a Trim part trims against
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() trim_id = AddFeaPart( pid, struct_ind, FEA_TRIM ) # Nothing has been added to trim against, so there is nothing to take out yet. assert len( GetFeaTrimPartIDVec( trim_id ) ) == 0, "GetFeaTrimPartIDVec reported trim parts on a new part"
See also: AddFeaTrimPart, GetFeaTrimPartIDVec, DeleteFeaTrimPartByID :param [in]: trim_id string FEA Trim part ID :param [in]: index int Trim entry index
- openvsp.DeleteFeaTrimPartByID(trim_id, part_id)[source]¶
Stop an FEA Part from trimming a Trim part, by the trimming part’s ID.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) slice_id = AddFeaPartByID( struct_id, FEA_SLICE ) trim_id = AddFeaPartByID( struct_id, FEA_TRIM ) AddFeaTrimPart( trim_id, slice_id ) DeleteFeaTrimPartByID( trim_id, slice_id ) assert len( GetFeaTrimPartIDVec( trim_id ) ) == 0, "DeleteFeaTrimPartByID did not remove the part"
See also: AddFeaTrimPart, GetFeaTrimPartIDVec, DeleteFeaTrimPart :param [in]: trim_id string FEA Trim part ID :param [in]: part_id string FEA Part ID of the trimming part
- openvsp.GetFeaTrimPartIDVec(trim_id)[source]¶
Get the FEA Parts a Trim part trims against
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() trim_id = AddFeaPart( pid, struct_ind, FEA_TRIM ) # A trim part starts with nothing to trim against. assert len( GetFeaTrimPartIDVec( trim_id ) ) == 0, "GetFeaTrimPartIDVec reported trim parts on a new part"
See also: AddFeaTrimPart, DeleteFeaTrimPart :param [in]: trim_id string FEA Trim part ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of FEA Part IDs
- openvsp.AddFeaAssembly()[source]¶
Add an FEA assembly, which gathers structures together so they can be meshed as one.
assembly_id = AddFeaAssembly() assert len( assembly_id ) > 0, "AddFeaAssembly returned no ID" assert NumFeaAssemblies() == 1, "AddFeaAssembly did not add the assembly"
See also: NumFeaAssemblies, DeleteFeaAssembly :rtype: string :return: string FEA assembly ID
- openvsp.DeleteFeaAssembly(assembly_id)[source]¶
Delete an FEA Assembly. The Structures it gathered are left in the model.
pod_id = AddGeom( "POD" ) struct_ind = AddFeaStruct( pod_id ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, GetFeaStructID( pod_id, struct_ind ) ) DeleteFeaAssembly( assembly_id ) assert NumFeaAssemblies() == 0, "DeleteFeaAssembly did not remove the assembly" # The Structure it held survives. assert NumFeaStructures() == 1, "DeleteFeaAssembly removed the Structure it gathered" # An ID that is not an assembly has to be rejected. err_mgr = ErrorMgrSingleton.getInstance() DeleteFeaAssembly( "NOSUCHASSEMBLY" ) assert err_mgr.GetNumTotalErrors() > 0, "DeleteFeaAssembly accepted a bad ID" while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: AddFeaAssembly, GetFeaAssemblyIDVec :param [in]: assembly_id string FEA Assembly ID
- openvsp.NumFeaAssemblies()[source]¶
Get the number of FEA Assemblies in the model
assert NumFeaAssemblies() == 0, "a new model starts with FEA Assemblies" AddFeaAssembly() AddFeaAssembly() assert NumFeaAssemblies() == 2, "NumFeaAssemblies did not count both assemblies" assert NumFeaAssemblies() == len( GetFeaAssemblyIDVec() ), "NumFeaAssemblies disagrees with GetFeaAssemblyIDVec"
See also: AddFeaAssembly, GetFeaAssemblyIDVec :rtype: int :return: int Number of FEA Assemblies
- openvsp.GetFeaAssemblyIDVec()[source]¶
Get the IDs of every FEA Assembly in the model
first = AddFeaAssembly() second = AddFeaAssembly() assy_ids = GetFeaAssemblyIDVec() # Assemblies come back in the order they were added. assert len( assy_ids ) == 2, "GetFeaAssemblyIDVec did not report the assemblies in order" assert assy_ids[0] == first, "GetFeaAssemblyIDVec did not report the assemblies in order" assert assy_ids[1] == second, "GetFeaAssemblyIDVec did not report the assemblies in order"
See also: AddFeaAssembly, NumFeaAssemblies :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of FEA Assembly IDs
- openvsp.GetFeaAssemblyName(assembly_id)[source]¶
Get the name of an FEA Assembly
assembly_id = AddFeaAssembly() SetFeaAssemblyName( assembly_id, "ExampleAssembly" ) assert GetFeaAssemblyName( assembly_id ) == "ExampleAssembly", "GetFeaAssemblyName did not report the name that was set" # An ID that is not an assembly has to be rejected. err_mgr = ErrorMgrSingleton.getInstance() GetFeaAssemblyName( "NOSUCHASSEMBLY" ) assert err_mgr.GetNumTotalErrors() > 0, "GetFeaAssemblyName accepted a bad ID" while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: AddFeaAssembly, SetFeaAssemblyName :param [in]: assembly_id string FEA Assembly ID :rtype: string :return: string FEA Assembly name
- openvsp.SetFeaAssemblyName(assembly_id, name)[source]¶
Set the name of an FEA Assembly. The assembly’s export file names are rebuilt from the new name.
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() assembly_id = AddFeaAssembly() AddFeaAssemblyStructure( assembly_id, GetFeaStructID( pid, struct_ind ) ) SetFeaAssemblyName( assembly_id, "TestAssembly" ) assert GetFeaAssemblyName( assembly_id ) == "TestAssembly", "SetFeaAssemblyName did not take"
See also: AddFeaAssembly, GetFeaAssemblyName :param [in]: assembly_id string FEA Assembly ID :param [in]: name string FEA Assembly name
- openvsp.AddFeaStructureToAssembly(assembly_id, struct_id)[source]¶
Add an FEA Structure to an FEA Assembly
pod_id = AddGeom( "POD" ) struct_ind_1 = AddFeaStruct( pod_id ) struct_ind_2 = AddFeaStruct( pod_id ) struct_id_1 = GetFeaStructID( pod_id, struct_ind_1 ) struct_id_2 = GetFeaStructID( pod_id, struct_ind_2 ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, struct_id_1 ) AddFeaStructureToAssembly( assembly_id, struct_id_2 ) struct_ids = GetFeaAssemblyStructureIDVec( assembly_id ) assert len( struct_ids ) == 2, "the assembly does not hold the Structures it was given" assert struct_ids[0] == struct_id_1, "the assembly does not hold the Structures it was given" assert struct_ids[1] == struct_id_2, "the assembly does not hold the Structures it was given" # A Structure that does not exist has to be rejected. err_mgr = ErrorMgrSingleton.getInstance() AddFeaStructureToAssembly( assembly_id, "NOSUCHSTRUCT" ) assert err_mgr.GetNumTotalErrors() > 0, "AddFeaStructureToAssembly accepted a bad Structure ID" while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: AddFeaAssembly, DeleteFeaStructureFromAssembly, GetFeaAssemblyStructureIDVec :param [in]: assembly_id string FEA Assembly ID :param [in]: struct_id string FEA Structure ID
- openvsp.DeleteFeaStructureFromAssembly(assembly_id, struct_id)[source]¶
Remove an FEA Structure from an FEA Assembly. The Structure itself is left in the model.
pod_id = AddGeom( "POD" ) struct_ind_1 = AddFeaStruct( pod_id ) struct_ind_2 = AddFeaStruct( pod_id ) struct_id_1 = GetFeaStructID( pod_id, struct_ind_1 ) struct_id_2 = GetFeaStructID( pod_id, struct_ind_2 ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, struct_id_1 ) AddFeaStructureToAssembly( assembly_id, struct_id_2 ) DeleteFeaStructureFromAssembly( assembly_id, struct_id_1 ) # Only the named Structure leaves the assembly, and it survives in the model. struct_ids = GetFeaAssemblyStructureIDVec( assembly_id ) assert len( struct_ids ) == 1, "DeleteFeaStructureFromAssembly removed the wrong Structure" assert struct_ids[0] == struct_id_2, "DeleteFeaStructureFromAssembly removed the wrong Structure" assert NumFeaStructures() == 2, "DeleteFeaStructureFromAssembly deleted the Structure itself" # A Structure the assembly does not hold has to be rejected. err_mgr = ErrorMgrSingleton.getInstance() DeleteFeaStructureFromAssembly( assembly_id, struct_id_1 ) assert err_mgr.GetNumTotalErrors() > 0, "DeleteFeaStructureFromAssembly accepted a Structure it does not hold" while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: AddFeaStructureToAssembly, GetFeaAssemblyStructureIDVec :param [in]: assembly_id string FEA Assembly ID :param [in]: struct_id string FEA Structure ID
- openvsp.AddFeaAssemblyStructure(assembly_id, struct_id)[source]¶
Put a structure into an FEA assembly. An assembly starts empty; this is what fills it, so that ComputeFeaAssemblyMesh has something to mesh. Adding the same structure twice is refused.
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() struct_id = GetFeaStructID( pid, struct_ind ) assembly_id = AddFeaAssembly() AddFeaAssemblyStructure( assembly_id, struct_id ) assert len( GetFeaAssemblyStructureIDVec( assembly_id ) ) == 1, "AddFeaAssemblyStructure did not add the structure"
See also: DeleteFeaAssemblyStructure, GetFeaAssemblyStructureIDVec, ComputeFeaAssemblyMesh :param [in]: assembly_id string FEA assembly ID :param [in]: struct_id string FEA structure ID to add
- openvsp.DeleteFeaAssemblyStructure(assembly_id, struct_id)[source]¶
Take a structure back out of an FEA assembly. The structure itself is left alone; only its membership of the assembly goes.
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() struct_id = GetFeaStructID( pid, struct_ind ) assembly_id = AddFeaAssembly() AddFeaAssemblyStructure( assembly_id, struct_id ) DeleteFeaAssemblyStructure( assembly_id, struct_id ) assert len( GetFeaAssemblyStructureIDVec( assembly_id ) ) == 0, "DeleteFeaAssemblyStructure did not remove the structure" # The structure is still there; it is only out of the assembly. assert NumFeaStructures() == 1, "DeleteFeaAssemblyStructure deleted the structure itself"
See also: AddFeaAssemblyStructure, GetFeaAssemblyStructureIDVec :param [in]: assembly_id string FEA assembly ID :param [in]: struct_id string FEA structure ID to remove
- openvsp.GetFeaAssemblyStructureIDVec(assembly_id)[source]¶
Get the IDs of the FEA Structures gathered by an FEA Assembly
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() assembly_id = AddFeaAssembly() AddFeaAssemblyStructure( assembly_id, GetFeaStructID( pid, struct_ind ) ) assert len( GetFeaAssemblyStructureIDVec( assembly_id ) ) == 1, "GetFeaAssemblyStructureIDVec did not report the structure"
See also: AddFeaStructureToAssembly, DeleteFeaStructureFromAssembly :param [in]: assembly_id string FEA Assembly ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of FEA Structure IDs
- openvsp.AddFeaAssemblyConnection(assembly_id, start_fix_pt_id, start_struct_id, start_index, end_fix_pt_id, end_struct_id, end_index)[source]¶
Connect two FEA Fixed Points, each belonging to a Structure in the assembly, so the Structures are tied together where they meet.
pod_id = AddGeom( "POD" ) struct_ind_1 = AddFeaStruct( pod_id ) struct_ind_2 = AddFeaStruct( pod_id ) struct_id_1 = GetFeaStructID( pod_id, struct_ind_1 ) struct_id_2 = GetFeaStructID( pod_id, struct_ind_2 ) #==== Each Structure needs a Fixed Point to connect ====// fix_pt_1 = AddFeaPart( pod_id, struct_ind_1, FEA_FIX_POINT ) fix_pt_2 = AddFeaPart( pod_id, struct_ind_2, FEA_FIX_POINT ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, struct_id_1 ) AddFeaStructureToAssembly( assembly_id, struct_id_2 ) assert NumFeaAssemblyConnections( assembly_id ) == 0, "a new assembly already holds connections" conn_id = AddFeaAssemblyConnection( assembly_id, fix_pt_1, struct_id_1, 0, fix_pt_2, struct_id_2, 0 ) assert GetFeaAssemblyConnectionID( assembly_id, 0 ) == conn_id, "AddFeaAssemblyConnection did not return the new connection" assert NumFeaAssemblyConnections( assembly_id ) == 1, "AddFeaAssemblyConnection did not add a connection" DeleteFeaAssemblyConnection( assembly_id, 0 ) assert NumFeaAssemblyConnections( assembly_id ) == 0, "DeleteFeaAssemblyConnection did not remove the connection" # An index past the end has to be rejected. err_mgr = ErrorMgrSingleton.getInstance() DeleteFeaAssemblyConnection( assembly_id, 0 ) assert err_mgr.GetNumTotalErrors() > 0, "DeleteFeaAssemblyConnection accepted an index past the end" while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: AddFeaAssembly, DeleteFeaAssemblyConnection, NumFeaAssemblyConnections :param [in]: assembly_id string FEA Assembly ID :param [in]: start_fix_pt_id string FEA Fixed Point ID at the start of the connection :param [in]: start_struct_id string FEA Structure ID the start Fixed Point belongs to :param [in]: start_index int Surface index of the start Fixed Point :param [in]: end_fix_pt_id string FEA Fixed Point ID at the end of the connection :param [in]: end_struct_id string FEA Structure ID the end Fixed Point belongs to :param [in]: end_index int Surface index of the end Fixed Point :rtype: string :return: string FEA Connection ID
- openvsp.DeleteFeaAssemblyConnection(assembly_id, connection_index)[source]¶
Delete a connection from an FEA Assembly
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() assembly_id = AddFeaAssembly() AddFeaAssemblyStructure( assembly_id, GetFeaStructID( pid, struct_ind ) ) # A new assembly has no connections, so there is nothing to take out yet. assert NumFeaAssemblyConnections( assembly_id ) == 0, "NumFeaAssemblyConnections miscounted a new assembly"
See also: AddFeaAssemblyConnection, NumFeaAssemblyConnections, DeleteFeaAssemblyConnectionByID :param [in]: assembly_id string FEA Assembly ID :param [in]: connection_index int Connection index
- openvsp.DeleteFeaAssemblyConnectionByID(assembly_id, connection_id)[source]¶
Delete a connection from an FEA Assembly, by connection ID.
pod_id = AddGeom( "POD" ) struct_id_1 = AddFeaStructure( pod_id ) struct_id_2 = AddFeaStructure( pod_id ) fix_pt_1 = AddFeaPartByID( struct_id_1, FEA_FIX_POINT ) fix_pt_2 = AddFeaPartByID( struct_id_2, FEA_FIX_POINT ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, struct_id_1 ) AddFeaStructureToAssembly( assembly_id, struct_id_2 ) conn_id = AddFeaAssemblyConnection( assembly_id, fix_pt_1, struct_id_1, 0, fix_pt_2, struct_id_2, 0 ) DeleteFeaAssemblyConnectionByID( assembly_id, conn_id ) assert NumFeaAssemblyConnections( assembly_id ) == 0, "DeleteFeaAssemblyConnectionByID did not remove the connection"
See also: AddFeaAssemblyConnection, GetFeaAssemblyConnectionIDVec, DeleteFeaAssemblyConnection :param [in]: assembly_id string FEA Assembly ID :param [in]: connection_id string FEA Connection ID
- openvsp.NumFeaAssemblyConnections(assembly_id)[source]¶
Get the number of connections in an FEA Assembly
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() assembly_id = AddFeaAssembly() AddFeaAssemblyStructure( assembly_id, GetFeaStructID( pid, struct_ind ) ) assert NumFeaAssemblyConnections( assembly_id ) == 0, "NumFeaAssemblyConnections miscounted a new assembly"
See also: AddFeaAssemblyConnection, DeleteFeaAssemblyConnection :param [in]: assembly_id string FEA Assembly ID :rtype: int :return: int Number of connections
- openvsp.GetFeaAssemblyConnectionID(assembly_id, connection_index)[source]¶
Get the ID of one of an assembly’s connections, so that its Parms can be reached the way any other container’s are. A connection carries the two fix point surface indices, its mode and its constraints, all in Parm group “Connection”. Everything else about connections is addressed by index; this is what lets a script read or set what a connection does.
#==== Two structures to connect ====# pod = AddGeom( "POD", "" ) wing = AddGeom( "WING", "" ) pod_struct = AddFeaStruct( pod ) wing_struct = AddFeaStruct( wing ) pod_struct_id = GetFeaStructID( pod, pod_struct ) wing_struct_id = GetFeaStructID( wing, wing_struct ) #==== A fix point on each, which is what a connection joins ====# pod_pt = AddFeaPart( pod, pod_struct, FEA_FIX_POINT ) wing_pt = AddFeaPart( wing, wing_struct, FEA_FIX_POINT ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, pod_struct_id ) AddFeaStructureToAssembly( assembly_id, wing_struct_id ) AddFeaAssemblyConnection( assembly_id, pod_pt, pod_struct_id, 0, wing_pt, wing_struct_id, 0 ) assert NumFeaAssemblyConnections( assembly_id ) == 1, "the connection was not added" conn_id = GetFeaAssemblyConnectionID( assembly_id, 0 ) assert len( conn_id ) > 0, "GetFeaAssemblyConnectionID found nothing" #==== And what it constrains is a Parm like any other ====# SetParmVal( FindParm( conn_id, "ConMode", "Connection" ), FEA_BCM_PIN ) Update() mode = GetParmVal( conn_id, "ConMode", "Connection" ) assert mode == FEA_BCM_PIN, "the connection did not take the mode it was given"
See also: NumFeaAssemblyConnections, AddFeaAssemblyConnection :param [in]: assembly_id string FEA assembly ID :param [in]: connection_index int Connection index :rtype: string :return: string Connection ID
- openvsp.GetFeaAssemblyConnectionIDVec(assembly_id)[source]¶
Get the IDs of the connections of an FEA Assembly, in order.
pod_id = AddGeom( "POD" ) struct_id_1 = AddFeaStructure( pod_id ) struct_id_2 = AddFeaStructure( pod_id ) fix_pt_1 = AddFeaPartByID( struct_id_1, FEA_FIX_POINT ) fix_pt_2 = AddFeaPartByID( struct_id_2, FEA_FIX_POINT ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, struct_id_1 ) AddFeaStructureToAssembly( assembly_id, struct_id_2 ) conn_id = AddFeaAssemblyConnection( assembly_id, fix_pt_1, struct_id_1, 0, fix_pt_2, struct_id_2, 0 ) assert list( GetFeaAssemblyConnectionIDVec( assembly_id ) ) == [ conn_id ], "GetFeaAssemblyConnectionIDVec did not return the connection"
See also: GetFeaAssemblyConnectionID, AddFeaAssemblyConnection :param [in]: assembly_id string FEA Assembly ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of FEA Connection IDs
- openvsp.GetFeaConnectionStartFixPtID(connection_id)[source]¶
Get the fixed point at the start of an FEA Assembly connection.
pod_id = AddGeom( "POD" ) struct_id_1 = AddFeaStructure( pod_id ) struct_id_2 = AddFeaStructure( pod_id ) fix_pt_1 = AddFeaPartByID( struct_id_1, FEA_FIX_POINT ) fix_pt_2 = AddFeaPartByID( struct_id_2, FEA_FIX_POINT ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, struct_id_1 ) AddFeaStructureToAssembly( assembly_id, struct_id_2 ) AddFeaAssemblyConnection( assembly_id, fix_pt_1, struct_id_1, 0, fix_pt_2, struct_id_2, 0 ) conn_id = GetFeaAssemblyConnectionID( assembly_id, 0 ) assert GetFeaConnectionStartFixPtID( conn_id ) == fix_pt_1, "GetFeaConnectionStartFixPtID did not return the fixed point"
See also: GetFeaConnectionStartStructID, AddFeaAssemblyConnection :param [in]: connection_id string FEA Connection ID :rtype: string :return: string FEA Fixed Point ID
- openvsp.GetFeaConnectionStartStructID(connection_id)[source]¶
Get the Structure of the fixed point at the start of an FEA Assembly connection.
pod_id = AddGeom( "POD" ) struct_id_1 = AddFeaStructure( pod_id ) struct_id_2 = AddFeaStructure( pod_id ) fix_pt_1 = AddFeaPartByID( struct_id_1, FEA_FIX_POINT ) fix_pt_2 = AddFeaPartByID( struct_id_2, FEA_FIX_POINT ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, struct_id_1 ) AddFeaStructureToAssembly( assembly_id, struct_id_2 ) AddFeaAssemblyConnection( assembly_id, fix_pt_1, struct_id_1, 0, fix_pt_2, struct_id_2, 0 ) conn_id = GetFeaAssemblyConnectionID( assembly_id, 0 ) assert GetFeaConnectionStartStructID( conn_id ) == struct_id_1, "GetFeaConnectionStartStructID did not return the Structure"
See also: GetFeaConnectionStartFixPtID, AddFeaAssemblyConnection :param [in]: connection_id string FEA Connection ID :rtype: string :return: string FEA Structure ID
- openvsp.GetFeaConnectionEndFixPtID(connection_id)[source]¶
Get the fixed point at the end of an FEA Assembly connection.
pod_id = AddGeom( "POD" ) struct_id_1 = AddFeaStructure( pod_id ) struct_id_2 = AddFeaStructure( pod_id ) fix_pt_1 = AddFeaPartByID( struct_id_1, FEA_FIX_POINT ) fix_pt_2 = AddFeaPartByID( struct_id_2, FEA_FIX_POINT ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, struct_id_1 ) AddFeaStructureToAssembly( assembly_id, struct_id_2 ) AddFeaAssemblyConnection( assembly_id, fix_pt_1, struct_id_1, 0, fix_pt_2, struct_id_2, 0 ) conn_id = GetFeaAssemblyConnectionID( assembly_id, 0 ) assert GetFeaConnectionEndFixPtID( conn_id ) == fix_pt_2, "GetFeaConnectionEndFixPtID did not return the fixed point"
See also: GetFeaConnectionEndStructID, AddFeaAssemblyConnection :param [in]: connection_id string FEA Connection ID :rtype: string :return: string FEA Fixed Point ID
- openvsp.GetFeaConnectionEndStructID(connection_id)[source]¶
Get the Structure of the fixed point at the end of an FEA Assembly connection.
pod_id = AddGeom( "POD" ) struct_id_1 = AddFeaStructure( pod_id ) struct_id_2 = AddFeaStructure( pod_id ) fix_pt_1 = AddFeaPartByID( struct_id_1, FEA_FIX_POINT ) fix_pt_2 = AddFeaPartByID( struct_id_2, FEA_FIX_POINT ) assembly_id = AddFeaAssembly() AddFeaStructureToAssembly( assembly_id, struct_id_1 ) AddFeaStructureToAssembly( assembly_id, struct_id_2 ) AddFeaAssemblyConnection( assembly_id, fix_pt_1, struct_id_1, 0, fix_pt_2, struct_id_2, 0 ) conn_id = GetFeaAssemblyConnectionID( assembly_id, 0 ) assert GetFeaConnectionEndStructID( conn_id ) == struct_id_2, "GetFeaConnectionEndStructID did not return the Structure"
See also: GetFeaConnectionEndFixPtID, AddFeaAssemblyConnection :param [in]: connection_id string FEA Connection ID :rtype: string :return: string FEA Structure ID
- openvsp.GetFeaAssemblyFileName(assembly_id, file_type)[source]¶
Mesh and write out an FEA Assembly. Any Structure in the assembly that has not been meshed yet is meshed first.
pod_id = AddGeom( "POD" ) struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Keep the mesh coarse so the example runs quickly ====// SetFeaMeshVal( pod_id, struct_ind, CFD_MAX_EDGE_LEN, 0.75 ) assembly_id = AddFeaAssembly() SetFeaAssemblyName( assembly_id, "ExampleAssembly" ) AddFeaStructureToAssembly( assembly_id, struct_id ) out_name = GetFeaAssemblyFileName( assembly_id, FEA_CALCULIX_FILE_NAME ) ComputeFeaAssemblyMesh( assembly_id ) # The assembly writes the Calculix deck it named. import os assert os.path.getsize( out_name ) > 0, "ComputeFeaAssemblyMesh wrote no file"
See also: AddFeaAssembly, AddFeaStructureToAssembly :param [in]: assembly_id string FEA Assembly ID
Get the name of an FEA Assembly output file. The names are built from the assembly name when it is set, so this reports where ComputeFeaAssemblyMesh will write.
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() assembly_id = AddFeaAssembly() AddFeaAssemblyStructure( assembly_id, GetFeaStructID( pid, struct_ind ) ) SetFeaAssemblyFileName( assembly_id, FEA_MASS_FILE_NAME, "TestAssemblyMass.txt" ) assert GetFeaAssemblyFileName( assembly_id, FEA_MASS_FILE_NAME ) == "TestAssemblyMass.txt", "GetFeaAssemblyFileName did not report the name"
See also: SetFeaAssemblyFileName, ComputeFeaAssemblyMesh, FEA_EXPORT_TYPE :param [in]: assembly_id string FEA Assembly ID :param [in]: file_type int FEA output file type enum (i.e. FEA_CALCULIX_FILE_NAME) :rtype: string :return: string Name of the output file
- openvsp.SetFeaAssemblyFileName(assembly_id, file_type, file_name)[source]¶
Set the name of an FEA Assembly output file
assembly_id = AddFeaAssembly() SetFeaAssemblyFileName( assembly_id, FEA_CALCULIX_FILE_NAME, "ExampleAssembly.inp" ) assert GetFeaAssemblyFileName( assembly_id, FEA_CALCULIX_FILE_NAME ) == "ExampleAssembly.inp", "SetFeaAssemblyFileName did not take" # Each output type carries its own name. assert GetFeaAssemblyFileName( assembly_id, FEA_NASTRAN_FILE_NAME ) != "ExampleAssembly.inp", "setting one output name disturbed another"
See also: GetFeaAssemblyFileName, ComputeFeaAssemblyMesh, FEA_EXPORT_TYPE :param [in]: assembly_id string FEA Assembly ID :param [in]: file_type int FEA output file type enum (i.e. FEA_CALCULIX_FILE_NAME) :param [in]: file_name string Name for the output file
- openvsp.ComputeFeaAssemblyMesh(assembly_id)[source]¶
Mesh an FEA assembly, meshing every structure it holds and joining them at their connections. An assembly starts empty; use AddFeaAssemblyStructure to put structures into it first.
pid = AddGeom( "POD" ) struct_ind = AddFeaStruct( pid ) Update() assembly_id = AddFeaAssembly() AddFeaAssemblyStructure( assembly_id, GetFeaStructID( pid, struct_ind ) ) # Meshing an assembly is not quick; keep the mesh coarse. SetFeaMeshVal( pid, 0, CFD_MAX_EDGE_LEN, 1.0 ) ComputeFeaAssemblyMesh( assembly_id )
See also: AddFeaAssembly, AddFeaAssemblyStructure, GetFeaAssemblyStructureIDVec :param [in]: assembly_id string FEA assembly ID
- openvsp.NumFeaStructures()[source]¶
Get the number of FEA structures in the model, counting those on every Geom.
pid = AddGeom( "POD" ) AddFeaStruct( pid ) Update() assert NumFeaStructures() == 1, "NumFeaStructures did not count the structure"
See also: AddFeaStruct :rtype: int :return: int Number of FEA structures
- openvsp.NumFeaParts(fea_struct_id)[source]¶
Get the number of FEA Parts for a particular FEA Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Add FEA Parts ====// slice_id = AddFeaPart( pod_id, struct_ind, FEA_SLICE ) dome_id = AddFeaPart( pod_id, struct_ind, FEA_DOME ) if NumFeaParts( struct_id ) != 3 : # Includes FeaSkin print( "Error: NumFeaParts" ) assert False, "Error: NumFeaParts"
See also: GetFeaPartIDVec :param [in]: fea_struct_id string FEA Structure ID :rtype: int :return: int Number of FEA Parts
- openvsp.NumFeaSubSurfs(fea_struct_id)[source]¶
Get the number of FEA Subsurfaces for a particular FEA Structure
#==== Add Pod Geometry ====// wing_id = AddGeom( "WING" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( wing_id ) struct_id = GetFeaStructID( wing_id, struct_ind ) #==== Add SubSurfaces ====// line_array_id = AddFeaSubSurf( wing_id, struct_ind, SS_LINE_ARRAY ) rectangle_id = AddFeaSubSurf( wing_id, struct_ind, SS_RECTANGLE ) if NumFeaSubSurfs( struct_id ) != 2 : print( "Error: NumFeaSubSurfs" ) assert False, "Error: NumFeaSubSurfs"
See also: GetFeaSubSurfIDVec :param [in]: fea_struct_id string FEA Structure ID :rtype: int :return: int Number of FEA SubSurfaces
- openvsp.AddFeaBC(fea_struct_id, type=-1)[source]¶
Add an FEA BC to a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ); #==== Add BC ====// bc_id = AddFeaBC( struct_id, FEA_BC_STRUCTURE )
See also: FEA_BC_TYPE :param [in]: fea_struct_id string FEA Structure ID :param [in]: type int FEA BC type enum ( i.e. FEA_BC_STRUCTURE ) :rtype: string :return: string FEA BC ID
- openvsp.DelFeaBC(fea_struct_id, bc_id)[source]¶
Delete an FEA BC from a Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ); #==== Add BC ====// bc_id = AddFeaBC( struct_id, FEA_BC_STRUCTURE ) assert NumFeaBCs( struct_id ) == 1, "AddFeaBC did not add a boundary condition" DelFeaBC( struct_id, bc_id ) assert NumFeaBCs( struct_id ) == 0, "DelFeaBC did not remove the boundary condition" assert len( GetFeaBCIDVec( struct_id ) ) == 0, "DelFeaBC left the boundary condition in the ID list"
See also: FEA_BC_TYPE :param [in]: fea_struct_id string FEA Structure ID :param [in]: bc_id int FEA BC ID
- openvsp.GetFeaBCIDVec(fea_struct_id)[source]¶
Return a vector of FEA BC ID’s for a structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ); #==== Add BC ====// bc_id = AddFeaBC( struct_id, FEA_BC_STRUCTURE ) bc_id_vec = GetFeaBCIDVec( struct_id ) assert len( bc_id_vec ) > 0, "GetFeaBCIDVec returned nothing"
- Parameters:
[in] – fea_struct_id string FEA Structure ID
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
vector<string> Array of FEA BC IDs
- openvsp.NumFeaBCs(fea_struct_id)[source]¶
Return number of FEA BC’s in a structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ); #==== Add BC ====// bc_id = AddFeaBC( struct_id, FEA_BC_STRUCTURE ) nbc = NumFeaBCs( struct_id ) # The count has to match the list of IDs, and follow another add. assert nbc == 1, "NumFeaBCs did not count the boundary condition" assert nbc == len( GetFeaBCIDVec( struct_id ) ), "NumFeaBCs disagrees with GetFeaBCIDVec" AddFeaBC( struct_id, FEA_BC_STRUCTURE ) assert NumFeaBCs( struct_id ) == nbc + 1, "NumFeaBCs did not follow AddFeaBC"
- Parameters:
[in] – fea_struct_id string FEA Structure ID
- Return type:
int
- Returns:
int Number of FEA BCs
- openvsp.SetFeaBCPartID(bc_id, part_id)[source]¶
Set the FEA Part a part boundary condition applies to. The part must be in the boundary condition’s Structure.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) slice_id = AddFeaPartByID( struct_id, FEA_SLICE ) bc_id = AddFeaBC( struct_id, FEA_BC_PART ) SetFeaBCPartID( bc_id, slice_id ) assert GetFeaBCPartID( bc_id ) == slice_id, "SetFeaBCPartID did not set the part"
See also: GetFeaBCPartID, FEA_BC_TYPE :param [in]: bc_id string FEA BC ID :param [in]: part_id string FEA Part ID
- openvsp.GetFeaBCPartID(bc_id)[source]¶
Get the FEA Part a part boundary condition applies to.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) slice_id = AddFeaPartByID( struct_id, FEA_SLICE ) bc_id = AddFeaBC( struct_id, FEA_BC_PART ) SetFeaBCPartID( bc_id, slice_id ) assert GetFeaBCPartID( bc_id ) == slice_id, "GetFeaBCPartID did not return the part set"
See also: SetFeaBCPartID :param [in]: bc_id string FEA BC ID :rtype: string :return: string FEA Part ID
- openvsp.SetFeaBCSubSurfID(bc_id, ss_id)[source]¶
Set the FEA SubSurface a subsurface boundary condition applies to. The subsurface must be in the boundary condition’s Structure.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) line_id = AddFeaSubSurfByID( struct_id, SS_LINE ) bc_id = AddFeaBC( struct_id, FEA_BC_SUBSURF ) SetFeaBCSubSurfID( bc_id, line_id ) assert GetFeaBCSubSurfID( bc_id ) == line_id, "SetFeaBCSubSurfID did not set the subsurface"
See also: GetFeaBCSubSurfID, FEA_BC_TYPE :param [in]: bc_id string FEA BC ID :param [in]: ss_id string FEA SubSurface ID
- openvsp.GetFeaBCSubSurfID(bc_id)[source]¶
Get the FEA SubSurface a subsurface boundary condition applies to.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) line_id = AddFeaSubSurfByID( struct_id, SS_LINE ) bc_id = AddFeaBC( struct_id, FEA_BC_SUBSURF ) SetFeaBCSubSurfID( bc_id, line_id ) assert GetFeaBCSubSurfID( bc_id ) == line_id, "GetFeaBCSubSurfID did not return the subsurface set"
See also: SetFeaBCSubSurfID :param [in]: bc_id string FEA BC ID :rtype: string :return: string FEA SubSurface ID
- openvsp.AddFeaLayer(material_id)[source]¶
Add an FEA Material the FEA Mesh material library. Materials are available across all Geoms and Structures.
#==== Create FeaMaterial ====// mat_id = AddFeaMaterial() SetParmVal( FindParm( mat_id, "MassDensity", "FeaMaterial" ), 0.016 )
- Return type:
string
- Returns:
string FEA Material ID
Get the IDs of every FEA Material in the FEA Mesh material library, including the built in materials as well as any added through AddFeaMaterial.
#==== The library starts out holding the built in materials ====// num_builtin = len( GetFeaMaterialIDVec() ) assert num_builtin >= 1, "the FEA material library is empty" #==== Create FeaMaterial ====// mat_id = AddFeaMaterial() mat_ids = GetFeaMaterialIDVec() assert len( mat_ids ) == num_builtin + 1, "GetFeaMaterialIDVec did not follow AddFeaMaterial" assert mat_id in mat_ids, "the material that was added is not in the list"
See also: AddFeaMaterial, DeleteFeaMaterial :rtype: string :return: vector<string> Array of FEA Material IDs
Add a layer to an FEA laminate material. Only a material of type FEA_LAMINATE carries layers.
#==== Create a laminate material ====// mat_id = AddFeaMaterial() SetParmVal( FindParm( mat_id, "FeaMaterialType", "FeaMaterial" ), FEA_LAMINATE ) Update() # Becoming a laminate gives the material a first layer, so count from there. num_before = NumFeaLayers( mat_id ) assert num_before >= 1, "a laminate starts with no layers" layer_id = AddFeaLayer( mat_id ) assert len( layer_id ) > 0, "AddFeaLayer did not add a layer" assert NumFeaLayers( mat_id ) == num_before + 1, "AddFeaLayer did not add a layer" layer_ids = GetFeaLayerIDVec( mat_id ) assert len( layer_ids ) == num_before + 1, "the layer is not in the layer list" assert layer_ids[num_before] == layer_id, "the layer is not in the layer list" DeleteFeaLayer( mat_id, layer_id ) assert NumFeaLayers( mat_id ) == num_before, "DeleteFeaLayer did not remove the layer" # A material that is not a laminate has to be rejected. err_mgr = ErrorMgrSingleton.getInstance() plain_id = AddFeaMaterial() AddFeaLayer( plain_id ) assert err_mgr.GetNumTotalErrors() > 0, "AddFeaLayer accepted a material that is not a laminate" while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: DeleteFeaLayer, NumFeaLayers, GetFeaLayerIDVec, AddFeaMaterial :param [in]: material_id string FEA Material ID of a laminate :rtype: string :return: string FEA Layer ID
- openvsp.DeleteFeaLayer(material_id, layer_id)[source]¶
Delete a layer from an FEA laminate material
mat_id = AddFeaMaterial() SetParmVal( FindParm( mat_id, "FeaMaterialType", "FeaMaterial" ), FEA_LAMINATE ) Update() # A laminate material starts with a layer of its own, so count before and after. n0 = NumFeaLayers( mat_id ) layer_id = AddFeaLayer( mat_id ) DeleteFeaLayer( mat_id, layer_id ) assert NumFeaLayers( mat_id ) == n0, "DeleteFeaLayer did not delete the layer"
See also: AddFeaLayer, GetFeaLayerIDVec :param [in]: material_id string FEA Material ID of a laminate :param [in]: layer_id string FEA Layer ID
- openvsp.ReorderFeaLayer(material_id, layer_id, reorder_type)[source]¶
Move a layer within an FEA laminate’s stack, the way the move buttons on the material editor do. A laminate’s properties come from its layers in stacking order, so moving a layer changes the material.
mat_id = AddFeaMaterial() SetParmVal( FindParm( mat_id, "FeaMaterialType", "FeaMaterial" ), FEA_LAMINATE ) Update() first = AddFeaLayer( mat_id ) second = AddFeaLayer( mat_id ) layer_ids = GetFeaLayerIDVec( mat_id ) num_layers = len( layer_ids ) ReorderFeaLayer( mat_id, second, REORDER_MOVE_TOP ) moved_ids = GetFeaLayerIDVec( mat_id ) assert len( moved_ids ) == num_layers, "ReorderFeaLayer did not move the layer" assert moved_ids[0] == second, "ReorderFeaLayer did not move the layer"
See also: AddFeaLayer, DeleteFeaLayer, GetFeaLayerIDVec :param [in]: material_id string FEA Material ID of a laminate :param [in]: layer_id string FEA Layer ID :param [in]: reorder_type int Reorder type enum (see REORDER_TYPE)
- openvsp.NumFeaLayers(material_id)[source]¶
Get the number of layers in an FEA laminate material
mat_id = AddFeaMaterial() SetParmVal( FindParm( mat_id, "FeaMaterialType", "FeaMaterial" ), FEA_LAMINATE ) Update() # A laminate material starts with a layer of its own, so count before and after. n0 = NumFeaLayers( mat_id ) layer_id = AddFeaLayer( mat_id ) assert NumFeaLayers( mat_id ) == n0 + 1, "NumFeaLayers did not count the layer"
See also: AddFeaLayer, GetFeaLayerIDVec :param [in]: material_id string FEA Material ID of a laminate :rtype: int :return: int Number of layers
- openvsp.GetFeaLayerIDVec(material_id)[source]¶
Get the IDs of every layer in an FEA laminate material
mat_id = AddFeaMaterial() SetParmVal( FindParm( mat_id, "FeaMaterialType", "FeaMaterial" ), FEA_LAMINATE ) Update() # A laminate material starts with a layer of its own, so count before and after. n0 = NumFeaLayers( mat_id ) layer_id = AddFeaLayer( mat_id ) layer_array = GetFeaLayerIDVec( mat_id ) assert len( layer_array ) == n0 + 1, "GetFeaLayerIDVec did not report the layer"
See also: AddFeaLayer, DeleteFeaLayer :param [in]: material_id string FEA Material ID of a laminate :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of FEA Layer IDs
- openvsp.SetFeaLayerMaterialID(layer_id, material_id)[source]¶
Set the material of an FEA Layer, by material ID.
lam_id = AddFeaMaterial() SetParmVal( FindParm( lam_id, "FeaMaterialType", "FeaMaterial" ), FEA_LAMINATE ) Update() layer_id = AddFeaLayer( lam_id ) mat_id = AddFeaMaterial() SetFeaLayerMaterialID( layer_id, mat_id ) assert GetFeaLayerMaterialID( layer_id ) == mat_id, "SetFeaLayerMaterialID did not set the material"
See also: GetFeaLayerMaterialID :param [in]: layer_id string FEA Layer ID :param [in]: material_id string FEA Material ID
- openvsp.GetFeaLayerMaterialID(layer_id)[source]¶
Get the material of an FEA Layer.
lam_id = AddFeaMaterial() SetParmVal( FindParm( lam_id, "FeaMaterialType", "FeaMaterial" ), FEA_LAMINATE ) Update() layer_id = AddFeaLayer( lam_id ) assert GetFeaLayerMaterialID( layer_id ) in GetFeaMaterialIDVec(), "GetFeaLayerMaterialID did not return a material"
See also: SetFeaLayerMaterialID :param [in]: layer_id string FEA Layer ID :rtype: string :return: string FEA Material ID
- openvsp.GetFeaMaterialIDVec()[source]¶
Get the IDs of every FEA material, the built in ones as well as any added.
mat_id = AddFeaMaterial() mat_array = GetFeaMaterialIDVec() assert mat_id in mat_array, "GetFeaMaterialIDVec did not report the new material"
See also: AddFeaMaterial :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> FEA material IDs
- openvsp.DeleteFeaMaterial(id)[source]¶
Delete an FEA Material from the FEA Mesh material library. Only materials created with AddFeaMaterial can be deleted; the built in materials belong to the library.
#==== Create FeaMaterial ====// mat_id = AddFeaMaterial() num_before = len( GetFeaMaterialIDVec() ) DeleteFeaMaterial( mat_id ) assert len( GetFeaMaterialIDVec() ) == num_before - 1, "DeleteFeaMaterial did not remove the material" # An ID that is not a material has to be rejected. The error queue is # reached through the error manager singleton in Python. err_mgr = ErrorMgrSingleton.getInstance() DeleteFeaMaterial( "NOSUCHMATERIAL" ) assert err_mgr.GetNumTotalErrors() > 0, "DeleteFeaMaterial accepted a bad ID" # That error was raised deliberately, so take it back off the queue. while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: AddFeaMaterial, GetFeaMaterialIDVec :param [in]: id string FEA Material ID
- openvsp.AddFeaMaterial()[source]¶
Add an FEA material to the material library, with default properties.
mat_id = AddFeaMaterial() assert len( mat_id ) > 0, "AddFeaMaterial returned no ID"
See also: GetFeaMaterialIDVec, DeleteFeaMaterial :rtype: string :return: string FEA material ID
- openvsp.GetFeaPropertyIDVec()[source]¶
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 ====// prop_id = AddFeaProperty() SetParmVal( FindParm( prop_id, "Thickness", "FeaProperty" ), 0.01 )
See also: FEA_PART_ELEMENT_TYPE :param [in]: property_type int FEA Property type enum (i.e. FEA_SHELL). :rtype: std::vector< std::string,std::allocator< std::string > > :return: string FEA Property ID
Get the IDs of every FEA Property in the FEA Mesh property library, including the built in properties as well as any added through AddFeaProperty.
#==== Properties are created as structures need them, so start from #==== whatever the library already holds ====// num_before = len( GetFeaPropertyIDVec() ) #==== Create FeaProperty ====// prop_id = AddFeaProperty() prop_ids = GetFeaPropertyIDVec() assert len( prop_ids ) == num_before + 1, "GetFeaPropertyIDVec did not follow AddFeaProperty" assert prop_id in prop_ids, "the property that was added is not in the list"
See also: AddFeaProperty, DeleteFeaProperty :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector<string> Array of FEA Property IDs
- openvsp.DeleteFeaProperty(id)[source]¶
Delete an FEA Property from the FEA Mesh property library
#==== Create FeaProperty ====// prop_id = AddFeaProperty() num_before = len( GetFeaPropertyIDVec() ) DeleteFeaProperty( prop_id ) assert len( GetFeaPropertyIDVec() ) == num_before - 1, "DeleteFeaProperty did not remove the property" # An ID that is not a property has to be rejected. The error queue is # reached through the error manager singleton in Python. err_mgr = ErrorMgrSingleton.getInstance() DeleteFeaProperty( "NOSUCHPROPERTY" ) assert err_mgr.GetNumTotalErrors() > 0, "DeleteFeaProperty accepted a bad ID" # That error was raised deliberately, so take it back off the queue. while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: AddFeaProperty, GetFeaPropertyIDVec :param [in]: id string FEA Property ID
- openvsp.AddFeaProperty(property_type=0)[source]¶
Add an FEA property to the property library.
prop_id = AddFeaProperty() assert len( prop_id ) > 0, "AddFeaProperty returned no ID"
See also: GetFeaPropertyIDVec, DeleteFeaProperty :param [in]: property_type int FEA property type enum (default: shell) :rtype: string :return: string FEA property ID
- openvsp.SetFeaPropertyMaterialID(property_id, material_id)[source]¶
Set the material of an FEA Property, by material ID. A beam property needs an isotropic material.
prop_id = AddFeaProperty( FEA_SHELL ) mat_id = AddFeaMaterial() SetFeaPropertyMaterialID( prop_id, mat_id ) assert GetFeaPropertyMaterialID( prop_id ) == mat_id, "SetFeaPropertyMaterialID did not set the material"
See also: GetFeaPropertyMaterialID :param [in]: property_id string FEA Property ID :param [in]: material_id string FEA Material ID
- openvsp.GetFeaPropertyMaterialID(property_id)[source]¶
Get the material of an FEA Property.
prop_id = AddFeaProperty( FEA_BEAM ) assert GetFeaPropertyMaterialID( prop_id ) in GetFeaMaterialIDVec(), "GetFeaPropertyMaterialID did not return a material"
See also: SetFeaPropertyMaterialID :param [in]: property_id string FEA Property ID :rtype: string :return: string FEA Material ID
- openvsp.GetFeaMeshVal(geom_id, fea_struct_ind, type)[source]¶
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 ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// 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 ) # The options are backed by Parms on the Structure, in its grid density # group, so the values that were set can be read back. struct_id = GetFeaStructID( pod_id, struct_ind ) assert abs( GetParmVal( FindParm( struct_id, "BaseLen", "FEAGridDensity" ) ) - 0.75 ) < 1e-12, "SetFeaMeshVal did not set CFD_MAX_EDGE_LEN" assert abs( GetParmVal( FindParm( struct_id, "MinLen", "FEAGridDensity" ) ) - 0.2 ) < 1e-12, "SetFeaMeshVal did not set CFD_MIN_EDGE_LEN"
See also: CFD_CONTROL_TYPE :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: type int FEA Mesh option type enum (i.e. CFD_MAX_EDGE_LEN) :param [in]: val double Value the option is set to
Get the value of a specific FEA Mesh option for the specified Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) SetFeaMeshVal( pod_id, struct_ind, CFD_MAX_EDGE_LEN, 0.75 ) assert abs( GetFeaMeshVal( pod_id, struct_ind, CFD_MAX_EDGE_LEN ) - 0.75 ) < 1e-12, "GetFeaMeshVal did not report the value that was set" # Each Structure carries its own settings. struct_ind_2 = AddFeaStruct( pod_id ) SetFeaMeshVal( pod_id, struct_ind_2, CFD_MAX_EDGE_LEN, 0.25 ) assert abs( GetFeaMeshVal( pod_id, struct_ind, CFD_MAX_EDGE_LEN ) - 0.75 ) < 1e-12, "setting one Structure disturbed another" # A control type FEA Mesh does not use has to be rejected. The error queue # is reached through the error manager singleton in Python. err_mgr = ErrorMgrSingleton.getInstance() GetFeaMeshVal( pod_id, struct_ind, CFD_FAR_FIELD_FLAG ) assert err_mgr.GetNumTotalErrors() > 0, "GetFeaMeshVal accepted a control type FEA Mesh does not use" # That error was raised deliberately, so take it back off the queue. while err_mgr.GetNumTotalErrors() > 0 : err = err_mgr.PopLastError()
See also: CFD_CONTROL_TYPE, SetFeaMeshVal, GetFeaMeshValByID :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: type int FEA Mesh option type enum (i.e. CFD_MAX_EDGE_LEN) :rtype: float :return: double Value of the option
- openvsp.GetFeaMeshValByID(struct_id, type)[source]¶
Get an FEA Mesh setting of a Structure, by Structure ID.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) SetFeaMeshValByID( struct_id, CFD_MAX_EDGE_LEN, 0.75 ) assert abs( GetFeaMeshValByID( struct_id, CFD_MAX_EDGE_LEN ) - 0.75 ) < 1e-12, "GetFeaMeshValByID did not return the value set"
See also: SetFeaMeshVal, CFD_CONTROL_TYPE, GetFeaMeshVal :param [in]: struct_id string FEA Structure ID :param [in]: type int FEA Mesh setting type enum (i.e. CFD_MAX_EDGE_LEN) :rtype: float :return: double Value of the setting
- openvsp.SetFeaMeshVal(geom_id, fea_struct_ind, type, val)[source]¶
Set one of the FEA Mesh settings for a structure.
pid = AddGeom( "POD" ) AddFeaStruct( pid ) Update() SetFeaMeshVal( pid, 0, CFD_MAX_EDGE_LEN, 0.75 )
See also: CFD_CONTROL_TYPE, ComputeFeaMesh, SetFeaMeshValByID :param [in]: geom_id string Geom ID the structure is on :param [in]: fea_struct_ind int Index of the structure on that Geom :param [in]: type int CFD mesh setting enum (i.e. CFD_MAX_EDGE_LEN) :param [in]: val double Value to set
- openvsp.SetFeaMeshValByID(struct_id, type, val)[source]¶
Set an FEA Mesh setting of a Structure, by Structure ID.
pod_id = AddGeom( "POD" ) struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) SetFeaMeshValByID( struct_id, CFD_MAX_EDGE_LEN, 0.75 ) assert abs( GetFeaMeshVal( pod_id, struct_ind, CFD_MAX_EDGE_LEN ) - 0.75 ) < 1e-12, "SetFeaMeshValByID did not set the value"
See also: GetFeaMeshVal, CFD_CONTROL_TYPE, SetFeaMeshVal :param [in]: struct_id string FEA Structure ID :param [in]: type int FEA Mesh setting type enum (i.e. CFD_MAX_EDGE_LEN) :param [in]: val double Value to set
- openvsp.GetFeaMeshFileName(geom_id, fea_struct_ind, file_type)[source]¶
Set the name of a particular FEA Mesh output file for a specified Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #=== Set Export File Name ===// export_name = "FEAMeshTest_calculix.dat" #==== Get Parent Geom ID and Index ====// parent_id = GetFeaStructParentGeomID( struct_id ) # same as pod_id assert parent_id == pod_id, "GetFeaStructParentGeomID did not report the parent Geom" SetFeaMeshFileName( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME, export_name ) # Keep the mesh coarse so the example runs quickly, then mesh to prove the # name that was set is the name that gets written. SetFeaMeshVal( parent_id, struct_ind, CFD_MAX_EDGE_LEN, 0.75 ) ComputeFeaMesh( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME ) import os assert os.path.getsize( export_name ) > 0, "SetFeaMeshFileName did not name the output file"
- Parameters:
[in] – geom_id string Parent Geom ID
[in] – fea_struct_ind int FEA Structure index
[in] – file_type int FEA output file type enum (i.e. FEA_EXPORT_TYPE)
[in] – file_name string Name for the output file
Get the name of a particular FEA Mesh output file for a specified Structure
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) export_name = "FEAMeshTest_calculix.dat" SetFeaMeshFileName( pod_id, struct_ind, FEA_CALCULIX_FILE_NAME, export_name ) assert GetFeaMeshFileName( pod_id, struct_ind, FEA_CALCULIX_FILE_NAME ) == export_name, "GetFeaMeshFileName did not report the name that was set" # Each output type carries its own name. SetFeaMeshFileName( pod_id, struct_ind, FEA_NASTRAN_FILE_NAME, "FEAMeshTest_nastran.dat" ) assert GetFeaMeshFileName( pod_id, struct_ind, FEA_CALCULIX_FILE_NAME ) == export_name, "setting one output name disturbed another"
See also: FEA_EXPORT_TYPE, SetFeaMeshFileName, GetFeaMeshFileNameByID :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: file_type int FEA output file type enum (i.e. FEA_EXPORT_TYPE) :rtype: string :return: string Name of the output file
- openvsp.GetFeaMeshFileNameByID(struct_id, file_type)[source]¶
Get the name of an FEA Mesh output file of a Structure, by Structure ID.
pod_id = AddGeom( "POD" ) struct_id = AddFeaStructure( pod_id ) SetFeaMeshFileNameByID( struct_id, FEA_CALCULIX_FILE_NAME, "spine_calculix.dat" ) assert "spine_calculix.dat" in GetFeaMeshFileNameByID( struct_id, FEA_CALCULIX_FILE_NAME ), "GetFeaMeshFileNameByID did not return the name set"
See also: SetFeaMeshFileName, FEA_EXPORT_TYPE, GetFeaMeshFileName :param [in]: struct_id string FEA Structure ID :param [in]: file_type int FEA output file type enum (i.e. FEA_EXPORT_TYPE) :rtype: string :return: string File name
- openvsp.SetFeaMeshFileName(geom_id, fea_struct_ind, file_type, file_name)[source]¶
Set the file name an FEA Mesh writes for one export type.
pid = AddGeom( "POD" ) AddFeaStruct( pid ) Update() SetFeaMeshFileName( pid, 0, FEA_MASS_FILE_NAME, "TestFeaMass.txt" )
See also: FEA_EXPORT_TYPE, ComputeFeaMesh, SetFeaMeshFileNameByID :param [in]: geom_id string Geom ID the structure is on :param [in]: fea_struct_ind int Index of the structure on that Geom :param [in]: file_type int FEA export type enum (i.e. FEA_MASS_FILE_NAME) :param [in]: file_name string Name of the file to write
- openvsp.SetFeaMeshFileNameByID(struct_id, file_type, file_name)[source]¶
Set the name of an FEA Mesh output file of a Structure, by Structure ID.
pod_id = AddGeom( "POD" ) struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) SetFeaMeshFileNameByID( struct_id, FEA_CALCULIX_FILE_NAME, "spine_calculix.dat" ) assert "spine_calculix.dat" in GetFeaMeshFileName( pod_id, struct_ind, FEA_CALCULIX_FILE_NAME ), "SetFeaMeshFileNameByID did not set the name"
See also: GetFeaMeshFileName, FEA_EXPORT_TYPE, SetFeaMeshFileName :param [in]: struct_id string FEA Structure ID :param [in]: file_type int FEA output file type enum (i.e. FEA_EXPORT_TYPE) :param [in]: file_name string Name for the output file
- openvsp.ComputeFeaMesh(*args)[source]¶
Overload 1:
Compute an FEA Mesh for a Structure. Only a single output file can be generated with this function.
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Generate FEA Mesh and Export ====// print( "--> Generating FeaMesh " ) #==== Get Parent Geom ID and Index ====// parent_id = GetFeaStructParentGeomID( struct_id ) # same as pod_id #==== Keep the mesh coarse so the example runs quickly ====// SetFeaMeshVal( parent_id, struct_ind, CFD_MAX_EDGE_LEN, 0.75 ) SetFeaMeshFileName( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME, "FEAMeshTest_calculix.dat" ) ComputeFeaMesh( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME ) # FEA Mesh reports nothing through the Results Manager, so the output file is # the evidence that it ran. import os assert os.path.getsize( "FEAMeshTest_calculix.dat" ) > 0, "ComputeFeaMesh wrote no file"
See also: SetFeaMeshFileName, FEA_EXPORT_TYPE :param [in]: geom_id string Parent Geom ID :param [in]: fea_struct_ind int FEA Structure index :param [in]: file_type int FEA output file type enum (i.e. FEA_EXPORT_TYPE)
Overload 2:
Compute an FEA Mesh for a Structure. Only a single output file can be generated with this function.
#==== Add Pod Geometry ====// pod_id = AddGeom( "POD" ) #==== Add FeaStructure to Pod ====// struct_ind = AddFeaStruct( pod_id ) struct_id = GetFeaStructID( pod_id, struct_ind ) #==== Generate FEA Mesh and Export ====// print( "--> Generating FeaMesh " ) #==== Get Parent Geom ID and Index ====// parent_id = GetFeaStructParentGeomID( struct_id ) # same as pod_id #==== Keep the mesh coarse so the example runs quickly ====// SetFeaMeshVal( parent_id, struct_ind, CFD_MAX_EDGE_LEN, 0.75 ) SetFeaMeshFileName( parent_id, struct_ind, FEA_CALCULIX_FILE_NAME, "FEAMeshTest_calculix.dat" ) # This form names the Structure directly rather than its parent and index. ComputeFeaMesh( struct_id, FEA_CALCULIX_FILE_NAME ) # FEA Mesh reports nothing through the Results Manager, so the output file is # the evidence that it ran. import os assert os.path.getsize( "FEAMeshTest_calculix.dat" ) > 0, "ComputeFeaMesh wrote no file"
See also: SetFeaMeshFileName, FEA_EXPORT_TYPE :param [in]: struct_id string FEA Structure index :param [in]: file_type int FEA output file type enum (i.e. FEA_EXPORT_TYPE)