N2PGetFasteners User Manual#

Overview#

N2PGetFasteners is a NaxToPy module which provides geometrical information about fasteners in a model. It can be used individually in order to identify joints in a model or used before the N2PGetLoadFasteners class, which provides information about the loads that fasteners experience.

Example Usage#

In order to use the program, the user should call basically all functions previously explained. Several examples will be given in order to accurately represent most of the ways that this program can be used.

1. Model reading#

Firstly, the model must be loaded, so the “load_model” must be used.

Consider the case when one wants to load a .fem model, and all elements are to be loaded:

import NaxToPy as n2p 

model = n2p.load_model(r"C:\user\models\FEMModel.fem")

Of course, one could load other type of models, such as .op2 files:

import NaxToPy as n2p 

model = n2p.load_model(r"C:\user\models\OP2model.op2")

Consider the case when one wants to load only a certain part of the model, for example, a list of N2PElements whose IDs range from 1000 to 1100 (with part ID”Wing”) and 2000 to 2100 (with part ID”Motor”):

import NaxToPy as n2p 

elementsDictionary = {
    "Wing": list(range(1000, 1100)), 
    "Motor": list(range(2000, 2100))
} 

model = n2p.load_model(r"C:\user\models\FEMModel.fem", 
    filter = "ELEMENTS", dict_gen = elementsDictionary) 

Consider the case when one wants to load, for example, a list of N2PNodes whose IDs range from 10000 to 15000 (with part ID”0”):

import NaxToPy as n2p 

nodesDictionary = {"0": list(range(10000, 15000))}

model = n2p.load_model(r"C:\user\models\FEMModel.fem",
    filter = "NODES", dict_gen = nodesDictionary) 

Consider the case when one wants to load, for example, all elements with part IDs equal to “0” and “1”:

import NaxToPy as n2p 

partsDictionary{"0": [], "1": []}

modeln2p.load_model(r"C:\user\models\FEMModel.fem", 
    filter = "PARTS", dict_gen = partsDictionary) 

Consider the case when one wants to load, for example, all elements with property ID equal to 20000000 (with part ID”0”):

import NaxToPy as n2p 

propertyDict{"0": [20000000]}

model = n2p.load_model(r"C:\user\models\FEMModel.fem",
    filter = "PROPERTIES", dict_gen = propertiesDict) 

2. Calling the Module#

Now that a model has been loaded, the user should create the N2PGetFasteners instance and load the model in order to then obtain the joints:

import NaxToPy as n2p
from NaxToPy.Modules.Fasteners.N2PGetFasteners import N2PGetFasteners 

model = n2p.load_model(r"C:\user\models\FEMModel.fem")

fasteners = N2PGetFasteners()
fasteners.Model = model 

Following this, the user could analyse all joints in the model or select the ones they want to analyse. Firstly, consider the case when the user wants to analyse all joints in the model:

import NaxToPy as n2p 

from NaxToPy.Modules.Fasteners.N2PGetFasteners import N2PGetFasteners 

model = n2p.load_model(r"C:\user\models\FEMModel.fem")

fasteners = N2PGetFasteners() 
fasteners.Model = model 
fasteners.get_joints()
fasteners.get_distance()
fasteners.get_attachments() 

The user has obtained all joints and attachments, but this could have been done in an easier way:

import NaxToPy as n2p 
from NaxToPy.Modules.Fasteners.N2PGetFasteners import N2PGetFasteners 

model = n2p.load_model(r"C:\user\models\FEMModel.fem")

fasteners = N2PGetFasteners() 
fasteners.Model = model 
fasteners.calculate() 

Had the user not wanted to obtain the attachments, they could have simply not used the “get_attachments” method in the first case, or done this:

import NaxToPy as n2p 
from NaxToPy.Modules.Fasteners.N2PGetFasteners import N2PGetFasteners 

model = n2p.load_model(r"C:\user\models\FEMModel.fem")

fasteners = N2PGetFasteners() 
fasteners.Model = model 
fasteners.GetAttachmentsBoolFalse
fasteners.calculate() 

Now, let us consider the case when the user only wants to analyse certain joints, for example, for example, those with Part ID: “0” and Solver ID: 1000, 1001, 1002 and 1003:

