Skip to content

Commit aaf1335

Browse files
committed
Migrate to yaml input + pyvista instead of vtk
This commit provides the migration from the old .dat input files requiring complex dedicated reading and writing routines to the new yaml input format. Moreover we switch from vtk to pyvista visualization. Specifically, the following work was performed: - New reading and writing routines were implemented which make use of fourcipp's FourCInput class. Thus, they also validate the input files before visualization and before exporting them. We now only support the in/out formats: .yaml, .yml. What was also added: read-in and write (export) error messages (in the GUI and in the terminal), in case that either the file validation or the lnmmeshio conversion to vtu fails. - Replaced the vtk visualization of the input file with pyvista which provides more comfortable handling of geometry data. Also, it provides a nice utilities bar containing tools such as the coordinate system, the edge visibility, certain views ... The plot was also significantly enhanced optically (more color-blind friendly colors, legend, design conditions now also visualized using spheres allowing for reasonable scaling based on the current problem size,...). - A new TrameApp class named FourCWebserver was implemented which improves the organization of all server- and client-relevant data. It holds server-only variables, and state variables shared between server and client (as well as controller methods and change events). Similarly to the previous approach, there are specific sections, such as e.g. Materials, Design Conditions, Result Description,... which are handled in a section-specific manner as opposed to the more general settings sections, such as e.g. STRUCTURE DYNAMIC. The server-only section variables basically hold the fourc yaml content in the same data structures as the input file, while the state variables organize the date in a more client-friendly manner. For each of the section types we have an initialization routine (for both server-only and state variables), and a sync-back routine converting the current state to the server-only variables used subsequently for the export. The data organization within each section is now also significantly improved in comparison with the previous main, by saving state variables in nested dicts which are more easily accessible than the large multi-dimensional arrays used previously. - Improvement of the GUI: rework of the specific section panels Materials, Design Conditions, Result Description and Functions to more closely match the current yaml content structure and require less processing to obtain dedicated state variables. An important point is that input files with all types of functions can now be entered into the Webviewer (as opposed to previously) - although the plot visualization of specific function types remains to be done (only SYMBOLIC_FUNCTION_OF_SPACE_TIME currently supported).
1 parent f1a7026 commit aaf1335

18 files changed

+3395
-2465
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "fourc_webviewer"
77
version = "2.0"
88
description = "4C webviewer"
99
readme = "README.md"
10-
requires-python = ">=3.10"
10+
requires-python = ">=3.12"
1111
dynamic = ["dependencies"]
1212

1313
[project.scripts]

requirements.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
lnmmeshio
21
trame
32
trame-vuetify
43
trame-vtk
54
trame-components
65
trame-plotly
76
plotly
87
pandas
8+
pyvista
99
vtk
10-
numpy
10+
numpy
11+
# include fourcipp from github
12+
git+https://github.com/4C-multiphysics/fourcipp.git
13+
lnmmeshio>=5.6.2

requirements.txt

