patme 0.4.4__py3-none-any.whl

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.

Potentially problematic release.


This version of patme might be problematic. Click here for more details.

Files changed (46) hide show
  1. patme/__init__.py +52 -0
  2. patme/buildtools/__init__.py +7 -0
  3. patme/buildtools/rce_releasecreator.py +336 -0
  4. patme/buildtools/release.py +26 -0
  5. patme/femtools/__init__.py +5 -0
  6. patme/femtools/abqmsgfilechecker.py +137 -0
  7. patme/femtools/fecall.py +1092 -0
  8. patme/geometry/__init__.py +0 -0
  9. patme/geometry/area.py +124 -0
  10. patme/geometry/coordinatesystem.py +635 -0
  11. patme/geometry/intersect.py +284 -0
  12. patme/geometry/line.py +183 -0
  13. patme/geometry/misc.py +420 -0
  14. patme/geometry/plane.py +464 -0
  15. patme/geometry/rotate.py +244 -0
  16. patme/geometry/scale.py +152 -0
  17. patme/geometry/shape2d.py +50 -0
  18. patme/geometry/transformations.py +1831 -0
  19. patme/geometry/translate.py +139 -0
  20. patme/mechanics/__init__.py +4 -0
  21. patme/mechanics/loads.py +435 -0
  22. patme/mechanics/material.py +1260 -0
  23. patme/service/__init__.py +7 -0
  24. patme/service/decorators.py +85 -0
  25. patme/service/duration.py +96 -0
  26. patme/service/exceptionhook.py +104 -0
  27. patme/service/exceptions.py +36 -0
  28. patme/service/io/__init__.py +3 -0
  29. patme/service/io/basewriter.py +122 -0
  30. patme/service/logger.py +375 -0
  31. patme/service/mathutils.py +108 -0
  32. patme/service/misc.py +71 -0
  33. patme/service/moveimports.py +217 -0
  34. patme/service/stringutils.py +419 -0
  35. patme/service/systemutils.py +290 -0
  36. patme/sshtools/__init__.py +3 -0
  37. patme/sshtools/cara.py +435 -0
  38. patme/sshtools/clustercaller.py +420 -0
  39. patme/sshtools/facluster.py +350 -0
  40. patme/sshtools/sshcall.py +168 -0
  41. patme-0.4.4.dist-info/LICENSE +21 -0
  42. patme-0.4.4.dist-info/LICENSES/MIT.txt +9 -0
  43. patme-0.4.4.dist-info/METADATA +168 -0
  44. patme-0.4.4.dist-info/RECORD +46 -0
  45. patme-0.4.4.dist-info/WHEEL +4 -0
  46. patme-0.4.4.dist-info/entry_points.txt +3 -0