import NaxToPy as n2p 
from NaxToPy.Modules.Fasteners.N2PGetFasteners import N2PGetFasteners 

model = n2p.load_model(r"C:\user\models\FEMModel.fem")

fasteners = N2PGetFasteners() 
fasteners.Model = model 
fasteners.ElementList = model.get_elements(
    [(0, 1000),
    (0, 1001),
    (0, 1002),
    (0, 1003)]
) 

fasteners.calculate() 

Now, consider the case when the user wants to obtain all bolts in the model (or only a certain part; in that case, an additional attribute would have to be set, in the same way as in the previous examples), but they are to be obtained with a slightly lower threshold for the numerical calculations in C#:

import NaxToPy as n2p 
from NaxToPy.Modules.Fasteners.N2PGetFasteners import N2PGetFasteners 

model = n2p.load_model(r"C:\user\models\FEMModel.fem")

fasteners=N2PGetFasteners() 
fasteners.Model = model 
fasteners.Thresh = 1.5
fasteners.calculate() 

Model Reading#

The model reading is made using the “load_model” function (which is located in N2PModelContent). It has the following inputs:

  • path: string (compulsory input) corresponding to the location of the .fem file. It supports .fem, .bdf, .inp, .op2, .xdb, .odb, .h5, .h3d and .rst files.

  • parallelprocesing: Boolean (non-compulsory input) which shows if the low libraries open the result files in several procedures or not.

  • file_type: string (non-compulsory input) which can be “Binary” or “InputFileNastran”.

  • dict_gen: dictionary (non-compulsory input) that represents what parts are to be loaded in the model. By default, all of the model is loaded. If this is an input, “filter” must also be an input. There are several possibilities in order to only load some of the model:

    • Filter by elements: the dictionary should have the following structure:

{Part ID: List of N2PElements Solver ID}

  • Filter by properties: the dictionary should have the following structure:

{Part ID: List of N2PProperty ID}

  • Filter by parts: the dictionary should have the following structure:

{Part ID: []}

  • Filter by nodes: the dictionary should have the following structure:

{Part ID: List of N2PNodes Solver ID}

  • filter: string (non-compulsory input) that represents how the previous filter is being done. It has the following options: “ELEMENTS”, “PROPERTIES”, “PARTS”, and “NODES”. If this is an input, “dict_gen” must also be an input.

Its output is an N2PModelContent object, which has all of the necessary information about the model.

Take note that the user should load here a model which includes enough elements close to the joints, as the calculation of the bypass loads will not be satisfactory otherwise. However, loading a big model should not be a problem.

Also note that, in order to obtain a correct analysis, the loaded model must include fasteners in a correct position, which is the case, for example, in .fem files. However, Nastran .op2 files may not include fasteners if the Nastran version is older than 2010 approximately, or they may be in the wrong position (parallel to the surface instead of perpendicular) if the Nastran version is older than 2018.

Class Breakdown#

The class N2PGetFasteners provides geometrical information about fasteners in a model. There are four distinct elements (each in a different class) that will be used in the analysis, which are:

  • N2PJoint: an N2PJoint is the union of one N2PBolt and several N2PPlates. Each N2PJoint can be identified by its ID, which is a unique internal identifier.

  • N2PAttachment: an N2PAttachment is a series of N2PJoints that join the same N2PPlates. Each N2PAttachment can be identified by its ID, which is a unique internal identifier.

  • N2PBolt: an N2PBolt is a part of an N2PJoint, which may contain several 1D elements. Each N2PBolt can be identified by its ID, which is a unique internal identifier. An N2PBolt shares its ID with its associated N2PJoint.

  • N2PPlate: an N2PPlate is a part of an N2PJoint, which may contain several 2DD elements (such as CQUAD4). Each N2PPlate can be identified in several ways, but the most important one is its ID, which is a unique internal identifier inside the joint (that is, an N2PPlate could be univocally described by its N2PJoint and its internal ID). An N2PPlate can also be identified by its Attachment ID, which is a unique internal identifier inside the attachment.

