N2PGetLoadFastener Module#

class NaxToPy.Modules.static.fasteners.N2PGetLoadFasteners.N2PGetLoadFasteners[source]#

Bases: object

The N2PGetLoadFasteners class is used to calculate the bearing and bypass loads of a collection of joints. The constructor creates an empty N2PGetLoadFasteners instance. Its attributes must be added as properties.

Example

>>> import NaxToPy as n2p
>>> from NaxToPy.Modules.static.fasteners.N2PGetFasteners import N2PGetFasteners
>>> from NaxToPy.Modules.static.fasteners.N2PGetLoadFasteners import N2PGetLoadFasteners
>>> model1 = n2p.get_model(r"route.fem") # model loaded
>>> fasteners = N2PGetFasteners()
>>> fasteners.Model = model1 # compulsory input
>>> fasteners.ElementList = model1.get_elements([10, 11, 12, 13, 14]) # joints to be analysed
>>> fasteners.calculate()
>>> fasteners.assign_diameter(model1.get_elements([10, 11, 12]), 6.0) # Some joints are assigned a certain diameter
>>> loads = N2PGetLoadFasteners()
>>> loads.GetFasteners = fasteners # Compulsory input
>>> loads.ResultsFiles = [r"route1.op2", r"route2.op2", r"route3.op2"] # The desired results files are loaded
>>> loads.OptionalAttributes.AdjacencyLevel = 3 # A custom adjacency level is selected (optional)
>>> loads.LoadCases = loads.Model.get_load_case([1, 2, 133986]) # Only some loadcases are analysed (optional)
>>> loads.OptionalAttributes.CornerData = True # The previous load cases have corner data (optional)
>>> # Some bypass parameters are changed (optional and not recommended)
>>> loads.OptionalAttributes.MaxIterations = 50
>>> loads.OptionalAttributes.ProjectionTolerance = 1e-6
>>> loads.OptionalAttributes.DefaultDiameter = 3.6 #  Joints with no previously assigned diameter will get this diameter (optional)
>>> loads.AnalysisName = "Analysis_1" # Name of the file where the results will be exported (optional)
>>> loads.ExportLocation = r"path" # Results are to be exported to a certain path (optional)
>>> loads.TypeAnalysis = "PAG" # The analysis will be made in the PAG style (optional)
>>> loads.TypeExport = "HDF5" # Results will be exported in the PAG HDF5 style (optional)
>>> loads.OptionalAttributes.ExportPrecision = 8 # Results will be exported to the HDF5 file with double precision
>>> loads.OptionalAttributes.CompressionEqualsZero = False # Certain bearing parameters are modified
>>> loads.OptionalAttributes.PullThroughAsIs = False
>>> loads.OptionalAttributes.ShearAsIs = False
>>> loads.calculate() # calculations will be made and results will be exported

Instead of using loads.GetFasteners, the user could also set these attributes:

>>> loads.Model = model1 # the same model is loaded, required input
>>> loads.JointsList = fasteners.JointsList[0:10] # only a certain amount of joints is loaded, required input
>>> loadFasteners.calculate() # calculations will be made with all of the default parameters and, therefore, results will not be exported.
calculate()[source]#

Method used to do all the previous calculations and, optionally, export the results.

Calling example:
>>> loads.calculate()
export_results()[source]#

Method used to export the obtained results to a CSV file.

Calling example:
>>> loads.export_results()
get_analysis(loadCaseList: list[N2PLoadCase] = None)[source]#

Method used to do the previous analysis and, optionally, export the results.

Parameters:

loadCaseList – list[N2PLoadCase] -> load cases to be analysed

Calling example:
>>> loads.get_analysis(loads.LoadCases[0:10])
get_bypass_box()[source]#

Method used to obtain the bypass box and to know what elements to ask results for. Also, if no load cases have been selected, all of them are.

Calling example:
>>> loads.get_bypass_box()
get_bypass_loads(loadCaseList: list[N2PLoadCase] = None)[source]#

Method used to obtain the bypass loads of each joint. If an N2PJoint has no diameter, the default diameter is assigned (in case it has been defined by the user). In order to work, the results attribute must have been previously filled (by having called get_results_joints()). If it has not, an error will occur.

