NaxToPy 1.0.1__tar.gz → 1.1.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.
Files changed (49) hide show
  1. {NaxToPy-1.0.1/src/NaxToPy.egg-info → NaxToPy-1.1.1}/PKG-INFO +6 -2
  2. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/README.md +5 -1
  3. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/pyproject.toml +1 -1
  4. NaxToPy-1.1.1/src/NaxToPy/Core/Classes/AllClasses.py +15 -0
  5. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PComponent.py +25 -36
  6. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PCoord.py +7 -7
  7. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PLoadCase.py +9 -1
  8. NaxToPy-1.1.1/src/NaxToPy/Core/Classes/N2PModelInputData.py +12461 -0
  9. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PNode.py +9 -5
  10. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PProperty.py +118 -123
  11. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Constants/Constants.py +3 -3
  12. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Errors/N2PLog.py +8 -0
  13. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/N2PModelContent.py +13 -136
  14. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/__init__.py +1 -0
  15. {NaxToPy-1.0.1 → NaxToPy-1.1.1/src/NaxToPy.egg-info}/PKG-INFO +6 -2
  16. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy.egg-info/SOURCES.txt +1 -0
  17. NaxToPy-1.0.1/src/NaxToPy/Core/Classes/N2PModelInputData.py +0 -5214
  18. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/LICENSE +0 -0
  19. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/setup.cfg +0 -0
  20. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/setup.py +0 -0
  21. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PConnector.py +0 -0
  22. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PElement.py +0 -0
  23. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PFreeBody.py +0 -0
  24. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PIncrement.py +0 -0
  25. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PMaterial.py +0 -0
  26. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PResult.py +0 -0
  27. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PSection.py +0 -0
  28. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/N2PSet.py +0 -0
  29. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/ProgresBar.py +0 -0
  30. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Classes/__init__.py +0 -0
  31. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Constants/__init__.py +0 -0
  32. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Constants/librerias.py +0 -0
  33. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Errors/N2PColors.py +0 -0
  34. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Errors/N2PFileHandler.py +0 -0
  35. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Errors/__init__.py +0 -0
  36. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Reference_Finder/__Reference_Finder.py +0 -0
  37. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/Reference_Finder/__init__.py +0 -0
  38. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/_AuxFunc/_NetToPython.py +0 -0
  39. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/_AuxFunc/__init__.py +0 -0
  40. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Core/__init__.py +0 -0
  41. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Modules/N2PEnvelope/N2PEnvelope.py +0 -0
  42. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Modules/N2PEnvelope/__init__.py +0 -0
  43. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Modules/N2PtoEXE/N2PtoEXE.py +0 -0
  44. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Modules/N2PtoEXE/__init__.py +0 -0
  45. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/Modules/__init__.py +0 -0
  46. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy/NaxToPy.ico +0 -0
  47. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy.egg-info/dependency_links.txt +0 -0
  48. {NaxToPy-1.0.1 → NaxToPy-1.1.1}/src/NaxToPy.egg-info/requires.txt +0 -0
  49. {NaxToPy-1.0.1 → NaxToPy-1.1.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: 1.0.1
3
+ Version: 1.1.1
4
4
  Summary: Package for postprocessing FEM results in Python
5
5
  Home-page: https://idaerosolutions.com/
6
6
  Download-URL: https://appsource.microsoft.com/en-us/product/SaaS/idaerosolutionssl1685692009813.naxto?signInModalType=2&ctaType=1
@@ -196,11 +196,15 @@ To see previous version see the pre-release versions in https://test.pypi.org/pr
196
196
  2. Bug Fix: N2PLog.set_directory now works correctly
197
197
  3. New download page for NaxTo and NaxToPy
198
198
 
199
+ ### v.1.1.0
200
+ 1. Bug Fix: PSOLID with material coordinate = -1 is now suppported
201
+ 2. Now, it is possible to modify the BDF data from Nastran and rewrite the files.
202
+
199
203
  # Documentation
200
204
 
201
205
  **NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
202
206
 
203
- This version is only compatible with **NaxTo 2024.0.0**.
207
+ This version is only compatible with **NaxTo 2024.0.1**.
204
208
  Check in Programs and Features the NaxTo version that is installed.
205
209
 
206
210
  NaxToPy only use three dependeces:
@@ -72,11 +72,15 @@ To see previous version see the pre-release versions in https://test.pypi.org/pr
72
72
  2. Bug Fix: N2PLog.set_directory now works correctly
73
73
  3. New download page for NaxTo and NaxToPy
74
74
 
75
+ ### v.1.1.0
76
+ 1. Bug Fix: PSOLID with material coordinate = -1 is now suppported
77
+ 2. Now, it is possible to modify the BDF data from Nastran and rewrite the files.
78
+
75
79
  # Documentation
76
80
 
77
81
  **NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.
78
82
 
79
- This version is only compatible with **NaxTo 2024.0.0**.
83
+ This version is only compatible with **NaxTo 2024.0.1**.
80
84
  Check in Programs and Features the NaxTo version that is installed.
81
85
 
82
86
  NaxToPy only use three dependeces:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "NaxToPy"
7
- version = "1.0.1"
7
+ version = "1.1.1"
8
8
  license = {file = "LICENSE"}
9
9
  authors = [ { name = "Idaero Solutions", email = "manuel.sanchez@idaerosolutions.com" }, ]
10
10
  requires-python = ">=3.9"
@@ -0,0 +1,15 @@
1
+ from NaxToPy.Core.Classes.N2PComponent import *
2
+ from NaxToPy.Core.Classes.N2PResult import *
3
+ from NaxToPy.Core.Classes.ProgresBar import *
4
+ from NaxToPy.Core.Classes import N2PModelInputData
5
+ from NaxToPy.Core.Classes.N2PConnector import *
6
+ from NaxToPy.Core.Classes.N2PFreeBody import *
7
+ from NaxToPy.Core.Classes.N2PCoord import *
8
+ from NaxToPy.Core.Classes.N2PIncrement import *
9
+ from NaxToPy.Core.Classes.N2PSection import *
10
+ from NaxToPy.Core.Classes.N2PSet import *
11
+ from NaxToPy.Core.Classes.N2PMaterial import *
12
+ from NaxToPy.Core.Classes.N2PLoadCase import *
13
+ from NaxToPy.Core.Classes.N2PNode import *
14
+ from NaxToPy.Core.Classes.N2PElement import *
15
+ from NaxToPy.Core.Classes.N2PProperty import *
@@ -4,6 +4,8 @@ from VizzerClasses import N2ParamInputResults
4
4
  from VizzerClasses import N2TensorTransformation
5
5
  from array import array
6
6
  import numpy as np
7
+ from NaxToPy.Core._AuxFunc._NetToPython import _numpytonet
8
+ from typing import Union
7
9
 
8
10
 
9
11
  # Clase Component de Python
@@ -73,7 +75,7 @@ class N2PComponent:
73
75
  # Metodo para llamar a la funcion de VizzerClasses que devueleve el array de resultados como lista------------------
74
76
  def get_result_list(self, sections=None, aveSections=-1, cornerData=False, aveNodes=-1, variation=100,
75
77
  realPolar=0, coordsys: int = -1000,
76
- v1: tuple = (1,0,0), v2: tuple = (0,1,0)) -> tuple[list, str]:
78
+ v1: Union[tuple, np.ndarray] = (1,0,0), v2: Union[tuple, np.ndarray] = (0,1,0)) -> tuple[list, str]:
77
79
  """ Returns a tuple with the list of floats with the result array asked and a str with the position of the
78
80
  results
79
81
 
@@ -139,13 +141,7 @@ class N2PComponent:
139
141
 
140
142
  resultsParameters = self._create_n2paraminputresult(sections, aveSections, cornerData, aveNodes, variation,
141
143
  realPolar, coordsys, v1, v2)
142
-
143
- if self.__result_father__.__loadCase_father__.TypeLC == "DERIVED":
144
- results = list(self.__result_father__.__loadCase_father__._N2PLoadCase__n2loadcase.CalculateLastArray(
145
- resultsParameters, 0))
146
-
147
- else:
148
- results = list(
144
+ results = list(
149
145
  self.__result_father__.__loadCase_father__.__modelFather__._N2PModelContent__vzmodel.CalculateArrayLastResult(
150
146
  resultsParameters, 0))
151
147
 
@@ -163,7 +159,7 @@ class N2PComponent:
163
159
  # Metodo para llamar a la funcion de VizzerClasses que devuelve el array de resultados como array de numpy----------
164
160
  def get_result_ndarray(self, sections=None, aveSections=-1, cornerData=False, aveNodes=-1, variation=100,
165
161
  realPolar=0, coordsys: int = -1000,
166
- v1: tuple = (1,0,0), v2: tuple = (0,1,0)) -> tuple[np.array, str]:
162
+ v1: Union[tuple, np.ndarray ] = (1,0,0), v2: Union[tuple, np.ndarray ] = (0,1,0)) -> tuple[np.array, str]:
167
163
  """ Returns a tuple with the numpy array of floats with the result array asked and a str with the position of