This class has the following properties:

  • Model: N2PModelContent object (compulsory input) defining the model with the results of the load cases already inside it. This attribute must be a N2PModelContent instance, or an error will occur.

  • GetAttachmentsBool: Boolean (non-compulsory input) defining whether or not attachments are to be obtained. By default, it is set to True, so attachments will be obtained. This attribute must be a boolean, or an error will occur.

  • Thresh: float (non-compulsory input) that represents a tolerance value used for numerical calculations in C#. By default, it is set to 2.0. This attribute must be a float (or an integer that will be transformed into a float), or an error will occur.

  • ElementList: list of N2PElements (non-compulsory input) that represent the fasteners to be analysed. If this attribute is not filled, the program will analyse all fasteners in the model. This attribute must be a list, tuple or set of N2PElement instances, or a single N2PElement instance, or an error will occur. If one or more items of the list (or tuple, or set) are not N2PElements, they will be removed from the list and a warning will appear.

  • JointsList: list of N2PJoint objects generated by the program.

  • PlateList: list of N2PPlate objects generated by the program.

  • BoltsList: list of N2PBolt objects generated by the program.

  • AttachmentsList: list of N2PAttachment objects generated by the program (if GetAttachmentsBool is set to True).

Auxiliar Classes#

The program makes use of four classes, which will be explained in detail here.

N2PBolt#

As explained before, an N2PBolt is a part of a N2PJoint (which will be explained later on) that is created when its associated N2PJoint is created in the “get_joints” method. It has the following properties:

  • ID: integer that represents the bolt’s unique internal identifier. It is obtained from the C# N2Bolt class the moment the bolt is created. An N2PBolt’s ID is exactly the same as its associated N2PJoint’s ID.

  • OneDimElemsIDList: list of integers that represent the unique internal identifier of every 1D element that makes up the bolt. It is obtained from the C# N2Bolt class the moment the bolt is created. It is exactly the same as the “ElementsInternalID” property.

  • Cards: list of N2PCard objects that represent the cards of each 1D element that makes up the bolt. It is obtained from the C# N2Bolt class the moment the bolt is created if the loaded model includes “ModelInputData”. If it does not, this attribute will be an empty list.

  • Type: string that represents the type of bolt. It is obtained from the C# N2Bolt class the moment the bolt is created. It is exactly the same as its associated N2PJoint’s “TypeFastener” property.

  • Joint: N2PJoint object which is associated to the bolt. It is obtained the moment the N2PJoint is created.

  • ElementList: list of N2PElement objects that make up the bolt. It is obtained in the “get_joints” method.

  • ElementIDList: list of integers that represent the Solver ID of all elements that make up the bolt. It can be obtained once the “ElementList” attribute has been obtained.

  • ElementInternalIDList: list of integers that represent the Internal ID of all elements that make up the bolt. It can be obtained once the “Elements” attribute has been obtained.

  • NodeList: list of lists of N2PNode objects. There are as many lists as there are elements in the bolt, and there are two nodes inside those lists. It can be obtained once the “ElementList” attribute has been obtained.

  • PartID: string which represents the Part ID of the elements that make up the bolt. It can be obtained once the “Elements” attribute has been obtained.

  • ElementLocalSystemForce: dictionary which represents the force that every element in the joint experiences in the local reference frame. It is obtained in the “get_forces” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are dictionaries. The keys of these dictionaries are the Solver ID of the N2PElements that make up the bolt (as set in the “ElementIDList” property), while their values are the forces (which are lists of three floats). Therefore, its structure is

{Load Case ID: {N2PElement Solver ID: [FX, FY, FZ]}}

  • AxialForce: dictionary which represents the axial force that each element in the joint experiences in the material reference frame of the joint’s first plate. It is obtained in the “get_forces” method. The force will be positive if the bolt is extended, or zero if the bolt is contracted. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are dictionaries. The keys of these dictionaries are the Solver ID of the N2PElements that make up the bolt (as set in the “ElementIDList” property), while their values are the forces (which are floats). Therefore, its structure is

{Load Case ID: {N2PElement Solver ID: F}}

  • ShearForce: dictionary which represents the shear force that each element in the joint experiences in the material reference frame of the joint’s first plate. It is obtained in the “get_forces” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are dictionaries. The keys of these dictionaries are the Solver ID of the N2PElements that make up the bolt (as set in the “ElementIDList” property), while their values are the forces (which are floats). Therefore, its structure is

