NaxToPy 2.0.0__tar.gz → 2.0.1__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.0.0/src/NaxToPy.egg-info → naxtopy-2.0.1}/PKG-INFO +18 -9
- {naxtopy-2.0.0 → naxtopy-2.0.1}/README.md +17 -8
- {naxtopy-2.0.0 → naxtopy-2.0.1}/pyproject.toml +1 -1
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PLoadCase.py +24 -4
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Constants/Constants.py +3 -3
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Errors/N2PLog.py +14 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/N2PModelContent.py +81 -9
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Reference_Finder/__Reference_Finder.py +5 -4
- {naxtopy-2.0.0 → naxtopy-2.0.1/src/NaxToPy.egg-info}/PKG-INFO +18 -9
- {naxtopy-2.0.0 → naxtopy-2.0.1}/LICENSE +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/setup.cfg +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/setup.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/AllClasses.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PComponent.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PConnector.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PCoord.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PElement.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PFreeBody.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PIncrement.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PMaterial.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PModelInputData.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PNode.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PProperty.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PReport.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PResult.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PSection.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/N2PSet.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/ProgresBar.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Classes/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Constants/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Constants/librerias.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Errors/N2PColors.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Errors/N2PFileHandler.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Errors/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/Reference_Finder/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/_AuxFunc/_NetToPython.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/_AuxFunc/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Core/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Modules/Fasteners/N2PUpdateFastener.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Modules/Fasteners/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Modules/N2PEnvelope/N2PEnvelope.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Modules/N2PEnvelope/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Modules/N2PtoEXE/N2PtoEXE.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Modules/N2PtoEXE/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/Modules/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/NaxToPy.ico +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/__init__.py +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy/user_functions.txt +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy.egg-info/SOURCES.txt +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy.egg-info/dependency_links.txt +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/src/NaxToPy.egg-info/requires.txt +0 -0
- {naxtopy-2.0.0 → naxtopy-2.0.1}/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.0.
|
|
3
|
+
Version: 2.0.1
|
|
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
|
|
@@ -135,9 +135,9 @@ Requires-Dist: setuptools>=67.8.0
|
|
|
135
135
|
|
|
136
136
|
**NaxToPy** is the [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US)
|
|
137
137
|
library designed for Python, which allows reading and manipulating FEM
|
|
138
|
-
analysis results files from the most common tools: Nastran (op2, xdb, h5), Abaqus (odb), Optistruct
|
|
139
|
-
(h3d, op2) and Ansys (rst); and stores them in a user-friendly Python structure. Additionally, it
|
|
140
|
-
can read input files from Nastran (bdf, fem) and change
|
|
138
|
+
analysis results files from the most common tools: Nastran (.op2, .xdb, .h5), Abaqus (odb), Optistruct
|
|
139
|
+
(.h3d, .op2) and Ansys (.rst); and stores them in a user-friendly Python structure. Additionally, it
|
|
140
|
+
can read input files from Nastran (.bdf, .fem) and change their contents.
|
|
141
141
|
|
|
142
142
|
It could be easily combined with other Python packages as Matplotlib or Pandas. This provides access
|
|
143
143
|
to the full coding power of Python to interpret and process the results, without the need to install
|
|
@@ -147,15 +147,18 @@ 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.1**. It
|
|
150
|
+
This version is compatible with **NaxTo 2024.1**. It is compatible with all the steps of this version (2024.1.0, 2024.1.1, 2024.1.2, etc.).
|
|
151
151
|
Check in _Programs and Features_ the NaxTo version that is installed.
|
|
152
152
|
|
|
153
153
|
## Installation
|
|
154
154
|
|
|
155
|
+
If python is installed and `pip` is added to the PATH:
|
|
155
156
|
|
|
156
|
-
|
|
157
|
+
`pip install NaxToPy`
|
|
158
|
+
|
|
159
|
+
An alternative, if Python is callable from the command line:
|
|
157
160
|
|
|
158
|
-
`
|
|
161
|
+
`python -m pip install NaxToPy`
|
|
159
162
|
|
|
160
163
|
For **Visual Studio** users:
|
|
161
164
|
- Open "Python Environments" window
|
|
@@ -179,7 +182,7 @@ same directory. When ever you want to use the NaxToPy package add the following
|
|
|
179
182
|
|
|
180
183
|
If python is callable from the command line:
|
|
181
184
|
|
|
182
|
-
`
|
|
185
|
+
`python -m pip install -U NaxToPy`
|
|
183
186
|
|
|
184
187
|
For Visual Studio users:
|
|
185
188
|
- Open "Python Environments" window
|
|
@@ -260,6 +263,12 @@ the LoadCases that are critical or the Increment that is critical instead of the
|
|
|
260
263
|
2. New internal methods to look for the compatibility with low-level dependencies.
|
|
261
264
|
3. The name of the .log is now NaxToPy_Year-Month-Day.log.
|
|
262
265
|
|
|
266
|
+
### v.2.0.1
|
|
267
|
+
1. The compatibility is extended to all NaxTo steps of the same version.
|
|
268
|
+
2. The property N2PLoadCase.ActiveIncrement is subtitued by N2PLoadCase.ActiveN2PIncrement.
|
|
269
|
+
It uses an object instaed of an int.
|
|
270
|
+
3. Update of the examples of some docstrings.
|
|
271
|
+
|
|
263
272
|
# Documentation
|
|
264
273
|
|
|
265
274
|
**NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
|
|
@@ -339,7 +348,7 @@ loadcaseslist = model.LoadCases
|
|
|
339
348
|
pressure_lc = model.get_load_case("pressure")
|
|
340
349
|
|
|
341
350
|
# Change the active increment (by default is the last one):
|
|
342
|
-
pressure_lc.
|
|
351
|
+
pressure_lc.ActiveN2PIncrement = pressure_lc.get_increment(10)
|
|
343
352
|
|
|
344
353
|
# Look for all results
|
|
345
354
|
all_results = pressure_lc.Results
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
**NaxToPy** is the [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US)
|
|
13
13
|
library designed for Python, which allows reading and manipulating FEM
|
|
14
|
-
analysis results files from the most common tools: Nastran (op2, xdb, h5), Abaqus (odb), Optistruct
|
|
15
|
-
(h3d, op2) and Ansys (rst); and stores them in a user-friendly Python structure. Additionally, it
|
|
16
|
-
can read input files from Nastran (bdf, fem) and change
|
|
14
|
+
analysis results files from the most common tools: Nastran (.op2, .xdb, .h5), Abaqus (odb), Optistruct
|
|
15
|
+
(.h3d, .op2) and Ansys (.rst); and stores them in a user-friendly Python structure. Additionally, it
|
|
16
|
+
can read input files from Nastran (.bdf, .fem) and change their contents.
|
|
17
17
|
|
|
18
18
|
It could be easily combined with other Python packages as Matplotlib or Pandas. This provides access
|
|
19
19
|
to the full coding power of Python to interpret and process the results, without the need to install
|
|
@@ -23,15 +23,18 @@ 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.1**. It
|
|
26
|
+
This version is compatible with **NaxTo 2024.1**. It is compatible with all the steps of this version (2024.1.0, 2024.1.1, 2024.1.2, etc.).
|
|
27
27
|
Check in _Programs and Features_ the NaxTo version that is installed.
|
|
28
28
|
|
|
29
29
|
## Installation
|
|
30
30
|
|
|
31
|
+
If python is installed and `pip` is added to the PATH:
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
`pip install NaxToPy`
|
|
34
|
+
|
|
35
|
+
An alternative, if Python is callable from the command line:
|
|
33
36
|
|
|
34
|
-
`
|
|
37
|
+
`python -m pip install NaxToPy`
|
|
35
38
|
|
|
36
39
|
For **Visual Studio** users:
|
|
37
40
|
- Open "Python Environments" window
|
|
@@ -55,7 +58,7 @@ same directory. When ever you want to use the NaxToPy package add the following
|
|
|
55
58
|
|
|
56
59
|
If python is callable from the command line:
|
|
57
60
|
|
|
58
|
-
`
|
|
61
|
+
`python -m pip install -U NaxToPy`
|
|
59
62
|
|
|
60
63
|
For Visual Studio users:
|
|
61
64
|
- Open "Python Environments" window
|
|
@@ -136,6 +139,12 @@ the LoadCases that are critical or the Increment that is critical instead of the
|
|
|
136
139
|
2. New internal methods to look for the compatibility with low-level dependencies.
|
|
137
140
|
3. The name of the .log is now NaxToPy_Year-Month-Day.log.
|
|
138
141
|
|
|
142
|
+
### v.2.0.1
|
|
143
|
+
1. The compatibility is extended to all NaxTo steps of the same version.
|
|
144
|
+
2. The property N2PLoadCase.ActiveIncrement is subtitued by N2PLoadCase.ActiveN2PIncrement.
|
|
145
|
+
It uses an object instaed of an int.
|
|
146
|
+
3. Update of the examples of some docstrings.
|
|
147
|
+
|
|
139
148
|
# Documentation
|
|
140
149
|
|
|
141
150
|
**NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
|
|
@@ -215,7 +224,7 @@ loadcaseslist = model.LoadCases
|
|
|
215
224
|
pressure_lc = model.get_load_case("pressure")
|
|
216
225
|
|
|
217
226
|
# Change the active increment (by default is the last one):
|
|
218
|
-
pressure_lc.
|
|
227
|
+
pressure_lc.ActiveN2PIncrement = pressure_lc.get_increment(10)
|
|
219
228
|
|
|
220
229
|
# Look for all results
|
|
221
230
|
all_results = pressure_lc.Results
|
|
@@ -119,15 +119,17 @@ class N2PLoadCase:
|
|
|
119
119
|
|
|
120
120
|
# Metodo para obtener el incremento activo. Influye en la funcion de llamada a get_result_array
|
|
121
121
|
@property
|
|
122
|
-
def ActiveIncrement(self) ->
|
|
123
|
-
|
|
122
|
+
def ActiveIncrement(self) -> int:
|
|
123
|
+
"""DEPRECATED PROPERTY. Use ActiveN2PIncrement.ID instaed. Returns the active increment of the load case. By
|
|
124
|
+
default, is the last one."""
|
|
125
|
+
N2PLog.Warning.W206()
|
|
124
126
|
return self.__activeIncrement__
|
|
125
127
|
# ------------------------------------------------------------------------------------------------------------------
|
|
126
128
|
|
|
127
|
-
# Metodo para
|
|
129
|
+
# Metodo para establecer el incremento activo. Influye en la funcion de llamada a get_result_array
|
|
128
130
|
@ActiveIncrement.setter
|
|
129
131
|
def ActiveIncrement(self, id: Union[int, str]) -> None:
|
|
130
|
-
''' Sets the active increment of the load case. By defult is the last one.
|
|
132
|
+
''' DEPRECATED PROPERTY. Use ActiveN2PIncrement instead. Sets the active increment of the load case. By defult is the last one.
|
|
131
133
|
|
|
132
134
|
Args:
|
|
133
135
|
id: int | str -> ID or Name of the N2PIncrement
|
|
@@ -141,6 +143,24 @@ class N2PLoadCase:
|
|
|
141
143
|
N2PLog.Error.E207(id)
|
|
142
144
|
# ------------------------------------------------------------------------------------------------------------------
|
|
143
145
|
|
|
146
|
+
# Metodo para obtener el incremento activo. Influye en la funcion de llamada a get_result_array
|
|
147
|
+
@property
|
|
148
|
+
def ActiveN2PIncrement(self) -> N2PIncrement:
|
|
149
|
+
"""Returns the active increment of the load case. By default, is the last one."""
|
|
150
|
+
return self.get_increments(self.__activeIncrement__)
|
|
151
|
+
# ------------------------------------------------------------------------------------------------------------------
|
|
152
|
+
|
|
153
|
+
# Metodo para establecer el incremento activo. Influye en la funcion de llamada a get_result_array
|
|
154
|
+
@ActiveN2PIncrement.setter
|
|
155
|
+
def ActiveN2PIncrement(self, incr: N2PIncrement) -> None:
|
|
156
|
+
"""Sets the active increment of the load case. By defult is the last one.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
incr: N2PIncrement -> ID or Name of the N2PIncrement
|
|
160
|
+
"""
|
|
161
|
+
self.__activeIncrement__ = incr.ID
|
|
162
|
+
# ------------------------------------------------------------------------------------------------------------------
|
|
163
|
+
|
|
144
164
|
# Metodo como propiedad que devuelve todos los N2PResult. Es igual que llamar a get_results sin
|
|
145
165
|
# parametros
|
|
146
166
|
@property
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"""Constants of the NaxToPy package"""
|
|
2
2
|
|
|
3
3
|
# NaxToPy Version
|
|
4
|
-
VERSION = "2.0.
|
|
4
|
+
VERSION = "2.0.1"
|
|
5
5
|
|
|
6
6
|
# Supported for Naxto:
|
|
7
7
|
NAXTO_VERSION = '2024R1'
|
|
8
|
-
NAXTO_STEP = "
|
|
8
|
+
NAXTO_STEP = "2"
|
|
9
9
|
|
|
10
10
|
# Assembly version of NaxToModel.dll
|
|
11
|
-
VIZZER_COMPATIBILITY = ("4.1.0.0", "4.1.0.1")
|
|
11
|
+
VIZZER_COMPATIBILITY = ("4.1.0.0", "4.1.0.1", "4.1.0.2")
|
|
12
12
|
"""Tuple with the compatible versions of NaxToModel.dll"""
|
|
13
13
|
|
|
14
14
|
# PYTHON EXTERNO ----------------------------------------------------------------------------------
|
|
@@ -152,6 +152,12 @@ class N2PLog(ABC):
|
|
|
152
152
|
message = f"The parallel processing has been set to {parallel}"
|
|
153
153
|
N2PLog._N2PLog__logger.debug(message)
|
|
154
154
|
|
|
155
|
+
@staticmethod
|
|
156
|
+
def D200(assembly) -> None:
|
|
157
|
+
"""Message that shows the assembly version of the core library"""
|
|
158
|
+
message = f"The assembly version is: {assembly}"
|
|
159
|
+
N2PLog._N2PLog__logger.debug(message)
|
|
160
|
+
|
|
155
161
|
@staticmethod
|
|
156
162
|
def D500(current_time,tinit) -> None:
|
|
157
163
|
""" Information given for the extraction time.
|
|
@@ -443,6 +449,14 @@ own information message. Use the following structure as a standard message (I +
|
|
|
443
449
|
message = f"W205: Initialize is a deprecated function. Please, use load_model instead"
|
|
444
450
|
N2PLog._N2PLog__logger.warning(message)
|
|
445
451
|
|
|
452
|
+
@staticmethod
|
|
453
|
+
def W206() -> None:
|
|
454
|
+
""" Warning raised when there the Deprecated property "ActiveIncrement" is called.
|
|
455
|
+
"""
|
|
456
|
+
message = f"W206: ActiveIncrement is a deprecated property. Please, ActiveN2pIncrement to obtain a " \
|
|
457
|
+
f"N2PIncrement or ActiveN2pIncrement.ID to obtain the ID"
|
|
458
|
+
N2PLog._N2PLog__logger.warning(message)
|
|
459
|
+
|
|
446
460
|
@staticmethod
|
|
447
461
|
def W300() -> None:
|
|
448
462
|
""" Warning raised when there are more dimensions than points in n2p.envelope
|
|
@@ -873,6 +873,14 @@ class N2PModelContent:
|
|
|
873
873
|
|
|
874
874
|
Returns:
|
|
875
875
|
freebody: N2PFreeBody
|
|
876
|
+
|
|
877
|
+
Example:
|
|
878
|
+
>>> model = load_model("model.op2")
|
|
879
|
+
>>> lc = model.get_load_case(5)
|
|
880
|
+
>>> incr = lc.ActiveN2PIncrement
|
|
881
|
+
>>> node_list = model.get_nodes([1000, 1001, 1002, 1003, 1004, 1005])
|
|
882
|
+
>>> elem_list = model.get_elements([1000, 1001, 1002, 1003, 1004])
|
|
883
|
+
|
|
876
884
|
"""
|
|
877
885
|
|
|
878
886
|
if increment is None:
|
|
@@ -909,6 +917,13 @@ class N2PModelContent:
|
|
|
909
917
|
|
|
910
918
|
Args:
|
|
911
919
|
results_files: list[str, ...]
|
|
920
|
+
|
|
921
|
+
Example:
|
|
922
|
+
>>> model1 = load_model("model1_lc1.odb")
|
|
923
|
+
>>> model1.import_results_from_files(["model1_lc2.odb", "mode1l_lc3.odb"])
|
|
924
|
+
|
|
925
|
+
>>> model2 = load_model("model2.dat", "InputFileNastran")
|
|
926
|
+
>>> model2.import_results_from_files(["model2_lc1.op2", "model2_lc2.op2"])
|
|
912
927
|
"""
|
|
913
928
|
if isinstance(results_files, str):
|
|
914
929
|
results_files = [results_files]
|
|
@@ -930,6 +945,14 @@ class N2PModelContent:
|
|
|
930
945
|
Args:
|
|
931
946
|
cells: list[N2PElement, N2PConnector, ...]
|
|
932
947
|
domain: list[N2PElement, N2PConnector, ...] -> Optional. Set the domain where to look for the adjacent elements
|
|
948
|
+
|
|
949
|
+
Returns:
|
|
950
|
+
list[N2PElement, N2PConnector, ...]
|
|
951
|
+
|
|
952
|
+
Example:
|
|
953
|
+
>>> model = load_model("model.odb")
|
|
954
|
+
>>> domain_S4 = [e for e in model.get_elements() if e.TypeElement == "S4"]
|
|
955
|
+
>>> elems_adj = model.get_elements_adjacent(model.get_elements(17500), domain=domain_S4)
|
|
933
956
|
"""
|
|
934
957
|
if not isinstance(cells, list):
|
|
935
958
|
cells = [cells]
|
|
@@ -962,6 +985,14 @@ class N2PModelContent:
|
|
|
962
985
|
Args:
|
|
963
986
|
cells: list[N2PElement, N2PConnector, ...]
|
|
964
987
|
domain: list[N2PElement, N2PConnector, ...] -> Optional. Set the domain where to look for the adjacent elements
|
|
988
|
+
|
|
989
|
+
Returns:
|
|
990
|
+
list[N2PElement, N2PConnector, ...]
|
|
991
|
+
|
|
992
|
+
Example:
|
|
993
|
+
>>> model = load_model("model.h3d")
|
|
994
|
+
>>> domain_elems = model.get_elements()
|
|
995
|
+
>>> elems_att = model.get_elements_attached(model.get_elements(17500), domain=domain_elems)
|
|
965
996
|
"""
|
|
966
997
|
if not isinstance(cells, list):
|
|
967
998
|
cells = [cells]
|
|
@@ -997,9 +1028,21 @@ class N2PModelContent:
|
|
|
997
1028
|
|
|
998
1029
|
Args:
|
|
999
1030
|
cells: list[N2PElement, N2PConnector, ...]
|
|
1031
|
+
|
|
1000
1032
|
tolerance_angle: float -> Optional (30º by default). Max angle[º] between two elements to be considered in the same face
|
|
1033
|
+
|
|
1001
1034
|
one_element_adjacent: bool -> Optional (True by default). If true, two elements are connected to arist of a selected element they will no be consisidered.
|
|
1035
|
+
|
|
1002
1036
|
domain: list[N2PElement, N2PConnector, ...] -> Optional. Set the domain where to look for the adjacent elements
|
|
1037
|
+
|
|
1038
|
+
Returns:
|
|
1039
|
+
list[N2PElement, N2PConnector, ...]
|
|
1040
|
+
|
|
1041
|
+
Example:
|
|
1042
|
+
>>> model = load_model("model.op2")
|
|
1043
|
+
>>> elems1 = model.get_elements_by_face(model.get_elements(17500))
|
|
1044
|
+
>>> domain_cquad = [e for e in model.get_elements() if e.TypeElement == "CQUAD4"]
|
|
1045
|
+
>>> elems2 = model.get_elements_by_face(model.get_elements([17500, 17501]), 25, domain=domain_cquad)
|
|
1003
1046
|
"""
|
|
1004
1047
|
if not isinstance(cells, list):
|
|
1005
1048
|
cells = [cells]
|
|
@@ -1036,13 +1079,16 @@ class N2PModelContent:
|
|
|
1036
1079
|
def get_free_edges(self,
|
|
1037
1080
|
domain: list[N2PElement, N2PConnector, ...] = None) -> list[tuple[N2PElement, N2PNode, N2PNode], ...]:
|
|
1038
1081
|
|
|
1039
|
-
""" Method of N2PModelContent that returns a list of tuples of N2PElement and two N2PNode of that element.
|
|
1082
|
+
""" Method of N2PModelContent that returns a list of tuples of a N2PElement and two N2PNode of that element.
|
|
1040
1083
|
The two nodes define the edge of the element that is contained in the free edge of the mesh If a domain is selected,
|
|
1041
1084
|
the tuple will only be searched in that domain. Notice that connectors, although they may be given in the domain,
|
|
1042
1085
|
they are never included in the free edges.
|
|
1043
1086
|
|
|
1044
1087
|
Args:
|
|
1045
|
-
domain: list[N2PElement, N2PConnector, ...] -> Optional. Set the domain where to look for the
|
|
1088
|
+
domain: list[N2PElement, N2PConnector, ...] -> Optional. Set the domain where to look for the free edges
|
|
1089
|
+
|
|
1090
|
+
Returns:
|
|
1091
|
+
list[tuple[N2PElement, N2PNode, N2PNode], ...]
|
|
1046
1092
|
"""
|
|
1047
1093
|
|
|
1048
1094
|
csharp_bool_array = System.Array.CreateInstance(System.Boolean,
|
|
@@ -1076,12 +1122,21 @@ class N2PModelContent:
|
|
|
1076
1122
|
- formula = "0.5*<LC1:FR2>"
|
|
1077
1123
|
- formula = "5*<LC2:FR3>-2*<LC3:FR3>"
|
|
1078
1124
|
|
|
1125
|
+
Note:
|
|
1126
|
+
The derived load cases will have only one frame/increment with id 0. So it is used in a formula the string
|
|
1127
|
+
will be "<LC-1:FR0>".
|
|
1128
|
+
|
|
1079
1129
|
Args:
|
|
1080
1130
|
name: str -> String with the name of the load case.
|
|
1081
1131
|
formula: str -> String that must have the loadcase|frame is intended to use and the arithmetical opreations.
|
|
1082
1132
|
|
|
1083
1133
|
Returns:
|
|
1084
1134
|
N2PLoadCase -> Derived load case
|
|
1135
|
+
|
|
1136
|
+
Examples:
|
|
1137
|
+
>>> dev_lc1 = new_derived_loadcase("dev_lc1", "<LC1:FR1>+2*<LC2:FR1>+0.5*<LC5:FR3>")
|
|
1138
|
+
>>> dev_lc2 = new_derived_loadcase("dev_lc2", "0.5*<LC1:FR2>")
|
|
1139
|
+
>>> dev_lc3 = new_derived_loadcase("dev_lc3", "5*<LC-1:FR0>-2*<LC3:FR3>")
|
|
1085
1140
|
"""
|
|
1086
1141
|
# Comprobamos que el nombre no se repite:
|
|
1087
1142
|
i = 0
|
|
@@ -1147,6 +1202,10 @@ class N2PModelContent:
|
|
|
1147
1202
|
|
|
1148
1203
|
Returns:
|
|
1149
1204
|
N2PLoadCase
|
|
1205
|
+
|
|
1206
|
+
Examples:
|
|
1207
|
+
>>> env_lc1 = new_envelope_loadcase("env_lc1", formula="<LC1:FR1>,<LC2:FR1>")
|
|
1208
|
+
>>> env_lc2 = new_envelope_loadcase("env_lc2", formula="<LC1:FR1>,<LC2:FR8>,<LC-3:FR0>", criteria="Min", envelgroup="ByLoadCaseID")
|
|
1150
1209
|
"""
|
|
1151
1210
|
# Comprobamos que el nombre no se repite:
|
|
1152
1211
|
i = 0
|
|
@@ -1282,11 +1341,10 @@ class N2PModelContent:
|
|
|
1282
1341
|
y=z^x.
|
|
1283
1342
|
|
|
1284
1343
|
Examples:
|
|
1285
|
-
report1 = model.new_report("<LC1:FR1>,<LC2:FR1>", False, "DISPLACEMNETS", "<X:NONE#>,<Y:NONE#>", False,
|
|
1286
|
-
list_n2pnodes, "LC")
|
|
1344
|
+
>>> report1 = model.new_report("<LC1:FR1>,<LC2:FR1>", False, "DISPLACEMNETS", "<X:NONE#>,<Y:NONE#>", False, list_n2pnodes, "LC")
|
|
1287
1345
|
|
|
1288
|
-
report2 = model.new_report("<LC1:FR1>,<LC1:FR2>,<LC4:FR6>", False, "STRESSES", "<VON_MISES:Z1#Z2#>,<MAX_SHEAR:Z1#Z2#>",
|
|
1289
|
-
|
|
1346
|
+
>>> report2 = model.new_report("<LC1:FR1>,<LC1:FR2>,<LC4:FR6>", False, "STRESSES", "<VON_MISES:Z1#Z2#>,<MAX_SHEAR:Z1#Z2#>", \
|
|
1347
|
+
False, list_n2pelements, "IDS", aveSections=-4, coordsys=-1)
|
|
1290
1348
|
"""
|
|
1291
1349
|
# Here it is checkd if the components, the loadcases and the result exist and the formula is right
|
|
1292
1350
|
try:
|
|
@@ -1319,8 +1377,8 @@ class N2PModelContent:
|
|
|
1319
1377
|
and the values are numpy arrays.
|
|
1320
1378
|
|
|
1321
1379
|
Examples:
|
|
1322
|
-
vonmises = .get_result_by_LCs_Incr([(1,2),(2,2)], "STRESSES", "VON_MISES")
|
|
1323
|
-
XX = .get_result_by_LCs_Incr([(loadcase1, increment2), (loadcase2, increment2), "STRAINS", "XX"])
|
|
1380
|
+
>>> vonmises = N2PModelContent.get_result_by_LCs_Incr([(1,2),(2,2)], "STRESSES", "VON_MISES")
|
|
1381
|
+
>>> XX = N2PModelContent.get_result_by_LCs_Incr([(loadcase1, increment2), (loadcase2, increment2), "STRAINS", "XX"])
|
|
1324
1382
|
|
|
1325
1383
|
Args:
|
|
1326
1384
|
|
|
@@ -1430,7 +1488,7 @@ def load_model(path: str, parallelprocessing: bool = False, file_type: str = Non
|
|
|
1430
1488
|
|
|
1431
1489
|
Supports .op2, .xdb, .odb, .h5, .h3d and .rst file extensions read from a local filesystem or URL.
|
|
1432
1490
|
|
|
1433
|
-
Supports Nastran
|
|
1491
|
+
Supports Nastran Input Files. (Typically .bdf extension)
|
|
1434
1492
|
|
|
1435
1493
|
Args:
|
|
1436
1494
|
path: str
|
|
@@ -1439,6 +1497,20 @@ def load_model(path: str, parallelprocessing: bool = False, file_type: str = Non
|
|
|
1439
1497
|
|
|
1440
1498
|
Returns:
|
|
1441
1499
|
model: N2PModelContent
|
|
1500
|
+
|
|
1501
|
+
Examples:
|
|
1502
|
+
>>> model1 = load_model(r"C:\MODELS\FEM\model1.dat")
|
|
1503
|
+
|
|
1504
|
+
>>> # file_type is not needed. It only helps the program and saves a checking
|
|
1505
|
+
>>> model2 = load_model(r"C:\MODELS\FEM\model2.dat", file_type="InputFileNastran")
|
|
1506
|
+
|
|
1507
|
+
>>> # parallelprocessing is only aviable for Binary files. It is helpful in some big files.
|
|
1508
|
+
>>> model3 = load_model(r"C:\MODELS\RESULTS\model1.op2", parallelprocessing=True)
|
|
1509
|
+
|
|
1510
|
+
>>> model4 = load_model(r"C:\MODELS\RESULTS\model2.xdb", file_type="Binary")
|
|
1511
|
+
>>> model5 = load_model(r"C:\MODELS\RESULTS\model5.h3d")
|
|
1512
|
+
>>> model6 = load_model(r"C:\MODELS\RESULTS\model6.odb", True, "Binary")
|
|
1513
|
+
|
|
1442
1514
|
"""
|
|
1443
1515
|
if not os.path.exists(path):
|
|
1444
1516
|
N2PLog.Critical.C108(path)
|
|
@@ -168,12 +168,13 @@ def compatible_vizzer(vizzer_libs: list) -> tuple[str, bool]:
|
|
|
168
168
|
versionInfo = FileVersionInfo.GetVersionInfo(lib_path)
|
|
169
169
|
assemblyVersion = versionInfo.FileVersion
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
N2PLog.Debug.D200(assemblyVersion)
|
|
172
|
+
|
|
173
|
+
# Se va a suponer que la todos los steps de una version NaxTo son compatibles con todos los steps de
|
|
174
|
+
# una version de NaxToPy: NaxTo 2024.1.X <---> 2.0.Y
|
|
175
|
+
return lib_path, True
|
|
174
176
|
|
|
175
177
|
N2PLog.Warning.W104(NAXTO_VERSION)
|
|
176
|
-
# Aunque la version este bien, el assembly no. Puede que de un step a otro no haya compatibilidad.
|
|
177
178
|
backup = ""
|
|
178
179
|
|
|
179
180
|
# Comprobamos si hay alguna version que contenga una dll compatible
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: NaxToPy
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
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
|
|
@@ -135,9 +135,9 @@ Requires-Dist: setuptools>=67.8.0
|
|
|
135
135
|
|
|
136
136
|
**NaxToPy** is the [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US)
|
|
137
137
|
library designed for Python, which allows reading and manipulating FEM
|
|
138
|
-
analysis results files from the most common tools: Nastran (op2, xdb, h5), Abaqus (odb), Optistruct
|
|
139
|
-
(h3d, op2) and Ansys (rst); and stores them in a user-friendly Python structure. Additionally, it
|
|
140
|
-
can read input files from Nastran (bdf, fem) and change
|
|
138
|
+
analysis results files from the most common tools: Nastran (.op2, .xdb, .h5), Abaqus (odb), Optistruct
|
|
139
|
+
(.h3d, .op2) and Ansys (.rst); and stores them in a user-friendly Python structure. Additionally, it
|
|
140
|
+
can read input files from Nastran (.bdf, .fem) and change their contents.
|
|
141
141
|
|
|
142
142
|
It could be easily combined with other Python packages as Matplotlib or Pandas. This provides access
|
|
143
143
|
to the full coding power of Python to interpret and process the results, without the need to install
|
|
@@ -147,15 +147,18 @@ 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.1**. It
|
|
150
|
+
This version is compatible with **NaxTo 2024.1**. It is compatible with all the steps of this version (2024.1.0, 2024.1.1, 2024.1.2, etc.).
|
|
151
151
|
Check in _Programs and Features_ the NaxTo version that is installed.
|
|
152
152
|
|
|
153
153
|
## Installation
|
|
154
154
|
|
|
155
|
+
If python is installed and `pip` is added to the PATH:
|
|
155
156
|
|
|
156
|
-
|
|
157
|
+
`pip install NaxToPy`
|
|
158
|
+
|
|
159
|
+
An alternative, if Python is callable from the command line:
|
|
157
160
|
|
|
158
|
-
`
|
|
161
|
+
`python -m pip install NaxToPy`
|
|
159
162
|
|
|
160
163
|
For **Visual Studio** users:
|
|
161
164
|
- Open "Python Environments" window
|
|
@@ -179,7 +182,7 @@ same directory. When ever you want to use the NaxToPy package add the following
|
|
|
179
182
|
|
|
180
183
|
If python is callable from the command line:
|
|
181
184
|
|
|
182
|
-
`
|
|
185
|
+
`python -m pip install -U NaxToPy`
|
|
183
186
|
|
|
184
187
|
For Visual Studio users:
|
|
185
188
|
- Open "Python Environments" window
|
|
@@ -260,6 +263,12 @@ the LoadCases that are critical or the Increment that is critical instead of the
|
|
|
260
263
|
2. New internal methods to look for the compatibility with low-level dependencies.
|
|
261
264
|
3. The name of the .log is now NaxToPy_Year-Month-Day.log.
|
|
262
265
|
|
|
266
|
+
### v.2.0.1
|
|
267
|
+
1. The compatibility is extended to all NaxTo steps of the same version.
|
|
268
|
+
2. The property N2PLoadCase.ActiveIncrement is subtitued by N2PLoadCase.ActiveN2PIncrement.
|
|
269
|
+
It uses an object instaed of an int.
|
|
270
|
+
3. Update of the examples of some docstrings.
|
|
271
|
+
|
|
263
272
|
# Documentation
|
|
264
273
|
|
|
265
274
|
**NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
|
|
@@ -339,7 +348,7 @@ loadcaseslist = model.LoadCases
|
|
|
339
348
|
pressure_lc = model.get_load_case("pressure")
|
|
340
349
|
|
|
341
350
|
# Change the active increment (by default is the last one):
|
|
342
|
-
pressure_lc.
|
|
351
|
+
pressure_lc.ActiveN2PIncrement = pressure_lc.get_increment(10)
|
|
343
352
|
|
|
344
353
|
# Look for all results
|
|
345
354
|
all_results = pressure_lc.Results
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|