NaxToPy.Modules.Fasteners package#

Subpackages#

Submodules#

NaxToPy.Modules.Fasteners.N2PGetFasteners module#

class NaxToPy.Modules.Fasteners.N2PGetFasteners.N2PGetFasteners[source]#

Bases: object

Class used to obtain all necessary geometrical information of a model’s N2PJoints, N2PBolts and N2PPlates.

The instance of this class must be prepared using its properties before calling it method calculate.

property AttachmentsList: list[N2PAttachment]#

Property that returns the attachments_list attribute, that is, the list of N2PAttachments.

property BoltsList: list[N2PBolt]#

Property that returns the list of N2PBolts.

property ElementList: list[N2PElement]#

Property that returns the element_list attribute, that is, the list of the loaded CFASTs.

property GetAttachmentsBool: bool#

Sets if the get_attachments() method will be used inside method calculate().

property JointsList: list[N2PJoint]#

Property that returns the joints_list attribute, that is, the list of N2PJoints to be analyzed.

property Model: N2PModelContent#

Model to be analyzed. It is a compulsory input and an error will occur if it is not present.

property PlateList: list[N2PPlate]#

Property that returns the list of N2PPlates.

property Thresh: float#

Tolerance used in the obtention of the N2Joints in C#. 2.0 by default.

calculate() None[source]#

Method used to do all the previous calculations.

Calling example:
>>> fasteners.calculate()
flip_plates() None[source]#

Method used to flip some plate lists.

Calling example:
>>> fasteners.flip_plates( )
get_attachments() None[source]#

Method used to obtain the list of N2PAttachments and calculate their pitch. The get_joints() method must be used before this one. Otherwise, an error will occur.

Calling example:
>>> fasteners.get_attachments()
get_distance() None[source]#

Method used to obtain the distance from every N2PPlate’s edge to its N2PJoint, the intersection between an N2PPlate and its N2PJoint and the perpendicular direction to the N2PPlates. The get_joints() method must be used before this one. Otherwise, an error will occur.

Calling example:
>>> fasteners.get_distance()
get_joints() None[source]#

This method is used to create all N2PJoints, N2PPlates and N2PBolts and assign them certain useful attributes. In order to work, the n2joints and model attributes must have been previously filled. If they have not, an error will occur.

The following steps are followed:

1. All N2Joints are created differently depending on the user’s inputs. 1. All N2PJoints are created. Inside this, all N2PBolts and N2PPlates associated to each N2PJoint are also created. 2. All N2PBolts, N2PPlates are assigned its corresponding N2PElements and N2PNodes. Also, N2PJoints are assigned its bolt’s N2PElements and N2PNodes, as well as its plates’ N2PElements and N2PNodes.

Calling example:
>>> fasteners.get_joints()

NaxToPy.Modules.Fasteners.N2PGetLoadFasteners module#

NaxToPy.Modules.Fasteners.N2PUpdateFastener module#

class NaxToPy.Modules.Fasteners.N2PUpdateFastener.N2PUpdateFastener(model: N2PModelContent, information: dict | list, id_list: list = None, stiffness_method: str = 'HUTH')[source]#

Bases: object

This class stores information about fasteners and provides methods to update their stiffness and generate a new FEM Input File (.bdf, .fem, .dat, etc.) file with the updated data.

Fastener information can be input either as a dictionary (for a single type of fastener) or as a list of dictionaries (for multiple types). Each dictionary must include at least the keys for diameter [“D”] and elastic modulus [“E”]. Optional keys include head height [“h_head”], nut height [“h_nut”], Poisson ratio [“nu”], shear modulus [“G”], connection type (“bolt” or “rivet”) [“connection_type”], shear type (“simple” or “double”) [“shear_type”], and the beta value for Nelson method [“beta”].

IDs of fasteners to be updated can be provided as either a single list (for a single type of fastener) or as a list of lists (for multiple types). If no list of IDs is provided, all fasteners in the model will be updated.

When multiple types of fasteners are used, the order of the list of dictionaries must match the order of the list of ID lists to ensure proper mapping of variables.

Supported methods for stiffness calculation include HUTH, TATE_ROSENFELD, SWIFT, BOEING, GRUMMAN, and NELSON.

Example

Example 1:

>>> import NaxToPy as n2p
>>> model = n2p.load_model("model.dat")
>>> info1 = {"D": 4.8,
...         "E": 110000}
>>> info2 = {"D": 7.2,
...         "E": 70000,
...         "connection_type": "rivet",
...         "shear_type": "double"}
>>> ele1 = [1000, 1001, 1002]
>>> ele2 = [2000, 2001, 2002]
>>> update1 = N2PUpdateFastener(model, [info1, info2], [ele1, ele2], "BOEING")
>>> update1.calculate() # This will update the model in memory with the information of the object.
>>> model.ModelInputData.rebuild_file() # With the model updated, the model is rewritten

Example 2:

>>> model = n2p.load_model("model.dat")
>>> update2 = N2PUpdateFastener(model, {}) # Create the object without information
>>> update2.IDList = [3000, 3001, 3002] # Add the information using it properties
>>> update2.StiffnessMethod = "GRUMMAN"
>>> update2.FastenerInformation = {3000: {"D": 4.8, "E": 70000, "connection_type": "rivet"},
...                                3001: {"D": 6.8, "E": 70000, "connection_type": "bolt"},
...                                3002: {"D": 7.2, "E": 70000, "shear_type": "double"}}
>>> update2.calculate() # This will update the model in memory with the information of the object.
>>> model.ModelInputData.rebuild_file() # With the model updated, the model is rewritten
property FastenerInformation: dict#

Returns the dictionary mapping each fastener with its properties

property IDList: list | list[list]#

Returns the list of fasteners to be updated

property InfoDicts: dict | list[dict]#

Returns the list of dictionaries containing the fastener information

property StiffnessMethod: str#

Returns the name of the method used to calculate the fastener stiffness

calculate() None[source]#

Update properties of fasteners in a model.

Reads a model from a BDF file and updates the properties of PFAST and PBUSH elements. If a list of fastener IDs is provided, it updates the properties of those elements.

Parameters:

"None"

Returns:

“None”

write_bdf(out_folder: str)[source]#

Module contents#