{Load Case ID: {N2PElement Solver ID: F}}

  • MaxAxialForce: dictionary that represents the maximum axial force that the bolt experiences. It is obtained in the “get_forces” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (which are floats). Therefore, its structure is

{Load Case ID: F}

  • LoadAngle: dictionary that represents the load angle of each element in the joint. It is obtained in the “get_forces” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are dictionaries. The keys of these dictionaries are the Solver ID of the N2PElements that make up the bolt (as set in the “ElementIDList” property), while their values are the angles (which are floats) in degrees. Therefore, its structure is

{Load Case ID: {N2PElement Solver ID: Angle}}

N2PPlate#

As explained before, an N2PPlate is a part of a N2PJoint (which will be explained later on) that is created when its associated N2PJoint is created in the “get_joints” method. It has the following properties:

  • ID: integer that represents the plate’s unique internal identifier inside the joint (therefore, in order to fully describe an N2PPlate, one would have to specify its N2PJoint and its ID). It is obtained from the C# N2Plate class the moment the plate is created.

  • GlobalID: list of integers that represent the plate’s Global ID, which is a unique internal identifier (so one could also fully describe an N2PPlate using this attribute). It is obtained from the C# N2Plate class the moment the plate is created.

  • SolverID: list of integers that represents the plate’s Solver ID, which is not necessarily unique. It is obtained from the C# N2Plate class the moment the plate is created.

  • PlateCentralCellSolverID: integer that represents the Solver ID of a representative element of the plate. Of course, if there is only one element in the plate, this ID will be the same as the one in the “SolverID” attribute and, in any case, this ID must be included in “SolverID”. It is obtained from the C# N2Plate class the moment the plate is created.

  • Cards: list of N2PCard objects that represents the cards of the elements in the plate. It is obtained from the C# N2Plate class the moment the plate is created if the loaded model includes “ModelInputData”. If it does not, this attribute will be an empty list.

  • Joint: N2PJoint object associated to the plate. It is obtained in the “get_joints” method.

  • Bolt: N2PPlate object associated to the plate. It can be obtained once the “Joint” attribute has been obtained.

  • ElementList: list of N2PElements that make up the plate. It is obtained in the “get_joints” method.

  • BoltElementList: dictionary of the CFASTs that are attached to the plate. The keys of this dictionary are “A” and “B”, representing the possible CFAST type, and its values are either the CFAST N2PElements or None, if there are no A or B CFASTs. It is obtained in the “update_elements” method.

  • BoltDirection: dictionary of the orientation of the CFASTs that are attached to the keys of this dictionary are “A” and “B” as well, and its values may be “->”, “<-” or None. It is obtained in the “update_elements” method.

  • CFASTFactor: dictionary of the multiplication factor to be applied in the translational forces. Its keys are “A” and “B”, and its values may be 0, 1 or -1. It is obtained in the “update_elements” method.

  • ElementIDList: list of integers that represent the Solver ID of all elements that make up the plate. It can be obtained once the “ElementList” attribute has been obtained.

  • ElementInternalIDList: list of integers that represent the Internal ID of all elements that make up the plate. It can be obtained once the “ElementList” attribute has been obtained.

  • NodeList: list of lists of N2PNode objects. There are as many lists as there are elements in the plate, and there are several nodes inside those lists. It can be obtained once the “ElementList” attribute has been obtained.

  • PartID: list of strings which represent the Part ID of the elements that make up the plate. It can be obtained once the “ElementList” attribute has been obtained.

  • AttachmentID: integer that represents the unique internal identifier of the plate inside the attachment. It is obtained in the “get_attachments” method.

  • Intersection: list of three floats that represent the point where the joint crosses the plate. It is obtained in the “get_distances” method.

  • Distance: float that represents the distance from the plate’s edges to its joint. It is obtained in the “get_distances” method.

  • Normal: list of three floats that represents the perpendicular direction to the plate. It is obtained in the “get_distances” method.

  • BearingForce: dictionary that represents the 1D bearing force that the plate experiences. It is obtained in the “get_forces” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (which are lists of three floats). Therefore, its structure is

