fdsreader 1.3.12__tar.gz → 1.7.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.
- {fdsreader-1.3.12 → fdsreader-1.7.1}/LICENSE +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/MANIFEST.in +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/PKG-INFO +14 -6
- {fdsreader-1.3.12 → fdsreader-1.7.1}/README.md +13 -1
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/_version.py +1 -1
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/bndf/ObstructionCollection.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/bndf/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/bndf/obstruction.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/bndf/utils.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/evac/EvacCollection.py +4 -1
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/evac/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/evac/evacuation.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/export/__init__.py +1 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/export/obst_exporter.py +6 -3
- fdsreader-1.7.1/fdsreader/export/sim_exporter.py +40 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/export/slcf_exporter.py +9 -8
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/export/smoke3d_exporter.py +10 -8
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/fds_classes/MeshCollection.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/fds_classes/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/fds_classes/mesh.py +1 -1
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/fds_classes/surface.py +2 -2
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/fds_classes/ventilation.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/geom/GeometryCollection.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/geom/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/geom/geometry.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/isof/IsosurfaceCollection.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/isof/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/isof/isosurface.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/part/ParticleCollection.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/part/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/part/particle.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/pl3d/Plot3DCollection.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/pl3d/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/pl3d/pl3d.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/settings.py +2 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/simulation.py +119 -106
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/slcf/GeomSliceCollection.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/slcf/SliceCollection.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/slcf/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/slcf/geomslice.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/slcf/slice.py +219 -110
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/smoke3d/Smoke3DCollection.py +3 -3
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/smoke3d/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/smoke3d/smoke3d.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/utils/__init__.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/utils/data.py +9 -4
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/utils/dimension.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/utils/extent.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/utils/fortran_data.py +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader/utils/misc.py +1 -1
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader.egg-info/PKG-INFO +14 -6
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader.egg-info/SOURCES.txt +2 -50
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader.egg-info/dependency_links.txt +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader.egg-info/requires.txt +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/fdsreader.egg-info/top_level.txt +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/requirements.txt +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/setup.cfg +0 -0
- {fdsreader-1.3.12 → fdsreader-1.7.1}/setup.py +0 -0
- fdsreader-1.3.12/.gitignore +0 -510
- fdsreader-1.3.12/.travis.yml +0 -51
- fdsreader-1.3.12/RELEASE.md +0 -235
- fdsreader-1.3.12/docs/bndf.rst +0 -20
- fdsreader-1.3.12/docs/conf.py +0 -73
- fdsreader-1.3.12/docs/devc.rst +0 -7
- fdsreader-1.3.12/docs/evac.rst +0 -14
- fdsreader-1.3.12/docs/fds_classes.rst +0 -17
- fdsreader-1.3.12/docs/geom.rst +0 -14
- fdsreader-1.3.12/docs/img/data-structure.drawio +0 -1
- fdsreader-1.3.12/docs/img/data-structure.svg +0 -3
- fdsreader-1.3.12/docs/index.rst +0 -34
- fdsreader-1.3.12/docs/isof.rst +0 -14
- fdsreader-1.3.12/docs/part.rst +0 -14
- fdsreader-1.3.12/docs/pl3d.rst +0 -14
- fdsreader-1.3.12/docs/quantity.rst +0 -7
- fdsreader-1.3.12/docs/simulation.rst +0 -7
- fdsreader-1.3.12/docs/slcf.rst +0 -26
- fdsreader-1.3.12/docs/smoke3d.rst +0 -14
- fdsreader-1.3.12/docs/utils.rst +0 -12
- fdsreader-1.3.12/examples/bndf/bndf_example_anim.py +0 -74
- fdsreader-1.3.12/examples/bndf/fds_data/wall_005.fds +0 -108
- fdsreader-1.3.12/examples/devc/devc_example.py +0 -11
- fdsreader-1.3.12/examples/devc/fds_steckler/steckler.fds +0 -40
- fdsreader-1.3.12/examples/evac/evac_example.py +0 -16
- fdsreader-1.3.12/examples/evac/fds_fed/fed_verification_multi_mesh.fds +0 -332
- fdsreader-1.3.12/examples/evac/fds_no_fed/stairs_evss_meshes.fds +0 -239
- fdsreader-1.3.12/examples/export/obst_export.py +0 -16
- fdsreader-1.3.12/examples/export/slcf_export.py +0 -16
- fdsreader-1.3.12/examples/export/smoke3d_export.py +0 -16
- fdsreader-1.3.12/examples/geom/fds_data/sphere_radiate.fds +0 -1443
- fdsreader-1.3.12/examples/geom/fds_geomslices/PWB01_GEOM.fds +0 -361
- fdsreader-1.3.12/examples/geom/geom_example.py +0 -18
- fdsreader-1.3.12/examples/geom/geom_slices.py +0 -16
- fdsreader-1.3.12/examples/isof/fds_steckler/input_steckler.fds +0 -122
- fdsreader-1.3.12/examples/isof/isof_example.py +0 -28
- fdsreader-1.3.12/examples/part/fds_data/impact.fds +0 -29
- fdsreader-1.3.12/examples/part/part_example.py +0 -42
- fdsreader-1.3.12/examples/pl3d/fds_data/vort3d_80.fds +0 -49
- fdsreader-1.3.12/examples/pl3d/pl3d_example.py +0 -43
- fdsreader-1.3.12/examples/slcf/fds_data/vort2d_80.fds +0 -30
- fdsreader-1.3.12/examples/slcf/fds_multimesh/multimesh.fds +0 -70
- fdsreader-1.3.12/examples/slcf/fds_steckler/input_steckler.fds +0 -45
- fdsreader-1.3.12/examples/slcf/slcf_example_global.py +0 -22
- fdsreader-1.3.12/examples/slcf/slcf_example_mask.py +0 -33
- fdsreader-1.3.12/examples/smoke3d/fds_steckler/input_steckler.fds +0 -36
- fdsreader-1.3.12/examples/smoke3d/smoke3d_example.py +0 -52
- fdsreader-1.3.12/tests/test.py +0 -16
- fdsreader-1.3.12/tests/test.smv +0 -334
|
File without changes
|
|
File without changes
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fdsreader
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.1
|
|
4
4
|
Summary: Python reader for data generated by FDS.
|
|
5
5
|
Home-page: https://github.com/FireDynamics/fdsreader
|
|
6
6
|
Author: FZJ IAS-7 (Prof. Dr. Lukas Arnold, Jan Vogelsang)
|
|
7
7
|
Author-email: j.vogelsang@fz-juelich.de
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Classifier: Programming Language :: Python :: 3
|
|
11
9
|
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
|
|
12
10
|
Classifier: Operating System :: OS Independent
|
|
@@ -17,7 +15,6 @@ License-File: LICENSE
|
|
|
17
15
|
# FDSReader
|
|
18
16
|
> Fast and easy-to-use Python reader for FDS data
|
|
19
17
|
|
|
20
|
-
[](https://travis-ci.com/FireDynamics/fdsreader)
|
|
21
18
|
[](https://badge.fury.io/py/fdsreader)
|
|
22
19
|
|
|
23
20
|
|
|
@@ -67,6 +64,19 @@ documentation of all classes check the API Documentation below.
|
|
|
67
64
|
## API Documentation
|
|
68
65
|
[https://firedynamics.github.io/fdsreader/](https://firedynamics.github.io/fdsreader/)
|
|
69
66
|
|
|
67
|
+
## Deployment
|
|
68
|
+
As the fdsreader has come a long way and the free capabilities of Travis CI have been used up, we now moved to manual CI/CD using a local docker container.
|
|
69
|
+
First, the Dockerfile has to be modified to make authentication to GitHub and PyPI possible from within the container.
|
|
70
|
+
To do so generate these two tokens:
|
|
71
|
+
PyPI: https://pypi.org/manage/account/token/
|
|
72
|
+
GitHub: https://github.com/settings/tokens/new (set the repo_deployment and public_repo scopes)
|
|
73
|
+
Now add these Tokens in the Dockerfile. To now deploy the fdsreader to PyPI and update the Github Pages (Documentation), run the following commands after pushing your changes to the FDSReader to GitHub (apart from the Dockerfile).
|
|
74
|
+
```bash
|
|
75
|
+
cd $REPO_ROOT_DIR
|
|
76
|
+
docker build . -t fdsreader-ci # Only needed the very first time
|
|
77
|
+
docker run --rm fdsreader-ci
|
|
78
|
+
```
|
|
79
|
+
|
|
70
80
|
## Meta
|
|
71
81
|
|
|
72
82
|
* Jan Vogelsang – j.vogelsang@fz-juelich.de
|
|
@@ -83,5 +93,3 @@ Distributed under the LGPLv3 (GNU Lesser General Public License v3) license. See
|
|
|
83
93
|
3. Commit your changes (`git commit -am 'Add some fooBar'`)
|
|
84
94
|
4. Push to the branch (`git push origin feature/fooBar`)
|
|
85
95
|
5. Create a new Pull Request
|
|
86
|
-
|
|
87
|
-
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# FDSReader
|
|
2
2
|
> Fast and easy-to-use Python reader for FDS data
|
|
3
3
|
|
|
4
|
-
[](https://travis-ci.com/FireDynamics/fdsreader)
|
|
5
4
|
[](https://badge.fury.io/py/fdsreader)
|
|
6
5
|
|
|
7
6
|
|
|
@@ -51,6 +50,19 @@ documentation of all classes check the API Documentation below.
|
|
|
51
50
|
## API Documentation
|
|
52
51
|
[https://firedynamics.github.io/fdsreader/](https://firedynamics.github.io/fdsreader/)
|
|
53
52
|
|
|
53
|
+
## Deployment
|
|
54
|
+
As the fdsreader has come a long way and the free capabilities of Travis CI have been used up, we now moved to manual CI/CD using a local docker container.
|
|
55
|
+
First, the Dockerfile has to be modified to make authentication to GitHub and PyPI possible from within the container.
|
|
56
|
+
To do so generate these two tokens:
|
|
57
|
+
PyPI: https://pypi.org/manage/account/token/
|
|
58
|
+
GitHub: https://github.com/settings/tokens/new (set the repo_deployment and public_repo scopes)
|
|
59
|
+
Now add these Tokens in the Dockerfile. To now deploy the fdsreader to PyPI and update the Github Pages (Documentation), run the following commands after pushing your changes to the FDSReader to GitHub (apart from the Dockerfile).
|
|
60
|
+
```bash
|
|
61
|
+
cd $REPO_ROOT_DIR
|
|
62
|
+
docker build . -t fdsreader-ci # Only needed the very first time
|
|
63
|
+
docker run --rm fdsreader-ci
|
|
64
|
+
```
|
|
65
|
+
|
|
54
66
|
## Meta
|
|
55
67
|
|
|
56
68
|
* Jan Vogelsang – j.vogelsang@fz-juelich.de
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -27,7 +27,7 @@ class EvacCollection(FDSDataCollection):
|
|
|
27
27
|
:ivar target_door_counters: Target door counts per time step.
|
|
28
28
|
"""
|
|
29
29
|
|
|
30
|
-
def __init__(self, evacs: Iterable[Evacuation], base_path: str):
|
|
30
|
+
def __init__(self, evacs: Iterable[Evacuation], base_path: str, times: Iterable[float]):
|
|
31
31
|
super().__init__(evacs)
|
|
32
32
|
|
|
33
33
|
self._file_paths: Dict[Mesh, str] = dict()
|
|
@@ -36,6 +36,8 @@ class EvacCollection(FDSDataCollection):
|
|
|
36
36
|
|
|
37
37
|
self._load_csv_data()
|
|
38
38
|
|
|
39
|
+
self.times = times
|
|
40
|
+
|
|
39
41
|
for evac in evacs:
|
|
40
42
|
evac.times = self.times
|
|
41
43
|
|
|
@@ -104,6 +106,7 @@ class EvacCollection(FDSDataCollection):
|
|
|
104
106
|
|
|
105
107
|
if not os.path.exists(file_path):
|
|
106
108
|
self._xyz = np.array([])
|
|
109
|
+
self._load_fed_data(0)
|
|
107
110
|
return
|
|
108
111
|
|
|
109
112
|
with open(file_path, 'rb') as infile:
|
|
File without changes
|
|
File without changes
|
|
@@ -16,7 +16,7 @@ def export_obst_raw(obst: Obstruction, output_dir: str, ordering: Literal['C', '
|
|
|
16
16
|
:param ordering: Whether to write the data in C or Fortran ordering.
|
|
17
17
|
"""
|
|
18
18
|
if len(obst.quantities) == 0:
|
|
19
|
-
return
|
|
19
|
+
return ""
|
|
20
20
|
|
|
21
21
|
from pathos.pools import ProcessPool as Pool
|
|
22
22
|
from multiprocess import Lock, Manager
|
|
@@ -117,6 +117,9 @@ def export_obst_raw(obst: Obstruction, output_dir: str, ordering: Literal['C', '
|
|
|
117
117
|
|
|
118
118
|
meta["Quantities"] = list(meta["Quantities"])
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
meta_file_path = os.path.join(output_dir, obst_filename_base + ".yaml")
|
|
121
|
+
with open(meta_file_path, 'w') as meta_file:
|
|
121
122
|
import yaml
|
|
122
|
-
yaml.dump(meta,
|
|
123
|
+
yaml.dump(meta, meta_file)
|
|
124
|
+
|
|
125
|
+
return meta_file_path
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing_extensions import Literal
|
|
3
|
+
from . import export_slcf_raw, export_obst_raw, export_smoke_raw
|
|
4
|
+
from .. import Simulation
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def export_sim(sim: Simulation, output_dir: str, ordering: Literal['C', 'F'] = 'C'):
|
|
8
|
+
"""Exports the 3d arrays to raw binary files with corresponding .yaml meta files.
|
|
9
|
+
|
|
10
|
+
:param sim: The :class:`Simulation` to export.
|
|
11
|
+
:param output_dir: The directory in which to save all files.
|
|
12
|
+
:param ordering: Whether to write the data in C or Fortran ordering.
|
|
13
|
+
"""
|
|
14
|
+
meta = {"Obstructions": list(), "Slices": list(), "Volumes": list(), "Hash": sim._hash}
|
|
15
|
+
|
|
16
|
+
for obst in sim.obstructions:
|
|
17
|
+
obst_path = export_obst_raw(obst, os.path.join(output_dir, "obst"), ordering)
|
|
18
|
+
if obst_path:
|
|
19
|
+
meta["Obstructions"].append(os.path.relpath(obst_path, output_dir).replace("\\", "/"))
|
|
20
|
+
|
|
21
|
+
for slc in sim.slices:
|
|
22
|
+
slice_path = export_slcf_raw(slc, os.path.join(output_dir, "slices", slc.quantity.name.replace(' ', '_').lower()), ordering)
|
|
23
|
+
if slice_path:
|
|
24
|
+
meta["Slices"].append(os.path.relpath(slice_path, output_dir).replace("\\", "/"))
|
|
25
|
+
|
|
26
|
+
for smoke in sim.smoke_3d:
|
|
27
|
+
volume_path = export_smoke_raw(smoke, os.path.join(output_dir, "smoke", smoke.quantity.name.replace(' ', '_').lower()), ordering)
|
|
28
|
+
if volume_path:
|
|
29
|
+
meta["Volumes"].append(os.path.relpath(volume_path, output_dir).replace("\\", "/"))
|
|
30
|
+
|
|
31
|
+
meta["NumObstructions"] = len(meta["Obstructions"])
|
|
32
|
+
meta["NumSlices"] = len(meta["Slices"])
|
|
33
|
+
meta["NumVolumes"] = len(meta["Volumes"])
|
|
34
|
+
|
|
35
|
+
import yaml
|
|
36
|
+
meta_file_path = os.path.join(output_dir, sim.chid + "-smv.yaml")
|
|
37
|
+
with open(meta_file_path, 'w') as metafile:
|
|
38
|
+
yaml.dump(meta, metafile)
|
|
39
|
+
|
|
40
|
+
return meta_file_path
|
|
@@ -15,7 +15,7 @@ def export_slcf_raw(slc: Slice, output_dir: str, ordering: Literal['C', 'F'] = '
|
|
|
15
15
|
from pathos.pools import ProcessPool as Pool
|
|
16
16
|
from multiprocess import Lock, Manager
|
|
17
17
|
slc2d = slc.type == '2D'
|
|
18
|
-
meta = {"DataValMax": float(slc.vmax), "DataValMin": float(slc.vmin), "ScaleFactor": 255. / (float(slc.vmax) - float(slc.vmin)),
|
|
18
|
+
meta = {"CellCentered": 1 if slc.cell_centered else 0, "DataValMax": float(slc.vmax), "DataValMin": float(slc.vmin), "ScaleFactor": 255. / (float(slc.vmax) - float(slc.vmin)),
|
|
19
19
|
"MeshNum": len(slc.subslices), "Quantity": slc.quantity.name}
|
|
20
20
|
|
|
21
21
|
filename_base = ("slice" + ("2D-" if slc2d else "3D-") + slc.id.lower()).replace(" ", "_").replace(".", "-")
|
|
@@ -49,18 +49,19 @@ def export_slcf_raw(slc: Slice, output_dir: str, ordering: Literal['C', 'F'] = '
|
|
|
49
49
|
meta["Meshes"].append({
|
|
50
50
|
"Mesh": mesh_id,
|
|
51
51
|
"DataFile": os.path.join(filename_base + "-data", filename),
|
|
52
|
-
"MeshPos": f"{
|
|
52
|
+
"MeshPos": f"{subslice.extent['x'][0]:.6} {subslice.extent['y'][0]:.6} {subslice.extent['z'][0]:.6}",
|
|
53
53
|
"Spacing": f"{spacing[0]:.6} {spacing[1]:.6} {spacing[2]:.6} {spacing[3]:.6}",
|
|
54
54
|
"DimSize": f"{shape[0]} {shape[1]} {shape[2]} {shape[3]}"
|
|
55
55
|
})
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
pool.close()
|
|
60
|
-
pool.join()
|
|
57
|
+
with Pool() as pool:
|
|
58
|
+
pool.map(lambda args: worker(*args), list(slc._subslices.items()))
|
|
61
59
|
|
|
62
60
|
meta["Meshes"] = list(meta["Meshes"])
|
|
63
61
|
|
|
64
|
-
|
|
62
|
+
meta_file_path = os.path.join(output_dir, filename_base + ".yaml")
|
|
63
|
+
with open(meta_file_path, 'w') as meta_file:
|
|
65
64
|
import yaml
|
|
66
|
-
yaml.dump(meta,
|
|
65
|
+
yaml.dump(meta, meta_file)
|
|
66
|
+
|
|
67
|
+
return meta_file_path
|
|
@@ -26,11 +26,12 @@ def export_smoke_raw(smoke3d: Smoke3D, output_dir: str, ordering: Literal['C', '
|
|
|
26
26
|
meta["DataValMin"] = min(meta["DataValMin"], np.min(subsmoke.data))
|
|
27
27
|
meta["DataValMax"] = float(meta["DataValMax"])
|
|
28
28
|
meta["DataValMin"] = float(meta["DataValMin"])
|
|
29
|
-
meta["ScaleFactor"] = 255.0 / meta["DataValMax"]
|
|
30
29
|
|
|
31
30
|
# Abort if no useful data is available
|
|
32
31
|
if meta["DataValMax"] <= 0:
|
|
33
|
-
return
|
|
32
|
+
return ""
|
|
33
|
+
|
|
34
|
+
meta["ScaleFactor"] = 255.0 / meta["DataValMax"]
|
|
34
35
|
|
|
35
36
|
m = Manager()
|
|
36
37
|
meta["Meshes"] = m.list()
|
|
@@ -61,13 +62,14 @@ def export_smoke_raw(smoke3d: Smoke3D, output_dir: str, ordering: Literal['C', '
|
|
|
61
62
|
"DimSize": f"{data.shape[0]} {data.shape[1]} {data.shape[2]} {data.shape[3]}"
|
|
62
63
|
})
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
pool.close()
|
|
67
|
-
pool.join()
|
|
65
|
+
with Pool() as pool:
|
|
66
|
+
pool.map(lambda args: worker(*args), list(smoke3d._subsmokes.items()))
|
|
68
67
|
|
|
69
68
|
meta["Meshes"] = list(meta["Meshes"])
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
meta_file_path = os.path.join(output_dir, filename_base + ".yaml")
|
|
71
|
+
with open(meta_file_path, 'w') as meta_file:
|
|
72
72
|
import yaml
|
|
73
|
-
yaml.dump(meta,
|
|
73
|
+
yaml.dump(meta, meta_file)
|
|
74
|
+
|
|
75
|
+
return meta_file_path
|
|
File without changes
|
|
File without changes
|
|
@@ -65,7 +65,7 @@ class Mesh:
|
|
|
65
65
|
"""Marks all cells of a single slice which are blocked by an obstruction.
|
|
66
66
|
|
|
67
67
|
:returns: A 4-dimensional array with time as first and x,y,z as last dimensions. The array depends on time as
|
|
68
|
-
|
|
68
|
+
obstructions may be hidden as specific points in time.
|
|
69
69
|
"""
|
|
70
70
|
orientation = subslice.orientation
|
|
71
71
|
value = subslice.extent[orientation][0]
|
|
@@ -2,8 +2,8 @@ from typing import Optional, Tuple
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class Surface:
|
|
5
|
-
"""Surface objects describe what bounding surfaces consist of. Boundary conditions for
|
|
6
|
-
|
|
5
|
+
"""Surface objects describe what bounding surfaces consist of. Boundary conditions for obstructions and vents are
|
|
6
|
+
prescribed by referencing the appropriate surface.
|
|
7
7
|
|
|
8
8
|
:ivar name: Name of the surface.
|
|
9
9
|
:ivar material_emissivity: Emissivity of the material.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|