forked from do-wen/fem_for_phase_transitions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimulationData.py
More file actions
81 lines (68 loc) · 3.76 KB
/
Copy pathSimulationData.py
File metadata and controls
81 lines (68 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# A Finite Element Method for Phase Transitions in Rarefied Gas Dynamics
# Copyright (C) 2026 D. Weniger
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from collections import namedtuple
from dataclasses import dataclass
MaterialParameters_Type1 = namedtuple("MaterialParameters", ["TAU",
"GAMMA",
"H",
"ETA",
"XI",
"KN",
"VARTHETA"])
MaterialParameters_Type2 = namedtuple("MaterialParameters", ["TAU",
"GAMMA",
"H",
"ETA",
"T_F"])
MaterialParameters_Type4 = namedtuple("MaterialParameters", ["RHO1", "RHO2", "MU1", "MU2", "SIGMA"])
SimulationParameters = namedtuple("SimulationParameters", ["NUM_STEPS",
"START_TIME",
"END_TIME",
"MIN_ELEM_SIZE",
"MAX_ELEM_SIZE",
"BOX_COORDS",
"DT",
"VERBOSE",
"LOGGING",
"HAUSD",
"HGRAD",
"RMC"], defaults=[0.01, 1.1, 0.0001])
MappingParameters = namedtuple("Mapping", ["TransitionPoints", "Markers"])
@dataclass
class InterpolationData:
RECOMPUTE_LEVELSET_INTERVALL: int = None
STEP: int = None
SYSTEM_OLD = None
PHI_OLD = None
@dataclass
class SimulationData:
simulation_parameters: SimulationParameters
material_parameters: MaterialParameters_Type1 | MaterialParameters_Type2 | MaterialParameters_Type4
interpolation_data : InterpolationData = None
mapping_parameters : MappingParameters = None
def print(self) -> None:
if self.simulation_parameters is not None:
print("-----SIMULATION-PARAMETERS-----")
for name, value in self.simulation_parameters._asdict().items():
print(f"{name}: {value}")
if self.interpolation_data is not None:
print(f"RECOMPUTE-INTERVALL: {self.interpolation_data.RECOMPUTE_LEVELSET_INTERVALL}")
print("-------------------------------")
if self.material_parameters is not None:
print("------MATERIAL-PARAMETERS------")
for name, value in self.material_parameters._asdict().items():
print(f"{name}: {value}")
print("-------------------------------")