File without changes
patme/geometry/area.py ADDED
@@ -0,0 +1,124 @@
1
+ # Copyright (C) 2020 Deutsches Zentrum fuer Luft- und Raumfahrt(DLR, German Aerospace Center) <www.dlr.de>
2
+ # SPDX-FileCopyrightText: 2022 German Aerospace Center (DLR)
3
+ #
4
+ # SPDX-License-Identifier: MIT
5
+
6
+
7
+ import numpy as np
8
+
9
+ from patme.geometry.translate import Translation
10
+
11
+
12
+ class Area:
13
+ def __init__(self, lines=None, areaID=None, **kwargs):
14
+ """doc"""
15
+ self.cutout = None
16
+ self._surfaceArea = None
17
+ self._centerOfArea = None
18
+ self.id = areaID
19
+ self.splitAreaIDs = []
20
+ if not lines:
21
+ lines = []
22
+
23
+ self._lines = lines
24
+ self.innerLines = kwargs.get("innerLines", [])
25
+
26
+ def toggleLineOrder(self):
27
+ """changes the order of each line: first line will be last line etc."""
28
+ raise Exception("Not implemented")
29
+
30
+ def toggleLineDirection(self):
31
+ """changes the direction of the lines: first line stays intact, second line will be last line etc."""
32
+ raise Exception("Not implemented")
33
+
34
+ def _getKeypoints(self):
35
+ """doc"""
36
+ keypts = []
37
+ for line in self.lines:
38
+ for pt in line.keypoints:
39
+ if pt not in keypts:
40
+ keypts.append(pt)
41
+ return keypts
42
+
43
+ def _getSurfaceArea(self):
44
+ """Split area in triangles and calculate their surface area(flaecheninhalt).
45
+ assumption: concave area(which is not checked automatically)
46
+
47
+ The distances are calculated. With this, the angle gamma can be calculated
48
+ which encloses the two smallest lines. Then, the surface area for this triangle
49
+ is calculated.
50
+ Calculates also the center of area during surface area calculation. These centers
51
+ are cumulated to the total center of area."""
52
+ if self._surfaceArea is None:
53
+ if len(self.lines) < 3:
54
+ self._surfaceArea = 0.0
55
+ self._centerOfArea = Translation()
56
+ else:
57
+ keypoints = self.keypoints
58
+ midKeypoint = keypoints[0]
59
+ lastKeypoint = keypoints[1]
60
+ totalSurfaceArea = 0.0
61
+ centerOfArea = np.zeros(3)
62
+ for keypoint in keypoints[2:]:
63
+ distances = sorted(
64
+ [
65
+ midKeypoint.distance(lastKeypoint),
66
+ lastKeypoint.distance(keypoint),
67
+ keypoint.distance(midKeypoint),
68
+ ]
69
+ )
70
+
71
+ # source: http://de.wikipedia.org/wiki/Dreiecksfl%C3%A4che#Zwei_Seitenl.C3.A4ngen_und_eingeschlossener_Winkel_gegeben
72
+ gamma = np.arccos(
73
+ (distances[0] ** 2 + distances[1] ** 2 - distances[-1] ** 2) / (2 * distances[0] * distances[1])
74
+ )
75
+ surfaceArea = 0.5 * distances[0] * distances[1] * np.sin(gamma)
76
+ totalSurfaceArea += surfaceArea
77
+ centerOfArea += np.mean([midKeypoint, lastKeypoint, keypoint], 0) * surfaceArea
78
+ lastKeypoint = keypoint
79
+
80
+ self._surfaceArea = totalSurfaceArea
81
+ self._centerOfArea = Translation(centerOfArea / totalSurfaceArea)
82
+
83
+ return self._surfaceArea
84
+
85
+ def getCenterOfArea(self):
86
+ """Returns a translation which is the mean of all keypoints"""
87
+ return np.sum(self.keypoints, 0) / len(self.keypoints)
88
+
89
+ def commonLine(self, otherArea):
90
+ """doc"""
91
+ commonLines = set(self.lines) & set(otherArea.lines)
92
+ if commonLines != set():
93
+ return commonLines.pop()
94
+ return None
95
+
96
+ def _getCenterOfArea(self):
97
+ """see _getSurfaceArea"""
98
+ if self._centerOfArea is None:
99
+ self.surfaceArea
100
+ return self._centerOfArea
101
+
102
+ def _getLines(self):
103
+ return self._lines
104
+
105
+ def _setLines(self, value):
106
+ self._lines = value
107
+
108
+ def _getNormalDirection(self):
109
+ l1, l2 = self.lines[:2]
110
+ p1 = (set(l1.keypoints) & set(l2.keypoints)).pop()
111
+ p0 = set(l1.keypoints).difference({p1}).pop()
112
+ p2 = set(l2.keypoints).difference({p1}).pop()
113
+ return Translation(np.cross(p1 - p0, p2 - p0))
114
+
115
+ normalDirection = property(fget=_getNormalDirection)
116
+ """Returns normal direction of self"""
117
+
118
+ lines = property(fget=_getLines, fset=_setLines)
119
+ keypoints = property(fget=_getKeypoints)
120
+ surfaceArea = property(fget=_getSurfaceArea)
121
+ """flaecheninhalt"""
122
+ centerOfArea = property(fget=_getCenterOfArea)
123
+ """Calculates the center of area during surface area calculation. These centers
124
+ are cumulated to the total center of area."""