Parameters:

loadCaseList – list[N2PLoadCase] -> load cases to be analysed

Calling example:
>>> loads.get_bypass_loads(loads.LoadCases[0:10])
get_forces(loadCaseList: list[N2PLoadCase] = None)[source]#

Method used to obtain the 1D forces of each joint. In order to work, the results attribute must have been previously filled (by having called get_results()). If it has not, an error will occur.

Parameters:

loadCaseList – list[N2PLoadCase] -> load cases to be analysed

Calling example:
>>> loads.get_forces(loads.LoadCases[0:10])
get_results(loadCaseList: list[N2PLoadCase] = None)[source]#

Method used to obtain the results of the model.

The following steps are followed:

1. Results are obtained with the get_results() function. Its outputs are, (a), the results per se, (b), the results in the corners, in case that it has been asked, and (c), the list of broken load cases, that is, the list of load cases that lack an important result. 2. If there are some broken load cases, they are removed from the _load_cases attribute and. If all load cases were broken (meaning that the current _load_cases attribute is empty), an error is displayed.

Parameters:

loadCaseList – list[N2PLoadCase] -> load cases to be analysed

Calling example:
>>> loads.get_results(loads.LoadCases[0:10])
get_results_h5(loadCaseList: list[N2PLoadCase] = None)[source]#

Method used to obtain the results of the model from a .h5 file and assign them to plates and bolts.

Parameters:

loadCaseList – list[N2PLoadCase] -> load cases to be analysed

Calling example:
>>> loads.get_results_h5(loads.LoadCases[0:10])
load_h5()[source]#

Method used to load the results obtained from a previous N2PGetLoadFastener analysis from a .h5 file.

Calling example:
>>> loads.load_h5()
property AnalysisName: str#

Property that returns the analysis_name attribute, that is, the name of the file in which results will be extracted.

property BypassResults: str#

Property that returns the bypass_results attribute, that is, the results obtained from a .h5 file.

property ExportLocation: str#

Property that returns the export_location attribute, that is, the path in which the results files will be created.

property GetFasteners: N2PGetFasteners#

Property that returns the get_fasteners attribute, that is, the N2PGetFasteners object from which fasteners are extracted.

property ISAMIOptions: _N2PISAMIOptions#

configurable values written into the ISAMI workbooks (ContactSide, YieldOrUltimate, ConfigurationType, ShearType, ConditioningType, OperatingTemp). Only relevant when TypeExport == “ISAMI”. Override its attributes before calling calculate()/export_results().

Type:

Property that returns the isami_options attribute

property ISAMITemplate: str#

Property that returns the isami_template attribute, that is, a folder overriding the bundled ISAMI templates. It must contain MFH_template_Input.xlsx and/or CFH_template_Input.xlsm. If None, the templates bundled with NaxToPy are used. Only relevant when TypeExport == “ISAMI”.

property JointsList: list[N2PJoint]#

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

property LoadCases: list[N2PLoadCase]#

Property that returns the load_cases attributes, that is, the list of the load cases to be analyzed.

property Model: N2PModelContent#

Property that returns the model attribute, that is, the reduced model that is created to do the analysis.

property OptionalAttributes#

Property that returns the optional_attributes attribute, that is, the class used to insert the optional attributes.

property PlateList: list[N2PPlate]#

Property that returns the plate_list attribute, that is, the list of N2PPlates to be analyzed.

property ResultsFiles: list[str]#

Property that returns the results_files attribute, that is, the results files to be analysed.

property TypeAnalysis: Literal['N2P', 'PAG', 'ALTAIR']#

Property that returns the path where the type_analysis attribute, that is, whether the results are analyzed in the Altair or PAG style.

property TypeExport: Literal['ALTAIR', 'TXT', 'CSV', 'HDF5', 'REDUCED_HDF5', 'ISAMI']#

Property that returns the type_export attribute, that is, whether the results are exported in a txt, csv, h5 file, or as Airbus ISAMI input workbooks (“ISAMI”).