{Load Case ID: [FX, FY, FZ]}

  • TranslationalFastenerForces: dictionary that represents the force that each element in the bolt’s plate experiences in the local reference frame. It is obtained in the “get_forces” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are two lists of three floats each, corresponding to the two (potential) elements that make up the bolt. If there is only one bolt element attached to the plate, the second list will be filled with zeros.

{Load Case ID: [[FX1, FY1, FZ1], [FX2, FY]]}

  • NxBypass: dictionary that represents the bypass load that the plate experiences in the x-axis. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (is a float). Therefore, its structure is

{Load Case ID: F}

  • NxTotal: dictionary that represents the total load that the plate experiences in the x-axis. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (is a float). Therefore, its structure is

{Load Case ID: F}

  • NyBypass: dictionary that represents the bypass load that the plate experiences in the y-axis. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (is a float). Therefore, its structure is

{Load Case ID: F}

  • NyTotal: dictionary that represents the total load that the plate experiences in the y-axis. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (is a float). Therefore, its structure is

{Load Case ID: F}

  • NxyBypass: dictionary that represents the bypass load that the plate experiences in the xy-axis. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (is a float). Therefore, its structure is

{Load Case ID: F}

  • NxyTotal: dictionary that represents the total load that the plate experiences in the xy-axis. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (is a float). Therefore, its structure is

{Load Case ID: F}

  • MxTotal: dictionary that represents the total moment that the plate experiences in the x-axis. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the moments (is a float). Therefore, its structure is

{Load Case ID: M}

  • MyTotal: dictionary that represents the total moment that the plate experiences in the y-axis. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the moments (is a float). Therefore, its structure is

{Load Case ID: M}

  • MxyTotal: dictionary that represents the total moment that the plate experiences in the xy-axis. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the moments (is a float). Therefore, its structure is

{Load Case ID: M}

  • BypassMax: dictionary that represents the maximum bypass load that the plate experiences. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (is a float). Therefore, its structure is

{Load Case ID: F}

  • BypassMin: dictionary that represents the minimum bypass load that the plate experiences. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are the forces (is a float). Therefore, its structure is

{Load Case ID: F}

  • BypassSides: dictionary that represents the bypass fluxes in the sides of the box. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values

  • BoxDimension: float that represents the length of the side of the box used in the bypass calculations. It is obtained in the “get_bypass_loads” method.

  • BoxSystem: list of nine floats that represents the reference frame associated to the box used in the bypass calculations. The first set of three numbers define the x-axis, the second define the y-axis and the third define the z-axis. It is obtained in the “get_bypass_loads” method.

  • BoxFluxes: dictionary that represents the fluxes of each point in the box used in the bypass calculations. It is obtained in the “get_bypass_loads” method. The dictionary’s keys are the IDs of the load cases that have been analysed, while its values are dictionaries. The keys of these dictionaries are integers ranging from 1 to 8 (1, 2, …, 8), representing each of the points that define the box, while their values are the fluxes. The fluxes are lists of six floats, representing, in this order, the Fxx, Fyy, Fxy, Mxx, Myy and Mxy fluxes. Therefore, its structure is:

{Load Case ID: {1: [Fxx, Fyy, Fxy, Mxx, Myy, Mxy], …, 8: […]}}

N2PJoint#