Lines changed: 105 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,171 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.10
2+
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
5-
# pip-compile
5+
# pip-compile --all-extras --output-file=requirements.txt requirements.in
66
#
7-
aiohttp==3.9.3
8-
# via wslink
9-
aiosignal==1.3.1
10-
# via aiohttp
11-
async-timeout==4.0.3
7+
aiohappyeyeballs==2.6.1
128
# via aiohttp
13-
attrs==23.2.0
9+
aiohttp==3.11.18
10+
# via wslink
11+
aiosignal==1.3.2
1412
# via aiohttp
15-
contourpy==1.2.0
13+
attrs==25.3.0
14+
# via
15+
# aiohttp
16+
# fourcipp
17+
# jsonschema
18+
# referencing
19+
contourpy==1.3.2
1620
# via matplotlib
1721
cycler==0.12.1
1822
# via matplotlib
19-
fonttools==4.50.0
23+
deprecation==2.1.0
24+
# via
25+
# fourcipp
26+
# rapidyaml
27+
fonttools==4.57.0
2028
# via matplotlib
21-
frozenlist==1.4.1
29+
fourcipp @ git+https://github.com/4C-multiphysics/fourcipp.git
30+
# via -r requirements.in
31+
frozenlist==1.6.0
2232
# via
2333
# aiohttp
2434
# aiosignal
25-
idna==3.6
35+
idna==3.10
2636
# via yarl
27-
kiwisolver==1.4.5
37+
jsonschema==4.23.0
38+
# via fourcipp
39+
jsonschema-rs==0.29.1
40+
# via fourcipp
41+
jsonschema-specifications==2024.10.1
42+
# via
43+
# fourcipp
44+
# jsonschema
45+
kiwisolver==1.4.8
2846
# via matplotlib
29-
lnmmeshio==5.3.0
47+
lnmmeshio==5.4.0
3048
# via -r requirements.in
49+
loguru==0.7.3
50+
# via fourcipp
3151
markdown-it-py==3.0.0
3252
# via rich
33-
matplotlib==3.8.3
53+
matplotlib==3.10.1
3454
# via vtk
3555
mdurl==0.1.2
3656
# via markdown-it-py
3757
meshio==5.3.5
3858
# via lnmmeshio
39-
more-itertools==10.2.0
59+
more-itertools==10.7.0
4060
# via trame-server
41-
multidict==6.0.5
61+
msgpack==1.1.0
62+
# via wslink
63+
multidict==6.4.3
4264
# via
4365
# aiohttp
4466
# yarl
45-
numpy==1.26.4
67+
narwhals==1.38.0
68+
# via plotly
69+
numpy==2.2.4
4670
# via
4771
# -r requirements.in
4872
# contourpy
73+
# fourcipp
4974
# lnmmeshio
5075
# matplotlib
5176
# meshio
5277
# pandas
53-
packaging==24.0
78+
packaging==24.2
5479
# via
80+
# deprecation
81+
# fourcipp
5582
# matplotlib
5683
# plotly
57-
pandas==2.2.1
84+
pandas==2.2.3
5885
# via -r requirements.in
59-
pillow==10.2.0
86+
pillow==11.2.1
6087
# via matplotlib
61-
plotly==5.20.0
62-
# via -r requirements.in
88+
plotly==6.0.1
89+
# via
90+
# -r requirements.in
91+
# trame-plotly
6392
progress==1.6
6493
# via lnmmeshio
65-
pygments==2.17.2
94+
propcache==0.3.1
95+
# via
96+
# aiohttp
97+
# yarl
98+
pygments==2.19.1
6699
# via rich
67-
pyparsing==3.1.2
100+
pyparsing==3.2.3
68101
# via matplotlib
69102
python-dateutil==2.9.0.post0
70103
# via
71104
# matplotlib
72105
# pandas
73-
python-utils==3.8.2
106+
python-utils==3.9.1
74107
# via lnmmeshio
75-
pytz==2024.1
108+
pytz==2025.2
76109
# via pandas
77-
rich==13.7.1
110+
pyyaml==6.0.2
111+
# via trame
112+
rapidyaml==0.8.0
113+
# via fourcipp
114+
referencing==0.36.2
115+
# via
116+
# fourcipp
117+
# jsonschema
118+
# jsonschema-specifications
119+
rich==14.0.0
78120
# via meshio
79-
six==1.16.0
121+
rpds-py==0.23.1
122+
# via
123+
# fourcipp
124+
# jsonschema
125+
# referencing
126+
ruamel-yaml==0.18.10
127+
# via fourcipp
128+
ruamel-yaml-clib==0.2.12
129+
# via
130+
# fourcipp
131+
# ruamel-yaml
132+
six==1.17.0
80133
# via python-dateutil
81-
tenacity==8.2.3
82-
# via plotly
83-
trame==3.5.4
134+
trame==3.9.0
84135
# via -r requirements.in
85-
trame-client==2.16.5
136+
trame-client==3.8.2
86137
# via
87138
# trame
88139
# trame-components
89140
# trame-plotly
90141
# trame-vtk
91142
# trame-vuetify
92-
trame-components==2.2.1
143+
trame-common==0.2.0
144+
# via
145+
# trame
146+
# trame-client
147+
trame-components==2.4.2
93148
# via -r requirements.in
94-
trame-plotly==3.0.2
149+
trame-plotly==3.1.0
95150
# via -r requirements.in
96-
trame-server==2.17.2
151+
trame-server==3.4.0
97152
# via trame
98-
trame-vtk==2.8.5
153+
trame-vtk==2.8.15
99154
# via -r requirements.in
100-
trame-vuetify==2.4.3
155+
trame-vuetify==3.0.1
101156
# via -r requirements.in
102-
typing-extensions==4.10.0
103-
# via python-utils
104-
tzdata==2024.1
157+
typing-extensions==4.12.2
158+
# via
159+
# fourcipp
160+
# python-utils
161+
# referencing
162+
tzdata==2025.2
105163
# via pandas
106-
vtk==9.3.0
164+
vtk==9.4.2
107165
# via -r requirements.in
108-
wslink==1.12.4
109-
# via trame-server
110-
yarl==1.9.4
166+
wslink==2.3.3
167+
# via
168+
# trame
169+
# trame-server
170+
yarl==1.20.0
111171
# via aiohttp

src/fourc_webviewer/cli_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def get_arguments():
1818
dict: Arguments dictionary
1919
"""
2020
parser = argparse.ArgumentParser(description="4C Webviewer")
21-
parser.add_argument("--dat_file", type=str, help="input file path to visualize")
21+
parser.add_argument(
22+
"--fourc_yaml_file", type=str, help="input file path to visualize"
23+
)
2224

2325
args = parser.parse_args()
2426

0 commit comments

Comments
 (0)