168
164
  the results
169
165
 
@@ -205,9 +201,9 @@ class N2PComponent:
205
201
  -10 : User defined,
206
202
  >0 : Solver ID of the Predefined Coordinate System.
207
203
 
208
- v1: tuple
204
+ v1: tuple|ndarray
209
205
 
210
- v2: tuple -> Directions vectors that generate the coordinate system axis:
206
+ v2: tuple|ndarray -> Directions vectors that generate the coordinate system axis:
211
207
  x=v1,
212
208
  z=v1^v2,
213
209
  y=z^x.
@@ -378,7 +374,8 @@ class N2PComponent:
378
374
  cs_dict = self.__result_father__.__loadCase_father__.__modelFather__._N2PModelContent__vzmodel.CalculateArrayLastResult(
379
375
  formula, resultsParameters, 0)
380
376
 
381
- py_dict = {(int(key.split(":")[0].split("LC")[1]), int(key.split(":")[1][2:])): np.array(value, np.float64)
377
+ py_dict = {(int(key.split(":")[0].replace("DoF_LCD", "-").replace("DoF_LC", "")),
378
+ int(key.split(":")[1][2:])): np.array(value, np.float64)
382
379
  for key, value in dict(cs_dict[0]).items()}
383
380
 
384
381
  return py_dict
@@ -419,12 +416,12 @@ class N2PComponent:
419
416
  elif coordsys < 0 and (v1 != (1, 0, 0) or v2 != (0, 1, 0)):
420
417
  # Esto es una array de doubles. Si se quiere hacer una transformacion tanto en sistemas ya definidos en
421
418
  # el solver como por el usuario hay que pasarlo como argumento de N2ParamInputResult
422
- x, y, z = _get_axis(v1, v2)
423
- x_array = array("d", x)
424
- y_array = array("d", y)
425
- z_array = array("d", z)
426
- resultsParameters = N2ParamInputResults.structResults(0, x_array, y_array, z_array)
419
+ new_sys = _get_axis(v1, v2)
420
+ new_sys = _numpytonet(new_sys)
421
+
422
+ resultsParameters = N2ParamInputResults.structResults(0)
427
423
  resultsParameters.coordSys = -10
424
+ resultsParameters.orientationcoordinatesystem = new_sys
428
425
 
429
426
  elif coordsys == -1:
430
427
  resultsParameters = N2ParamInputResults.structResults(0)
@@ -519,31 +516,23 @@ class N2PComponent:
519
516
  # ----------------------------------------------------------------------------------------------------------------------
520
517
 
521
518
 
522
- def _get_axis(v1: tuple, v2: tuple) -> tuple:
519
+ def _get_axis(v1: Union[tuple, np.ndarray], v2: Union[tuple, np.ndarray]) -> np.ndarray:
523
520
  """Function that returns the components of the three vectors of a rectangular coordinate system
524
521
 
525
522
  Args:
526
- v1: tuple
527
- v2: tuple
523
+ v1: tuple|ndarray
524
+ v2: tuple|ndarray
528
525
 
529
526
  Returns:
530
- x, y, z: tuple
527
+ ndarray
531
528
  """
529
+ v1 = np.array(v1)
530
+ v1 = v1/np.linalg.norm(v1)
532
531
 
533
- n1 = (v1[0]**2 + v1[1]**2 + v1[2]**2)**0.5
534
- v1 = (v1[0]/n1, v1[1]/n1, v1[2]/n1)
535
-
536
- n2 = (v2[0]**2 + v2[1]**2 + v2[2]**2)**0.5
537
- v2 = (v2[0]/n2, v2[1]/n2, v2[2]/n2)
538
-
539
- x = v1
532
+ v2 = np.array(v2)
533
+ v2 = v2/np.linalg.norm(v2)
540
534
 
541
- z = (v1[1] * v2[2] - v1[2] * v2[1],
542
- v1[2] * v2[0] - v1[0] * v2[2],
543
- v1[0] * v2[1] - v1[1] * v2[0])
544
-
545
- y = (z[1] * x[2] - z[2] * x[1],
546
- z[2] * x[0] - z[0] * x[2],
547
- z[0] * x[1] - z[1] * x[0])
535
+ z = np.cross(v1, v2)
536
+ y = np.cross(z, v1)
548
537
 
549
- return x, y, z
538
+ return np.vstack((v1, y, z))
@@ -27,13 +27,13 @@ class N2PCoord(object):
27
27
  def ID(self) -> int:
28
28
  return int(self.__info.ID)
29
29
 
30
- @property
31
- def PartID(self) -> str:
32
- try:
33
- partid = int(self.__info.partID)
34
- except:
35
- partid = 0
36
- return self.__model__._N2PModelContent__partIDtoStr.get(self.__info.Part, -1)
30
+ # @property
31
+ # def PartID(self) -> str:
32
+ # try:
33
+ # partid = int(self.__info.partID)
34
+ # except:
35
+ # partid = 0
36
+ # return self.__model__._N2PModelContent__partIDtoStr.get(self.__info.Part, -1)
37
37
 
38
38
  @property
39
39
  def TypeSys(self) -> str:
@@ -27,7 +27,7 @@ class N2PLoadCase:
27
27
 
28
28
  # Constructor de N2PLoadCase ---------------------------------------------------------------------------------------
29
29
  def __init__(self, id, id_original, increments, increments_number_list, is_complex, lc_type, name, results,
30
- solution_type, model_father, n2loadcase):
30
+ solution_type, solver, model_father, n2loadcase):
31
31
  '''Python Load Case Constructor
32
32
  Input:
33
33
  ID: int -> Identification Number of the Load Case
@@ -37,6 +37,7 @@ class N2PLoadCase:
37
37
  IsComplex: bool -> boolean value. True if the LC is associated to a complex LC
38
38
  LCType: str -> Type of solution applied in the load case
39
39
  Name : str -> Name of the load case
40
+ Solver : str -> Solver of the load case
40
41
  Results: list[N2Results] -> list with instances of N2Results
41
42
  ----------
42
43
  Returns:
@@ -66,6 +67,7 @@ class N2PLoadCase:
66
67
 
67
68
  self.__solutiontype__ = solution_type
68
69
  self.__activeIncrement__ = list(increments)[-1].number
70
+ self.__solver__ = solver
69
71
  self.__modelFather__ = model_father
70
72
  self.__n2loadcase = n2loadcase
71
73
  # ------------------------------------------------------------------------------------------------------------------
@@ -155,6 +157,12 @@ class N2PLoadCase:
155
157
  return(str(self.__solutiontype__))
156
158
  # ------------------------------------------------------------------------------------------------------------------
157
159
 
160
+ # Metodo para obtener el solver del caso de carga ------------------------------------------------------------------
161
+ @property
162
+ def Solver(self) -> str:
163
+ return(str(self.__solver__))
164
+ # ------------------------------------------------------------------------------------------------------------------
165
+
158
166
  # Metodo para obtener los incrementos disponibles en el caso de carga ----------------------------------------------
159
167
  def get_increments(self, id: Union[int, str]) -> N2PIncrement:
160
168
  ''' Returns the N2PIncrement object with the id=ID or the id=Name of the Increment