NaxToPy 2.1.0__tar.gz → 2.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {naxtopy-2.1.0/src/NaxToPy.egg-info → naxtopy-2.1.2}/PKG-INFO +17 -2
- {naxtopy-2.1.0 → naxtopy-2.1.2}/README.md +16 -1
- {naxtopy-2.1.0 → naxtopy-2.1.2}/pyproject.toml +1 -1
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PComponent.py +17 -4
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PElement.py +15 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PFreeBody.py +2 -2
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PLoadCase.py +20 -14
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PNode.py +15 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PProperty.py +59 -60
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PResult.py +5 -5
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Constants/Constants.py +3 -3
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Errors/N2PLog.py +385 -17
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/N2PModelContent.py +226 -96
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Reference_Finder/__Reference_Finder.py +21 -22
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/N2PFastenerAnalysis.py +523 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Check/Validation.py +74 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Classes/AR1DElement.py +97 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Classes/ARAttachment.py +736 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Classes/ARBolt.py +1505 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Classes/ARPlate.py +97 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Classes/ARPlateElements.py +53 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARAuxiliarFunctions.py +193 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARBilinearInterpolation.py +148 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARConfigurationInput.py +76 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARDerivedLoadCases.py +143 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARFileInputRivetsIDs.py +148 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARGetAttachments.py +123 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARGetBolts.py +834 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARReadResultsFromFile.py +31 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARResults.py +206 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARRotation.py +223 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/ARSerialize.py +86 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Functions/__init__.py +1 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/__init__.py +1 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/__init__.py +2 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/N2PEnvelope/__init__.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Modules/N2PtoEXE/N2PtoEXE.py +15 -11
- naxtopy-2.1.2/src/NaxToPy/Modules/N2PtoEXE/__init__.py +1 -0
- naxtopy-2.1.2/src/NaxToPy/Modules/__init__.py +2 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/user_functions.txt +2 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2/src/NaxToPy.egg-info}/PKG-INFO +17 -2
- naxtopy-2.1.2/src/NaxToPy.egg-info/SOURCES.txt +72 -0
- naxtopy-2.1.0/src/NaxToPy/Modules/Fasteners/__init__.py +0 -1
- naxtopy-2.1.0/src/NaxToPy/Modules/__init__.py +0 -2
- naxtopy-2.1.0/src/NaxToPy.egg-info/SOURCES.txt +0 -50
- {naxtopy-2.1.0 → naxtopy-2.1.2}/LICENSE +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/setup.cfg +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/setup.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/AllClasses.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PConnector.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PCoord.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PIncrement.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PMaterial.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PModelInputData.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PReport.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PSection.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/N2PSet.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/ProgresBar.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Classes/__init__.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Constants/__init__.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Constants/librerias.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Errors/N2PColors.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Errors/N2PFileHandler.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Errors/__init__.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/Reference_Finder/__init__.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/_AuxFunc/_NetToPython.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/_AuxFunc/__init__.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Core/__init__.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Modules/Fasteners/N2PUpdateFastener.py +0 -0
- {naxtopy-2.1.0/src/NaxToPy/Modules/N2PtoEXE → naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis/Core/Classes}/__init__.py +0 -0
- {naxtopy-2.1.0/src/NaxToPy/Modules/N2PEnvelope → naxtopy-2.1.2/src/NaxToPy/Modules/Fasteners/_N2PFastenerAnalysis}/__init__.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/Modules/N2PEnvelope/N2PEnvelope.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/NaxToPy.ico +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy/__init__.py +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy.egg-info/dependency_links.txt +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy.egg-info/requires.txt +0 -0
- {naxtopy-2.1.0 → naxtopy-2.1.2}/src/NaxToPy.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: NaxToPy
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.2
|
|
4
4
|
Summary: Package for postprocessing FEM results in Python
|
|
5
5
|
Home-page: https://www.idaerosolutions.com/Home/NaxToPy
|
|
6
6
|
Download-URL: https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US
|
|
@@ -147,7 +147,7 @@ links on the left).
|
|
|
147
147
|
**NaxToPy** is a powerful tool for FEM analysis post-processing!
|
|
148
148
|
|
|
149
149
|
**CAUTION:** To use NaxToPy, [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US) must be installed.
|
|
150
|
-
This version is compatible with **NaxTo 2024.2**. It is compatible with all the steps of this version (2024.2.0, 2024.2.1, 2024.2.2, etc.).
|
|
150
|
+
This version is compatible with **NaxTo 2024.2**. It is compatible with all the steps of this version (2024.2.0, 2024.2.1, 2024.2.2, 2024.2.3, etc.).
|
|
151
151
|
Check in _Programs and Features_ the NaxTo version that is installed.
|
|
152
152
|
|
|
153
153
|
## Installation
|
|
@@ -275,6 +275,21 @@ It uses an object instaed of an int.
|
|
|
275
275
|
3. Formula check in new_derived_loadcase(), new_enevelope_loadcase() and new_derived_component().
|
|
276
276
|
4. New optional arguments if n2ptoexe() to add extra libaries, packages or files.
|
|
277
277
|
|
|
278
|
+
### v.2.1.1
|
|
279
|
+
1. Two new methods in N2PModelContent: load_user_coord_sys_from_csv() and set_user_coord_sys().
|
|
280
|
+
Also, there is a new property for N2PElement and N2PNode: UserSystemArray. This update allow the
|
|
281
|
+
user to define a different coordinate system for each element or node. To ask for the results
|
|
282
|
+
in this system, the optional argument `coordsys` must be equal to `-20`.
|
|
283
|
+
2. Bug fix: The checking for component and section in new_report() has been fixed. If a comma
|
|
284
|
+
appeared in the component or section name, the method failed.
|
|
285
|
+
|
|
286
|
+
### v.2.1.2
|
|
287
|
+
1. Internal change for speeding up the read of NastranInputFiles. Now the Nastran Cards are loaded
|
|
288
|
+
when they are asked and not all at once.
|
|
289
|
+
2. Improvement in error handling and log writing.
|
|
290
|
+
3. The function import_results_from_files() checks if the file exist. If not, it prints an error
|
|
291
|
+
but the execution doesn't crash.
|
|
292
|
+
|
|
278
293
|
# Documentation
|
|
279
294
|
|
|
280
295
|
**NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
|
|
@@ -23,7 +23,7 @@ links on the left).
|
|
|
23
23
|
**NaxToPy** is a powerful tool for FEM analysis post-processing!
|
|
24
24
|
|
|
25
25
|
**CAUTION:** To use NaxToPy, [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US) must be installed.
|
|
26
|
-
This version is compatible with **NaxTo 2024.2**. It is compatible with all the steps of this version (2024.2.0, 2024.2.1, 2024.2.2, etc.).
|
|
26
|
+
This version is compatible with **NaxTo 2024.2**. It is compatible with all the steps of this version (2024.2.0, 2024.2.1, 2024.2.2, 2024.2.3, etc.).
|
|
27
27
|
Check in _Programs and Features_ the NaxTo version that is installed.
|
|
28
28
|
|
|
29
29
|
## Installation
|
|
@@ -151,6 +151,21 @@ It uses an object instaed of an int.
|
|
|
151
151
|
3. Formula check in new_derived_loadcase(), new_enevelope_loadcase() and new_derived_component().
|
|
152
152
|
4. New optional arguments if n2ptoexe() to add extra libaries, packages or files.
|
|
153
153
|
|
|
154
|
+
### v.2.1.1
|
|
155
|
+
1. Two new methods in N2PModelContent: load_user_coord_sys_from_csv() and set_user_coord_sys().
|
|
156
|
+
Also, there is a new property for N2PElement and N2PNode: UserSystemArray. This update allow the
|
|
157
|
+
user to define a different coordinate system for each element or node. To ask for the results
|
|
158
|
+
in this system, the optional argument `coordsys` must be equal to `-20`.
|
|
159
|
+
2. Bug fix: The checking for component and section in new_report() has been fixed. If a comma
|
|
160
|
+
appeared in the component or section name, the method failed.
|
|
161
|
+
|
|
162
|
+
### v.2.1.2
|
|
163
|
+
1. Internal change for speeding up the read of NastranInputFiles. Now the Nastran Cards are loaded
|
|
164
|
+
when they are asked and not all at once.
|
|
165
|
+
2. Improvement in error handling and log writing.
|
|
166
|
+
3. The function import_results_from_files() checks if the file exist. If not, it prints an error
|
|
167
|
+
but the execution doesn't crash.
|
|
168
|
+
|
|
154
169
|
# Documentation
|
|
155
170
|
|
|
156
171
|
**NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
|
|
@@ -122,6 +122,7 @@ class N2PComponent:
|
|
|
122
122
|
0 : Global,
|
|
123
123
|
-1 : Material Coordinate System,
|
|
124
124
|
-10 : User defined,
|
|
125
|
+
-20 : Element/Node User Defined,
|
|
125
126
|
>0 : Solver ID of the Predefined Coordinate System.
|
|
126
127
|
|
|
127
128
|
v1: tuple -> Optional.
|
|
@@ -214,6 +215,7 @@ class N2PComponent:
|
|
|
214
215
|
0 : Global,
|
|
215
216
|
-1 : Material Coordinate System,
|
|
216
217
|
-10 : User defined,
|
|
218
|
+
-20 : Element/Node User Defined,
|
|
217
219
|
>0 : Solver ID of the Predefined Coordinate System.
|
|
218
220
|
|
|
219
221
|
v1: tuple -> Optional.
|
|
@@ -226,6 +228,12 @@ class N2PComponent:
|
|
|
226
228
|
|
|
227
229
|
Returns:
|
|
228
230
|
results: tuple(np.array, str)
|
|
231
|
+
|
|
232
|
+
Examples
|
|
233
|
+
>>> # N2PComponent is a N2PLoadCase.get_results("DISPLACEMENTS").get_component("X")
|
|
234
|
+
>>> displ_X_array, where = N2PComponent.get_result_ndarray(aveSections=-3, coordsys=-1)
|
|
235
|
+
>>> # N2PComponent is a N2PLoadCase.get_results("STRESSES").get_component("XX")
|
|
236
|
+
>>> stress_array, where = N2PComponent.get_result_ndarray(v1=(-1, 0, 0), v2=(0, -1, 0))
|
|
229
237
|
"""
|
|
230
238
|
resultsParameters = self._create_n2paraminputresult(sections, aveSections, cornerData, aveNodes, variation,
|
|
231
239
|
realPolar, coordsys, v1, v2)
|
|
@@ -235,14 +243,14 @@ class N2PComponent:
|
|
|
235
243
|
resultsParameters, 0)
|
|
236
244
|
|
|
237
245
|
if results[1] == 1:
|
|
238
|
-
return(np.array(results[0], np.float64),'NODES')
|
|
246
|
+
return (np.array(results[0], np.float64),'NODES')
|
|
239
247
|
elif results[1] == 2:
|
|
240
|
-
return(np.array(results[0], np.float64), 'ELEMENTS')
|
|
248
|
+
return (np.array(results[0], np.float64), 'ELEMENTS')
|
|
241
249
|
elif results[1] == 3:
|
|
242
|
-
return(np.array(results[0], np.float64), 'ELEMENT NODAL')
|
|
250
|
+
return (np.array(results[0], np.float64), 'ELEMENT NODAL')
|
|
243
251
|
else:
|
|
244
252
|
N2PLog.Error.E206(self.Name)
|
|
245
|
-
return(-1, 'NO RESULTS')
|
|
253
|
+
return (-1, 'NO RESULTS')
|
|
246
254
|
# ------------------------------------------------------------------------------------------------------------------
|
|
247
255
|
|
|
248
256
|
# # Metodo que devulve un dataframe con los resulados tras llamar a la funcion de NaxToModel--
|
|
@@ -287,6 +295,7 @@ class N2PComponent:
|
|
|
287
295
|
# 0 : Global,
|
|
288
296
|
# -1 : Material Coordinate System,
|
|
289
297
|
# -10 : User defined,
|
|
298
|
+
# -20 : Element/Node User Defined,
|
|
290
299
|
# >0 : Solver ID of the Predefined Coordinate System.
|
|
291
300
|
#
|
|
292
301
|
# v1: tuple
|
|
@@ -442,6 +451,10 @@ class N2PComponent:
|
|
|
442
451
|
resultsParameters = N2ParamInputResults.structResults(0)
|
|
443
452
|
resultsParameters.coordSys = coordsys
|
|
444
453
|
|
|
454
|
+
elif coordsys == -20:
|
|
455
|
+
resultsParameters = N2ParamInputResults.structResults(0)
|
|
456
|
+
resultsParameters.coordSys = coordsys
|
|
457
|
+
|
|
445
458
|
else:
|
|
446
459
|
N2PLog.Error.E220()
|
|
447
460
|
return (-1, 'NO RESULTS')
|
|
@@ -128,6 +128,21 @@ class N2PElement:
|
|
|
128
128
|
return [all_centroids[iid, i] for i in range(3)]
|
|
129
129
|
# ------------------------------------------------------------------------------------------------------------------
|
|
130
130
|
|
|
131
|
+
# Metodo para el sistema de usuario del elemento -------------------------------------------------------------------
|
|
132
|
+
@property
|
|
133
|
+
def UserSystemArray(self) -> list[float, ...]:
|
|
134
|
+
"""
|
|
135
|
+
Returns list with the position of the three vectors that define the user system of the element:
|
|
136
|
+
[x1, x2, x3, y1, y2, y3, z1, z2, z3]
|
|
137
|
+
|
|
138
|
+
If no user systems for elements are defined yet, it returns None.
|
|
139
|
+
"""
|
|
140
|
+
user_system_array = self.__model__._N2PModelContent__vzmodel.ElementUserCoordinateSystems
|
|
141
|
+
if not user_system_array:
|
|
142
|
+
return None
|
|
143
|
+
return [user_system_array[self.InternalID, i] for i in range(9)]
|
|
144
|
+
# ------------------------------------------------------------------------------------------------------------------
|
|
145
|
+
|
|
131
146
|
# Special Method for Object Representation -------------------------------------------------------------------------
|
|
132
147
|
def __repr__(self):
|
|
133
148
|
return f"N2PElement({self.ID}, \'{self.PartID}\')"
|
|
@@ -81,11 +81,11 @@ class N2PFreeBody(object):
|
|
|
81
81
|
else:
|
|
82
82
|
n2fbdsection.OpenFile = self.__model._N2PModelContent__vzmodel
|
|
83
83
|
|
|
84
|
-
# Se añaden los nodos usando su id de solver. La parte es la misma para
|
|
84
|
+
# Se añaden los nodos usando su id de solver. La parte es la misma para todo_ y se define antes
|
|
85
85
|
for node in self.__nodelist:
|
|
86
86
|
n2fbdsection.NodesId.Add(node.ID)
|
|
87
87
|
|
|
88
|
-
# Se añaden los elementos usando su id de solver. La parte es la misma para
|
|
88
|
+
# Se añaden los elementos usando su id de solver. La parte es la misma para todo_ y se define antes
|
|
89
89
|
for element in self.__elementlist:
|
|
90
90
|
n2fbdsection.ElementsId.Add(element.ID)
|
|
91
91
|
|
|
@@ -6,9 +6,9 @@ from typing import Union
|
|
|
6
6
|
|
|
7
7
|
# Clase Load Case de Python --------------------------------------------------------------------------------------------
|
|
8
8
|
class N2PLoadCase:
|
|
9
|
-
|
|
9
|
+
"""Class which contains the information associated to a load case instance of N2PLoadCase object
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Attributes:
|
|
12
12
|
ID: int.
|
|
13
13
|
Name: str.
|
|
14
14
|
TypeSolution: str.
|
|
@@ -19,8 +19,8 @@ class N2PLoadCase:
|
|
|
19
19
|
TypeLC: int.
|
|
20
20
|
IsComplex: bool.
|
|
21
21
|
InternalID: int.
|
|
22
|
+
"""
|
|
22
23
|
|
|
23
|
-
'''
|
|
24
24
|
|
|
25
25
|
__increments_by_name__ = dict()
|
|
26
26
|
__increments_by_id__ = dict()
|
|
@@ -71,13 +71,13 @@ class N2PLoadCase:
|
|
|
71
71
|
# Metodo para obtener el numero de identificacion interno del caso de carga ----------------------------------------
|
|
72
72
|
@property
|
|
73
73
|
def ID(self) -> int:
|
|
74
|
-
return
|
|
74
|
+
return int(self.__id__)
|
|
75
75
|
# ------------------------------------------------------------------------------------------------------------------
|
|
76
76
|
|
|
77
77
|
# Metodo oara obtener el numero de identificacion original del caso de carga ---------------------------------------
|
|
78
78
|
@property
|
|
79
79
|
def OriginalID(self) -> int:
|
|
80
|
-
return
|
|
80
|
+
return int(self.__idoriginal__)
|
|
81
81
|
# ------------------------------------------------------------------------------------------------------------------
|
|
82
82
|
|
|
83
83
|
# Metodo para obtener el numero de incrementos dentro del caso de carga --------------------------------------------
|
|
@@ -99,7 +99,7 @@ class N2PLoadCase:
|
|
|
99
99
|
@property
|
|
100
100
|
def IsComplex(self) -> bool:
|
|
101
101
|
"""Returns a boolean indicating whether the load case is associated to a complex solution"""
|
|
102
|
-
return
|
|
102
|
+
return bool(self.__iscomplex__)
|
|
103
103
|
# ------------------------------------------------------------------------------------------------------------------
|
|
104
104
|
|
|
105
105
|
# Metodo para obtener el tipo de caso de Carga ---------------------------------------------------------------------
|
|
@@ -108,13 +108,13 @@ class N2PLoadCase:
|
|
|
108
108
|
''' Returns the type of Load Case. RAW -> the load case is extracted from the original file. IMPORTED -> the
|
|
109
109
|
load case has been imported.
|
|
110
110
|
'''
|
|
111
|
-
return
|
|
111
|
+
return str(self.__lctype__)
|
|
112
112
|
# ------------------------------------------------------------------------------------------------------------------
|
|
113
113
|
|
|
114
114
|
# Metodo para obtener el nombre del caso de carga ------------------------------------------------------------------
|
|
115
115
|
@property
|
|
116
116
|
def Name(self) -> str:
|
|
117
|
-
return
|
|
117
|
+
return str(self.__namelc__)
|
|
118
118
|
# ------------------------------------------------------------------------------------------------------------------
|
|
119
119
|
|
|
120
120
|
# Metodo para obtener el incremento activo. Influye en la funcion de llamada a get_result_array
|
|
@@ -129,11 +129,11 @@ class N2PLoadCase:
|
|
|
129
129
|
# Metodo para establecer el incremento activo. Influye en la funcion de llamada a get_result_array
|
|
130
130
|
@ActiveIncrement.setter
|
|
131
131
|
def ActiveIncrement(self, id: Union[int, str]) -> None:
|
|
132
|
-
|
|
132
|
+
"""DEPRECATED PROPERTY. Use ActiveN2PIncrement instead. Sets the active increment of the load case. By defult is the last one.
|
|
133
133
|
|
|
134
134
|
Args:
|
|
135
135
|
id: int | str -> ID or Name of the N2PIncrement
|
|
136
|
-
|
|
136
|
+
"""
|
|
137
137
|
activincrement = self.get_increments(id).ID
|
|
138
138
|
|
|
139
139
|
if activincrement is not None:
|
|
@@ -141,6 +141,7 @@ class N2PLoadCase:
|
|
|
141
141
|
N2PLog.Info.I202(id)
|
|
142
142
|
else:
|
|
143
143
|
N2PLog.Error.E207(id)
|
|
144
|
+
N2PLog.Warning.W206()
|
|
144
145
|
# ------------------------------------------------------------------------------------------------------------------
|
|
145
146
|
|
|
146
147
|
# Metodo para obtener el incremento activo. Influye en la funcion de llamada a get_result_array
|
|
@@ -170,13 +171,13 @@ class N2PLoadCase:
|
|
|
170
171
|
# Metodo para obtener el tipo de solucion del modelo ---------------------------------------------------------------
|
|
171
172
|
@property
|
|
172
173
|
def TypeSolution(self) -> str:
|
|
173
|
-
return
|
|
174
|
+
return str(self.__solutiontype__)
|
|
174
175
|
# ------------------------------------------------------------------------------------------------------------------
|
|
175
176
|
|
|
176
177
|
# Metodo para obtener el solver del caso de carga ------------------------------------------------------------------
|
|
177
178
|
@property
|
|
178
179
|
def Solver(self) -> str:
|
|
179
|
-
return
|
|
180
|
+
return str(self.__solver__)
|
|
180
181
|
# ------------------------------------------------------------------------------------------------------------------
|
|
181
182
|
|
|
182
183
|
# Propiedad que devuelve la ruta del fichero desde donde se importo el caso de carga -------------------------------
|
|
@@ -230,14 +231,19 @@ class N2PLoadCase:
|
|
|
230
231
|
|
|
231
232
|
# Metodo para obtener los incrementos disponibles en el caso de carga ----------------------------------------------
|
|
232
233
|
def get_result(self, name: str) -> N2PResult:
|
|
233
|
-
|
|
234
|
+
"""Returns the N2PResult object with the Name of the Result. The name of the results is different depoending on
|
|
235
|
+
the solver.
|
|
234
236
|
|
|
235
237
|
Args:
|
|
236
238
|
name: str
|
|
237
239
|
|
|
238
240
|
Returns:
|
|
239
241
|
result: N2PResult
|
|
240
|
-
|
|
242
|
+
|
|
243
|
+
Examples:
|
|
244
|
+
>>> displ = N2PLoadCase.get_result("DISPLACEMENT") # If nastran
|
|
245
|
+
>>> displ = N2PLoadCase.get_result("U") # If Abaqus
|
|
246
|
+
"""
|
|
241
247
|
|
|
242
248
|
# Chequear valor de Name
|
|
243
249
|
if isinstance(name, str):
|
|
@@ -148,6 +148,21 @@ class N2PNode:
|
|
|
148
148
|
return [celllist[cell_iid] for cell_iid in cs_list]
|
|
149
149
|
# ---------------------------------------------------------------------------------------------
|
|
150
150
|
|
|
151
|
+
# Metodo para el sistema de usuario del nodo -----------------------------------------------------------------------
|
|
152
|
+
@property
|
|
153
|
+
def UserSystemArray(self) -> list[float, ...]:
|
|
154
|
+
"""
|
|
155
|
+
Returns list with the position of the three vectors that define the user system of the node:
|
|
156
|
+
[x1, x2, x3, y1, y2, y3, z1, z2, z3]
|
|
157
|
+
|
|
158
|
+
If no user systems for nodes are defined yet, it returns None.
|
|
159
|
+
"""
|
|
160
|
+
user_system_array = self.__model__._N2PModelContent__vzmodel.NodeUserCoordinateSystems
|
|
161
|
+
if not user_system_array:
|
|
162
|
+
return None
|
|
163
|
+
return [user_system_array[self.InternalID, i] for i in range(9)]
|
|
164
|
+
# ------------------------------------------------------------------------------------------------------------------
|
|
165
|
+
|
|
151
166
|
# Special Method for Object Representation -------------------------------------------------------------------------
|
|
152
167
|
def __repr__(self):
|
|
153
168
|
return f"N2PNode({self.ID}, \'{self.PartID}\')"
|
|
@@ -52,8 +52,6 @@ class N2PProperty(ABC):
|
|
|
52
52
|
def PropertyType(self) -> str:
|
|
53
53
|
return self.__info__.PropertyType.ToString()
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
55
|
# Special Method for Object Representation -------------------------------------------------------------------------
|
|
58
56
|
def __repr__(self):
|
|
59
57
|
if self.__model__.Solver == "Abaqus":
|
|
@@ -128,56 +126,55 @@ class N2PComp(N2PProperty):
|
|
|
128
126
|
|
|
129
127
|
@property
|
|
130
128
|
def EqQMatrix(self) -> list:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
129
|
+
"""
|
|
130
|
+
Returns the lamina stiffness matrix (Q-Bar)
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
q11_t = 0
|
|
134
|
+
q12_t = 0
|
|
135
|
+
q22_t = 0
|
|
136
|
+
q16_t = 0
|
|
137
|
+
q26_t = 0
|
|
138
|
+
q66_t = 0
|
|
139
|
+
|
|
140
|
+
t_thick = sum(self.Thickness) #! is self.Thickness a numpy array?
|
|
141
|
+
|
|
142
|
+
for i in range(self.NumPiles):
|
|
143
|
+
c = math.cos(math.radians(self.Theta[i]))
|
|
144
|
+
s = math.sin(math.radians(self.Theta[i]))
|
|
145
|
+
|
|
146
|
+
thick = self.Thickness[i]
|
|
147
|
+
rel_thick = thick/t_thick
|
|
148
|
+
|
|
149
|
+
mat = self.__model__._N2PModelContent__material_dict[self.MatID[i]]
|
|
150
|
+
|
|
151
|
+
s11 = 1 / mat.YoungX
|
|
152
|
+
s22 = 1 / mat.YoungY
|
|
153
|
+
s12 = (-1) * mat.PoissonXY / mat.YoungX
|
|
154
|
+
s66 = 1 / mat.ShearXY if mat.ShearXY != 0.0 else mat.YoungX/(2*(1+mat.PoissonXY))
|
|
155
|
+
|
|
156
|
+
# Calculate the terms of the reduced stiffness matrix Q in the laminae coordinate system
|
|
157
|
+
q11 = s22 / (s11 * s22 - s12 ** 2)
|
|
158
|
+
q12 = (-1) * s12 / (s11 * s22 - s12 ** 2)
|
|
159
|
+
q22 = s11 / (s11 * s22 - s12 ** 2)
|
|
160
|
+
q66 = 1 / s66
|
|
161
|
+
|
|
162
|
+
# Calculate the terms of the reduced stiffness matrix Q' in the laminate coordinate system
|
|
163
|
+
q11_t += (q11 * c ** 4 + 2 * (q12 + 2 * q66) * s ** 2 * c ** 2 + q22 * s ** 4) * rel_thick #! why multiply by the thickness
|
|
164
|
+
q12_t += ((q11 + q22 - 4 * q66) * s ** 2 * c ** 2 + q12 * (s ** 4 + c ** 4)) * rel_thick
|
|
165
|
+
q22_t += (q11 * s ** 4 + 2 * (q12 + 2 * q66) * s ** 2 * c ** 2 + q22 * c ** 4) * rel_thick
|
|
166
|
+
q16_t += ((q11 - q12 - 2 * q66) * s * c ** 3 + (q12 - q22 + 2 * q66) * s ** 3 * c) * rel_thick
|
|
167
|
+
q26_t += ((q11 - q12 - 2 * q66) * s ** 3 * c + (q12 - q22 + 2 * q66) * s * c ** 3) * rel_thick
|
|
168
|
+
q66_t += ((q11 + q22 - 2 * q12 - 2 * q66) * s ** 2 * c ** 2 + q66 * (s ** 4 + c ** 4)) * rel_thick
|
|
169
|
+
|
|
170
|
+
Q = [[q11_t, q12_t, q16_t],
|
|
173
171
|
[q12_t, q22_t, q26_t],
|
|
174
172
|
[q16_t, q26_t, q66_t]]
|
|
175
173
|
|
|
176
|
-
|
|
174
|
+
return Q
|
|
177
175
|
# ----------------------------------------------------------------------------------------------------------------------
|
|
178
|
-
|
|
179
176
|
|
|
180
|
-
def QMatrix(self,i) -> np.ndarray:
|
|
177
|
+
def QMatrix(self, i) -> np.ndarray:
|
|
181
178
|
"""
|
|
182
179
|
Returns the lamina stiffness matrix (Q-Bar) as a numpy 2D array
|
|
183
180
|
| σx | | ε |
|
|
@@ -215,8 +212,9 @@ class N2PComp(N2PProperty):
|
|
|
215
212
|
|
|
216
213
|
try:
|
|
217
214
|
T_inv = np.linalg.inv(T)
|
|
218
|
-
except:
|
|
219
|
-
|
|
215
|
+
except Exception as e:
|
|
216
|
+
msg = N2PLog.Error.E315()
|
|
217
|
+
raise Exception(msg)
|
|
220
218
|
|
|
221
219
|
# From Jones pg50-51: [sigma] = [T]**(-1)*[Q]*[T]**(-1) [eps] = [Q_bar]*[eps]
|
|
222
220
|
|
|
@@ -235,37 +233,38 @@ class N2PComp(N2PProperty):
|
|
|
235
233
|
|
|
236
234
|
# Nótese que las unidades de las matrices de rigidez ABD deben ser consistentes: A [N/m], B [N] y D [N·m].
|
|
237
235
|
|
|
238
|
-
A = np.zeros([3,3],float)
|
|
239
|
-
B = np.zeros([3,3],float)
|
|
240
|
-
D = np.zeros([3,3],float)
|
|
236
|
+
A = np.zeros([3, 3], float)
|
|
237
|
+
B = np.zeros([3, 3], float)
|
|
238
|
+
D = np.zeros([3, 3], float)
|
|
241
239
|
|
|
242
240
|
if self.NumPiles < 0: # SYMMETRIC LAMINATE
|
|
243
241
|
Nply = abs(self.NumPiles) # in this case Nply = half the real number of plies
|
|
244
242
|
t_thick = sum(self.Thickness)*2
|
|
245
243
|
low_reference = - sum(self.Thickness)
|
|
246
|
-
iterplies = np.pad(np.arange(0,Nply),(0,Nply),'symmetric')
|
|
244
|
+
iterplies = np.pad(np.arange(0,Nply), (0,Nply), 'symmetric') # e.g.: transforms [0,1,2] in [0,1,2,2,1,0]
|
|
247
245
|
else: # NON-SYMMETRIC LAMINATE
|
|
248
246
|
Nply = self.NumPiles # in this case Nply 0 real number of plies
|
|
249
247
|
t_thick = sum(self.Thickness)
|
|
250
248
|
low_reference = - sum(self.Thickness) / 2
|
|
251
|
-
iterplies = np.arange(0,Nply)
|
|
249
|
+
iterplies = np.arange(0, Nply)
|
|
252
250
|
|
|
253
251
|
for i in iterplies:
|
|
254
252
|
|
|
255
|
-
thick = self.Thickness[i]
|
|
253
|
+
thick = self.Thickness[i] # tener en cuenta caso simetrico
|
|
256
254
|
centroid = low_reference + thick/2
|
|
257
255
|
|
|
258
|
-
Q_bar = self.QMatrix(i)
|
|
256
|
+
Q_bar = self.QMatrix(i) # get Q_bar of the lamina in the laminate coordinate system
|
|
259
257
|
|
|
260
258
|
# Calculate A, B, C matrices in the laminate coordinate system
|
|
261
|
-
A += Q_bar*thick
|
|
262
|
-
B += Q_bar * centroid * thick
|
|
263
|
-
D += Q_bar * (
|
|
259
|
+
A += Q_bar*thick # extensional_matrix
|
|
260
|
+
B += Q_bar * centroid * thick # bending_matrix
|
|
261
|
+
D += Q_bar * (centroid**2 * thick + (thick**3)/12) # coupling_matrix
|
|
264
262
|
|
|
265
263
|
low_reference += thick
|
|
266
264
|
|
|
267
265
|
return A, B, D
|
|
268
266
|
|
|
267
|
+
|
|
269
268
|
# Clase para definir propiedades de tipo placa -------------------------------------------------------------------------
|
|
270
269
|
class N2PShell(N2PProperty):
|
|
271
270
|
"""
|
|
@@ -316,7 +315,7 @@ class N2PShell(N2PProperty):
|
|
|
316
315
|
# ----------------------------------------------------------------------------------------------------------------------
|
|
317
316
|
|
|
318
317
|
|
|
319
|
-
# Clase para definir propiedades de tipo solido
|
|
318
|
+
# Clase para definir propiedades de tipo solido ------------------------------------------------------------------------
|
|
320
319
|
class N2PSolid(N2PProperty):
|
|
321
320
|
"""
|
|
322
321
|
Class for defining solid properties. It derives from N2PProperty.
|
|
@@ -34,7 +34,7 @@ class N2PResult:
|
|
|
34
34
|
self.__description__ = description
|
|
35
35
|
self.__elem_types__ = elemTypes
|
|
36
36
|
self.__fcode__ = fcode
|
|
37
|
-
self.
|
|
37
|
+
self.__name = name
|
|
38
38
|
self.__loadCase_father__ = loadCase_father
|
|
39
39
|
# ---------------------------------------------------------------------------------------------
|
|
40
40
|
|
|
@@ -61,7 +61,7 @@ class N2PResult:
|
|
|
61
61
|
# Metodo para obtener la descripcion del resultado --------------------------------------------
|
|
62
62
|
@property
|
|
63
63
|
def Description(self) -> str:
|
|
64
|
-
return
|
|
64
|
+
return self.__description__
|
|
65
65
|
# ----------------------------------------------------------------------------------------------
|
|
66
66
|
|
|
67
67
|
# Metodo para obtener los tipos de elemento en los cuales se han obtenido resultados -----------
|
|
@@ -69,19 +69,19 @@ class N2PResult:
|
|
|
69
69
|
def TypesElements(self) -> list[str]:
|
|
70
70
|
"""Returns a list with the element types where results are available.
|
|
71
71
|
"""
|
|
72
|
-
return
|
|
72
|
+
return list(self.__elem_types__)
|
|
73
73
|
# ---------------------------------------------------------------------------------------------
|
|
74
74
|
|
|
75
75
|
# Metodo para obtener el format code del resultado -> PREGUNTAR A ROBERTO OP2??? --------------
|
|
76
76
|
@property
|
|
77
77
|
def FormatCode(self) -> str:
|
|
78
|
-
return
|
|
78
|
+
return str(self.__fcode__)
|
|
79
79
|
# ---------------------------------------------------------------------------------------------
|
|
80
80
|
|
|
81
81
|
# Metodo para obtener el nombre del resultado -------------------------------------------------
|
|
82
82
|
@property
|
|
83
83
|
def Name(self) -> str:
|
|
84
|
-
return
|
|
84
|
+
return str(self.__name)
|
|
85
85
|
# ---------------------------------------------------------------------------------------------
|
|
86
86
|
|
|
87
87
|
# Metodo para obtener las componentes disponibles en el resultado -----------------------------
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"""Constants of the NaxToPy package"""
|
|
2
2
|
|
|
3
3
|
# NaxToPy Version
|
|
4
|
-
VERSION = "2.1.
|
|
4
|
+
VERSION = "2.1.2"
|
|
5
5
|
|
|
6
6
|
# Supported for Naxto:
|
|
7
7
|
NAXTO_VERSION = '2024R2'
|
|
8
|
-
NAXTO_STEP = "
|
|
8
|
+
NAXTO_STEP = "3"
|
|
9
9
|
|
|
10
10
|
# Assembly version of NaxToModel.dll
|
|
11
|
-
VIZZER_COMPATIBILITY = ("4.2.0.0")
|
|
11
|
+
VIZZER_COMPATIBILITY = ("4.2.0.0", "4.2.0.1", "4.2.0.2", "4.2.0.3")
|
|
12
12
|
"""Tuple with the compatible versions of NaxToModel.dll"""
|
|
13
13
|
|
|
14
14
|
# PYTHON EXTERNO ----------------------------------------------------------------------------------
|