As explained before, an N2PJoint is the union of one single N2PBolt and several N2PPlates, and is created in the “get_joints” method. This class has the following properties:

  • Diameter: float (non-compulsory input) that represents the joint’s diameter. It will be used in the bypass calculations and joints with no diameter will be skipped. A joint can be assigned its diameter either manually by the user, or automatically by the program in the “get_bypass_joints” method. This value must be a float (or an integer that will be transformed to a float).

  • Bolt: N2PBolt object associated to the joint. It is obtained from the C# N2Joint class the moment the joint is created.

  • ID: integer that represents the joint’s unique internal identifier. An N2PJoint’s ID is exactly the same as its associated N2PBolt’s ID because it is set here. It is obtained the moment it is created.

  • TypeFastener: string that represents the type of bolt. It is obtained the moment it is created. It is identical to the “Type” attribute of its N2PBolt.

  • PlateList: list of N2PPlates object associated to the joint. It is obtained from the C# N2Joint class the moment the joint is created. However, sometimes some of the plates created will be repeated, so they are filtered and only the unique plates remain.

  • PartID: string that represents the joint’s part ID. It can be obtained after the “get_joints” method is used.

  • BoltElementList: list of N2PElement objects that represents the elements that make up the joint’s bolt. It can be obtained after the “get_joints” method is used.

  • BoltElementIDList: list of integers that represents the Solver ID of the elements that make up the joint’s bolt. It can be obtained after the “get_joints” method is used.

  • BoltElementInternalIDList: list of integers that represent the Internal ID of the elements that make up the joint’s bolt. It can be obtained after the “get_joints” method is used.

  • BoltNodeList: list of lists of N2PNode objects. There are as many lists as there are elements in the bolt, and there are two nodes inside those lists. It can be obtained after the “get_joints” method is used.

  • PlateElementList: list of lists of N2PElements that make up each of the joint’s plates. There are as many lists as there are plates in the joint. It can be obtained after the “get_joints” method is used.

  • PlateElementIDList: list of lists of integers that represents the Solver ID of all elements that make up each plate of the joint. There are as many lists as there are plates in the joint. It can be obtained after the “get_joints” method is used.

  • PlateElementInternalIDList: list of lists of integers that represents the Internal ID of all elements that make up each plate of the joint. There are as many lists as there are plates in the joint. It can be obtained after the “get_joints” method is used.

  • PlateNodeList: list of lists of lists of N2PNode objects. There are as many external lists as there are plates in the joint, and there are as many internal lists as there are elements in the plate, and those lists are filled with several nodes. It can be obtained after the “get_joints” method is used.

  • PlatePartID: list of lists of strings that represent the Part ID of all elements that make up each plate of the joint. There are as many lists as there are plates in the joint. It can be obtained after the “get_joints” method is used.

  • Attachment: N2PAttachment object that represents the attachment the joint is part of, if it exists.

  • Pitch: float that represents the joint’s pitch, that is, the minimum distance from an N2PJoint to its neighbours in case that the joint is part of an attachment.

N2PAttachment#

As explained before, an N2PAttachment is the union of several N2PJoints that connect the same N2PPlates. It is created in the “get_attachments” method. It has the following properties:

  • ID: integer that represents the attachment’s unique internal identifier. It is obtained the moment it is created.

  • AttachedPlatesIDList: list of integers that represent the Attachment IDs of the plates that make up the attachment. It is obtained the moment it is created.

  • AttachedPlateList: list of N2PPlate objects that represents the plates that make up the attachment. It is obtained the moment it is created.

  • JointsList: list of N2PJoint objects that represents the joints that make up the attachment. It is obtained the moment it is created.

  • Pitch: float that represents the minimum distance from a joint that makes up the attachment to its neighbour(s). It is obtained in the “get_attachments” method.

N2PJoints creation#

