Skip to content

Commit 2188a2f

Browse files
committed
Code restructuring
Added License Added readme
1 parent b2ddf9a commit 2188a2f

23 files changed

+1088
-131
lines changed

Notes renamed to DEV/Notes

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
#######################################################################################
22
KNOWN BUGS:
3-
-> check_geometry() in Class Geometry: Funktioniert nicht für Linien mit Steigung inf
4-
-> testing/output_gui_4_calcfem_C6 -> Fehlerhafte Zuordnung von Knoten zu Boundaries, vermutlich bei Netzerstellung bei Abzug negatives Element.. boundary_nodes_dict fehlerhaft
5-
-> Something is wring with saving the mesh in class Geometry
3+
-> check_geometry() in Class Geometry: DOes not work for 90° inclined lines
4+
-> Singular matrix for some meshes...
5+
-> compiled exe: save solution file does not work
66

77
#######################################################################################
88
TODOs:
9-
--> Neumann für HH lediglich Impedanz -> In GUI umbenennen oder so...
10-
--> GUI: Add button show geometry (nachdem Mesh generiert wurde)
11-
--> GUI: Schreibe in Infofenster alle Infos!
9+
--> GUI: More infos about mesh, bcs etc.
1210
--> Output solution consecutive filename
1311
--> Docstrings and typehints
14-
--> Weitere Überprüfung Geometrie auf Kompatibilität (Entweder in Klasse Geometry oder CreateBCParams)
15-
--> Hilfe-Button in Fenstern GUI, GEOMETRY und SHOWSOLUTION mit kleiner Erläuterung
16-
--> GEOMETRY: Bei Laden von Geometrie verschwindet Fenster GEOMETRY in Hintergrund
17-
--> Unit sollte aus Geometry in Solution übernommen werden und für Achsen angezeigt werden
18-
--> Bei ungültiger Geometrie wird CompatibilityError geraist --> sollte in Fehler-Fenster angezeigt werden
19-
--> Trace für Anzeige Class Geometry Nodes und Polygons ähnlich Boundary Definition
20-
--> Polygonerstellung und Punkteerstellung grafisch in Class Geometry ähnlich outdated Version von "Acoustics"
12+
--> Compatibility checks for geometry
2113
#######################################################################################
2214
CODEFLOW:
2315

@@ -109,5 +101,5 @@ GUI (automatisch nach solve_system()) -> Class ShowSolution
109101
#######################################################################################
110102

111103
Compile:
112-
pyinstaller --onefile --icon=tiny_fem_icon.ico gui.py
104+
pyinstaller --onefile --icon=tiny_fem_icon.ico main.py
113105

plot_reference.py renamed to DEV/plot_reference.py

+7-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
2-
Plot reference data from other FEM software
2+
Plot reference data from other FEM framework
33
"""
4+
45
import os
56
import numpy as np
67
import matplotlib.pyplot as plt
@@ -15,8 +16,8 @@
1516
HH_M = 'SPL' # Either P for Pressure or SPL for sound pressure levle
1617
############################################################
1718

18-
DATA_PATH_WLG = os.path.join('Verification', 'Verifikation WLG')
19-
DATA_PATH_HH = os.path.join('Verification', 'Verifikation_HH')
19+
DATA_PATH_WLG = os.path.join('../Verification', 'Verifikation WLG')
20+
DATA_PATH_HH = os.path.join('../Verification', 'Verifikation_HH')
2021
str_me = 'veri_wlg_' if EQ == 'HE' else 'veri_HH_'
2122
DATA_FILE = str_me + str(FILENBR) + '_100Hz.txt' # input file for verification
2223
POLY_FILE = str_me + str(FILENBR) + '_geom.txt' # for creating mesh in tinyfem
@@ -69,15 +70,10 @@ def plot_solution(solution_cloud, polygon_merged):
6970
z = solution_cloud[:, 2]
7071
z = np.nan_to_num(z, nan=0)
7172

72-
# Define polygon corner points TODO: read from data file
73-
74-
#polygon = Polygon(polygon_merged, closed=True, facecolor='white', linewidth=0)
75-
#plt.gca().add_patch(polygon)
76-
77-
# Create a triangulation
73+
polygon = Polygon(polygon_merged, closed=True, facecolor='white', linewidth=0)
74+
plt.gca().add_patch(polygon)
7875
triangulation = tri.Triangulation(x, y)
7976

80-
# Create a contour plot using tripcolor
8177
if EQ == 'HE':
8278
cmap = 'jet'
8379
else:
@@ -87,15 +83,13 @@ def plot_solution(solution_cloud, polygon_merged):
8783
cmap = 'inferno'
8884
contour = plt.tripcolor(triangulation, z, cmap=cmap, vmin=90, vmax=115)
8985
plt.colorbar()
90-
#contour.set_clip_path(polygon)
86+
contour.set_clip_path(polygon)
9187
plt.gca().set_aspect('equal')
9288

93-
# Customize labels and title
9489
plt.xlabel('X')
9590
plt.ylabel('Y')
9691
plt.title('Solution')
9792

98-
# Show the plot
9993
plt.show()
10094

10195
def read_polygon(polyfile):
@@ -155,8 +149,6 @@ def read_polygon(polyfile):
155149
return polygon_merged, poly_tinyfem
156150

157151

158-
159-
160152
def main():
161153
matplotlib.use('TkAgg')
162154
solution_cloud = open_file(PATH_SOL)

DEV/test1.py

Whitespace-only changes.

DEV/test2.py

Whitespace-only changes.

0 commit comments

Comments
 (0)