Firstly, all N2PJoints, N2PPlates and N2PBolts must be created and assigned their default attributes (such as ID, elements, nodes, etc.). This is done by using the “get_joints” method (which is located in N2PGetFasteners. The following steps are followed:

  1. All N2Joints are created from the C# core. By default, all joints in the model will be loaded and the threshold used in numerical calculations will be set to 2.0.

  2. All N2PJoints associated to the N2Joints are created and introduced into a list (JointsList). While creating each individual N2PJoint, one N2PBolt (obviously associated to the N2PJoint) is created, as well as several N2PPlates. The N2PJoint, N2PBolt and N2PPlates are assigned certain attributes here, as will be explained in their individual sections.

  3. N2PPlates are assigned their joint and N2PElements, and N2PBolts are assigned their N2PElements.

Finally, the log will show how much time was spent in this method.

Note that, in order to obtain the bypass loads (which will be done in another class, but will use these joints), joints need to have a diameter assigned to them and this is not done here. To do so, the “Diameter” attribute must be manually set by the user for each N2PJoint, or a default diameter (that also must be set by the user) will be used. For joints with no diameter, their bypass loads will not be calculated.

An error will occur if the “Model” attribute has not been not filled.

Distance obtention#

After all joints are created, N2PPlates should have some of its attributes filled, such as “Distance” (distance from the N2PPlate’s edge to its N2PJoint), “Intersection” (point where the N2PJoint crosses the N2PPlate), and “Normal” (perpendicular direction to the N2PPlate). This is done by using the “get_distance” method (which is located in N2PGetFasteners and has no inputs or outputs). This is done simply calling another “get_distance” method, which is located in the N2PJoint class. This method’s only input is:

  • model: N2PModelContent object defining the model. In N2PGetFasteners, this input is its “Model” attribute.

This method has no outputs. The following steps are followed:

  1. The plate’s “Intersection” attribute is set by adequately filtering the bolt’s nodes.

  2. The plate’s “Normal” attribute is set, as the plate’s plane can be defined by three points.

  3. All the elements that are attached to the element where the intersection point is located are retrieved and, immediately after, a list of segments that define the free edges of the attached elements is obtained.

  4. The distance between the intersection point and each segment is calculated and they are compared among them in order to find the minimum one, which is the desired value. After this, the “Distance” attribute is set.

Finally, the log will show how much time was spent in the N2PGetFasteners method.

In N2PGetFasteners, an error will occur if this method is used before the “get_joints” one. Furthermore, in N2PJoint, a warning will show up if one or more plates have no N2PElements assigned, and the “Distance” attribute will not be set.

N2PAttachment Usage#

Finally, the user should obtain all N2PAttachments in the model and calculate their pitch, which is done by using the “get_attachments” method (which is located in N2PGetFasteners and has no inputs or outputs).

N2PAttachments creation#

The creation of the attachments is done using another “get_attachments” method, which is located in the N2PGetAttachments class. This method’s inputs are the following:

  • model: N2PModelContent object defining the model. In N2PGetFasteners, this input is its “Model” attribute.

  • jointList: list of N2PJoint objects to be analysed. In N2PGetFasteners, this input is its “JointsList” attribute, so all created joints are analysed.

This method’s output is:

  • attachmentList: list of N2PAttachment objects created. In N2PGetFastener, the “AttachmentsList” attribute is assigned to this output.

In this method, the following steps are followed:

  1. The program searches every joint and every plate inside each joint and assesses if two bolts connect the same plate or not by looking at its adjacent elements. If the same plate connects two or more bolts, then those bolts, as well as that plate, are part of an attachment.

  2. After the existing attachments have been found, plates are given a new Attachment ID and the N2PAttachment objects are created and assigned their attributes, those being its ID, AttachedPlatesList, AttachedPlatesIDList, and JointsList.

Pitch calculation#

To calculate the attachment’s pitch (a bolt’s pitch is defined as the distance to the closest bolt in the attachment, while an attachment’s pitch is defined as the minimum pitch of a bolt in that attachment), the “get_pitch” method (which is located in N2PAttachment and has no inputs or outputs) is used. The following steps are followed:

  1. The intersection points between the bolts and plates of the attachment are determined, and the distances between those points are calculated. Therefore, this distance is actually the distance between the bolts that make up the attachment.

  2. Bolts are assigned the minimum distance between them and their neighbours in their “Pitch” attribute and attachments are assigned the minimum pitch of all bolts that make up the attachment in their “Pitch” attribute.

Finally, the log will show how much time was spent in the N2PGetFasteners method.

In N2PGetFasteners, the “get_joints” and “get_distances” method must be called in order to later use the N2PGetLoadFasteners class, but “get_attachments” does not have to be used, so it can be skipped in order to save some time. If the user used the “calculate” method with the “GetAttachmentsBool” attribute set to False, this method would not be called.

This method must be used after the “get_joints” one, or an error will occur. It could, however, be used before the “get_distances” one. Furthermore, in the “get_attachments” method in N2PGetAttachments, a warning will show up if a plate has no elements assigned to it and will be skipped, so the results obtained may not be correct.

N2PGetFasteners calculation#

While the user could perfectly call the three aforementioned methods individually, this may not be practical. By using the “calculate” method (which is located in N2PGetFasteners and has no inputs or outputs), the “get_joints” and “get_distance” methods are called and, if the “GetAttachmentsBool” attribute is set to True, the “get_attachments” method is also called.

References#

No references were used in this module


Idaero Icon

© 2025 Idaero Solutions S.L. All rights reserved.

This document is licensed under the terms of the LICENSE of the NaxToPy package.