ovftoolkit 0.3.0__cp312-abi3-win_amd64.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.
- ovftoolkit/__init__.py +6 -0
- ovftoolkit/__init__.pyi +6 -0
- ovftoolkit/_native.pyd +0 -0
- ovftoolkit/_native.pyi +223 -0
- ovftoolkit/arrays.py +25 -0
- ovftoolkit/py.typed +1 -0
- ovftoolkit/spectrum.py +97 -0
- ovftoolkit-0.3.0.dist-info/METADATA +322 -0
- ovftoolkit-0.3.0.dist-info/RECORD +15 -0
- ovftoolkit-0.3.0.dist-info/WHEEL +5 -0
- ovftoolkit-0.3.0.dist-info/licenses/LICENSE +21 -0
- ovftoolkit-0.3.0.dist-info/licenses/LICENSES/mdspan.txt +238 -0
- ovftoolkit-0.3.0.dist-info/licenses/LICENSES/nanobind.txt +26 -0
- ovftoolkit-0.3.0.dist-info/licenses/LICENSING.md +54 -0
- ovftoolkit-0.3.0.dist-info/licenses/THIRD_PARTY_NOTICES.md +27 -0
ovftoolkit/__init__.py
ADDED
ovftoolkit/__init__.pyi
ADDED
ovftoolkit/_native.pyd
ADDED
|
Binary file
|
ovftoolkit/_native.pyi
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"""Opaque Python bindings for OVFToolkit"""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Iterator, Sequence
|
|
4
|
+
import enum
|
|
5
|
+
from typing import overload
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class OVFVersion(enum.Enum):
|
|
9
|
+
OVF0 = 0
|
|
10
|
+
|
|
11
|
+
OVF1 = 1
|
|
12
|
+
|
|
13
|
+
OVF2 = 2
|
|
14
|
+
|
|
15
|
+
Unknown = 3
|
|
16
|
+
|
|
17
|
+
class MeshType(enum.Enum):
|
|
18
|
+
Irregular = 0
|
|
19
|
+
|
|
20
|
+
Rectangular = 1
|
|
21
|
+
|
|
22
|
+
class Reader:
|
|
23
|
+
def __enter__(self) -> Reader: ...
|
|
24
|
+
|
|
25
|
+
def __exit__(self, exception_type: object | None, exception: object | None, traceback: object | None) -> bool: ...
|
|
26
|
+
|
|
27
|
+
def __len__(self) -> int: ...
|
|
28
|
+
|
|
29
|
+
def __iter__(self) -> ReaderIterator: ...
|
|
30
|
+
|
|
31
|
+
def __getitem__(self, arg: int, /) -> VField: ...
|
|
32
|
+
|
|
33
|
+
def read(self, segment: int = 0) -> VField: ...
|
|
34
|
+
|
|
35
|
+
def header(self, segment: int = 0) -> SegmentHeader: ...
|
|
36
|
+
|
|
37
|
+
def close(self) -> None: ...
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def closed(self) -> bool: ...
|
|
41
|
+
|
|
42
|
+
class ReaderIterator:
|
|
43
|
+
def __iter__(self) -> ReaderIterator: ...
|
|
44
|
+
|
|
45
|
+
def __next__(self) -> VField: ...
|
|
46
|
+
|
|
47
|
+
class Writer:
|
|
48
|
+
def __enter__(self) -> Writer: ...
|
|
49
|
+
|
|
50
|
+
def __exit__(self, exception_type: object | None, exception: object | None, traceback: object | None) -> bool: ...
|
|
51
|
+
|
|
52
|
+
def write(self, arg: VField, /) -> None: ...
|
|
53
|
+
|
|
54
|
+
def close(self) -> None: ...
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def closed(self) -> bool: ...
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def segments_written(self) -> int: ...
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def deduction_report(self) -> str: ...
|
|
64
|
+
|
|
65
|
+
def reader(path: object, eager: bool = False) -> Reader:
|
|
66
|
+
"""Open an OVF reader; data loading is lazy by default"""
|
|
67
|
+
|
|
68
|
+
def writer(path: object, segments: int = 1, deduction_iterations: int = 5) -> Writer:
|
|
69
|
+
"""Create a streaming OVF writer with automatic header deduction"""
|
|
70
|
+
|
|
71
|
+
class OVFParameter(enum.Enum):
|
|
72
|
+
version = 0
|
|
73
|
+
|
|
74
|
+
Title = 4
|
|
75
|
+
|
|
76
|
+
Desc = 6
|
|
77
|
+
|
|
78
|
+
meshunit = 7
|
|
79
|
+
|
|
80
|
+
valueunits = 8
|
|
81
|
+
|
|
82
|
+
valuemultiplier = 9
|
|
83
|
+
|
|
84
|
+
valuelabels = 10
|
|
85
|
+
|
|
86
|
+
valuedim = 11
|
|
87
|
+
|
|
88
|
+
xmin = 12
|
|
89
|
+
|
|
90
|
+
ymin = 13
|
|
91
|
+
|
|
92
|
+
zmin = 14
|
|
93
|
+
|
|
94
|
+
xmax = 15
|
|
95
|
+
|
|
96
|
+
ymax = 16
|
|
97
|
+
|
|
98
|
+
zmax = 17
|
|
99
|
+
|
|
100
|
+
boundary = 18
|
|
101
|
+
|
|
102
|
+
ValueRangeMaxMag = 19
|
|
103
|
+
|
|
104
|
+
ValueRangeMinMag = 20
|
|
105
|
+
|
|
106
|
+
Meshtype = 21
|
|
107
|
+
|
|
108
|
+
pointcount = 22
|
|
109
|
+
|
|
110
|
+
xbase = 23
|
|
111
|
+
|
|
112
|
+
ybase = 24
|
|
113
|
+
|
|
114
|
+
zbase = 25
|
|
115
|
+
|
|
116
|
+
xstepsize = 26
|
|
117
|
+
|
|
118
|
+
ystepsize = 27
|
|
119
|
+
|
|
120
|
+
zstepsize = 28
|
|
121
|
+
|
|
122
|
+
xnodes = 29
|
|
123
|
+
|
|
124
|
+
ynodes = 30
|
|
125
|
+
|
|
126
|
+
znodes = 31
|
|
127
|
+
|
|
128
|
+
class SegmentHeader:
|
|
129
|
+
@overload
|
|
130
|
+
def __init__(self) -> None: ...
|
|
131
|
+
|
|
132
|
+
@overload
|
|
133
|
+
def __init__(self, arg: OVFVersion, /) -> None: ...
|
|
134
|
+
|
|
135
|
+
def __contains__(self, arg: object, /) -> bool: ...
|
|
136
|
+
|
|
137
|
+
def __len__(self) -> int: ...
|
|
138
|
+
|
|
139
|
+
def __iter__(self) -> Iterator: ...
|
|
140
|
+
|
|
141
|
+
def __getitem__(self, arg: object, /) -> object: ...
|
|
142
|
+
|
|
143
|
+
def __setitem__(self, key: object, value: object | None) -> None: ...
|
|
144
|
+
|
|
145
|
+
def __delitem__(self, arg: object, /) -> None: ...
|
|
146
|
+
|
|
147
|
+
def keys(self) -> list: ...
|
|
148
|
+
|
|
149
|
+
def values(self) -> list: ...
|
|
150
|
+
|
|
151
|
+
def items(self) -> list: ...
|
|
152
|
+
|
|
153
|
+
def copy_from(self, source: SegmentHeader) -> None:
|
|
154
|
+
"""
|
|
155
|
+
Replace metadata from source. Headers attached to VField retain their protected data-shape fields.
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
def get(self, key: object, default: object | None = None) -> object: ...
|
|
159
|
+
|
|
160
|
+
def validate(self) -> None:
|
|
161
|
+
"""Validate this header or raise ValueError with the report"""
|
|
162
|
+
|
|
163
|
+
@property
|
|
164
|
+
def version(self) -> OVFVersion: ...
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def point_count(self) -> int | None: ...
|
|
168
|
+
|
|
169
|
+
@property
|
|
170
|
+
def point_dimension(self) -> int | None: ...
|
|
171
|
+
|
|
172
|
+
class VField:
|
|
173
|
+
@overload
|
|
174
|
+
def __init__(self) -> None: ...
|
|
175
|
+
|
|
176
|
+
@overload
|
|
177
|
+
def __init__(self, arg: OVFVersion, /) -> None: ...
|
|
178
|
+
|
|
179
|
+
@property
|
|
180
|
+
def header(self) -> SegmentHeader: ...
|
|
181
|
+
|
|
182
|
+
@property
|
|
183
|
+
def data(self) -> object:
|
|
184
|
+
"""
|
|
185
|
+
Writable zero-copy NumPy view. Assignment replaces C++-owned storage and invalidates older views.
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
@data.setter
|
|
189
|
+
def data(self, value: object | None) -> None: ...
|
|
190
|
+
|
|
191
|
+
@property
|
|
192
|
+
def complex_data(self) -> object:
|
|
193
|
+
"""
|
|
194
|
+
Writable zero-copy NumPy view pairing adjacent real and imaginary values. The final data dimension must be even.
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
@property
|
|
198
|
+
def scalar_count(self) -> int: ...
|
|
199
|
+
|
|
200
|
+
@property
|
|
201
|
+
def point_count(self) -> int: ...
|
|
202
|
+
|
|
203
|
+
@property
|
|
204
|
+
def point_dimension(self) -> int: ...
|
|
205
|
+
|
|
206
|
+
def meshgrid(self) -> tuple:
|
|
207
|
+
"""Return (x, y, z) cell-center grids shaped like data[..., 0]."""
|
|
208
|
+
|
|
209
|
+
@overload
|
|
210
|
+
def dummy_header(self, cell_size: Sequence[float], origin: Sequence[float] | None = None) -> None:
|
|
211
|
+
"""
|
|
212
|
+
Replace the header with defaults for rectangular data. cell_size is (x, y, z); origin defaults to cell_size / 2.
|
|
213
|
+
"""
|
|
214
|
+
|
|
215
|
+
@overload
|
|
216
|
+
def dummy_header(self, cell_size: float, origin: Sequence[float] | None = None) -> None:
|
|
217
|
+
"""Replace the header with defaults for an isotropic rectangular grid."""
|
|
218
|
+
|
|
219
|
+
def deduce(self, max_iterations: int = 5) -> str:
|
|
220
|
+
"""Deduce missing header fields in place and return the deduction report"""
|
|
221
|
+
|
|
222
|
+
def validate(self) -> None:
|
|
223
|
+
"""Validate header and data or raise ValueError with the report"""
|
ovftoolkit/arrays.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""NumPy array views used by OVFToolkit."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
from numpy.typing import NDArray
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def complex_view(data: NDArray) -> NDArray:
|
|
10
|
+
"""View adjacent real/imaginary values as complex numbers without copying."""
|
|
11
|
+
if not isinstance(data, np.ndarray):
|
|
12
|
+
raise TypeError("complex_view requires a NumPy array")
|
|
13
|
+
if data.ndim == 0 or data.shape[-1] % 2:
|
|
14
|
+
raise ValueError("Complex data requires an even final dimension")
|
|
15
|
+
|
|
16
|
+
if data.dtype == np.float32:
|
|
17
|
+
complex_dtype = np.complex64
|
|
18
|
+
elif data.dtype == np.float64:
|
|
19
|
+
complex_dtype = np.complex128
|
|
20
|
+
else:
|
|
21
|
+
raise TypeError("complex_view requires float32 or float64 data")
|
|
22
|
+
|
|
23
|
+
if data.strides[-1] != data.dtype.itemsize:
|
|
24
|
+
raise ValueError("Complex data pairs must be contiguous in the final dimension")
|
|
25
|
+
return data.view(complex_dtype)
|
ovftoolkit/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
ovftoolkit/spectrum.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"""Helpers for reducing OVF frequency spectra."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from os import PathLike
|
|
7
|
+
from typing import Pattern
|
|
8
|
+
|
|
9
|
+
import numpy as np
|
|
10
|
+
from numpy.typing import ArrayLike
|
|
11
|
+
|
|
12
|
+
from ._native import reader
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
DEFAULT_FREQUENCY_REGEX = r"f\s*=\s*([^\s]+)\s*Hz"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def eval_macroparams(
|
|
19
|
+
file_name: str | PathLike[str],
|
|
20
|
+
mask: ArrayLike | None = None,
|
|
21
|
+
frequency_regex: str | Pattern[str] = DEFAULT_FREQUENCY_REGEX,
|
|
22
|
+
) -> np.recarray:
|
|
23
|
+
"""Return spatially averaged complex components for each spectrum segment.
|
|
24
|
+
|
|
25
|
+
Adjacent values in the final data dimension are interpreted as the real
|
|
26
|
+
and imaginary parts of one component. ``mask`` supplies non-negative
|
|
27
|
+
spatial weights and may include a trailing singleton value dimension.
|
|
28
|
+
A three-component spectrum is named ``mx``, ``my``, and ``mz``; other
|
|
29
|
+
component counts use ``m0`` ... ``mN``. The remaining fields are ``f`` and
|
|
30
|
+
``rms``.
|
|
31
|
+
"""
|
|
32
|
+
pattern = re.compile(frequency_regex)
|
|
33
|
+
|
|
34
|
+
with reader(file_name) as spectrum:
|
|
35
|
+
if not len(spectrum):
|
|
36
|
+
raise ValueError("The spectrum contains no segments")
|
|
37
|
+
|
|
38
|
+
first = spectrum[0]
|
|
39
|
+
spatial_shape = first.data.shape[:-1]
|
|
40
|
+
value_dim = first.data.shape[-1]
|
|
41
|
+
if value_dim % 2:
|
|
42
|
+
raise ValueError("Complex spectrum value dimension must be even")
|
|
43
|
+
component_count = value_dim // 2
|
|
44
|
+
component_names = (
|
|
45
|
+
("mx", "my", "mz")
|
|
46
|
+
if component_count == 3
|
|
47
|
+
else tuple(f"m{i}" for i in range(component_count))
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
dtype = (
|
|
51
|
+
[("f", np.float64)]
|
|
52
|
+
+ [(name, np.complex128) for name in component_names]
|
|
53
|
+
+ [("rms", np.float64)]
|
|
54
|
+
)
|
|
55
|
+
result = np.empty(len(spectrum), dtype=dtype).view(np.recarray)
|
|
56
|
+
|
|
57
|
+
weights = None if mask is None else np.asarray(mask)
|
|
58
|
+
if weights is not None:
|
|
59
|
+
if weights.shape == spatial_shape + (1,):
|
|
60
|
+
weights = weights[..., 0]
|
|
61
|
+
try:
|
|
62
|
+
weights = np.broadcast_to(weights, spatial_shape).reshape(-1)
|
|
63
|
+
except ValueError as error:
|
|
64
|
+
raise ValueError(
|
|
65
|
+
f"Mask shape {np.shape(mask)} cannot be broadcast to "
|
|
66
|
+
f"spectrum shape {spatial_shape}"
|
|
67
|
+
) from error
|
|
68
|
+
if not np.all(np.isfinite(weights)) or np.any(weights < 0):
|
|
69
|
+
raise ValueError("Mask weights must be finite and non-negative")
|
|
70
|
+
if weights.sum() == 0:
|
|
71
|
+
raise ValueError("Mask must contain at least one positive weight")
|
|
72
|
+
|
|
73
|
+
for row, field in enumerate(spectrum):
|
|
74
|
+
data = field.data
|
|
75
|
+
if data.shape != spatial_shape + (value_dim,):
|
|
76
|
+
raise ValueError("All spectrum segments must have the same shape")
|
|
77
|
+
|
|
78
|
+
frequency = pattern.search(field.header.get("desc", ""))
|
|
79
|
+
if frequency is None:
|
|
80
|
+
raise ValueError(f"Frequency was not found in spectrum segment {row}")
|
|
81
|
+
|
|
82
|
+
values = field.complex_data.reshape(-1, component_count)
|
|
83
|
+
power = np.sum(np.abs(values) ** 2, axis=1)
|
|
84
|
+
|
|
85
|
+
result.f[row] = float(frequency.group(1))
|
|
86
|
+
means = (
|
|
87
|
+
values.mean(axis=0)
|
|
88
|
+
if weights is None
|
|
89
|
+
else np.average(values, axis=0, weights=weights)
|
|
90
|
+
)
|
|
91
|
+
for name, mean in zip(component_names, means):
|
|
92
|
+
result[name][row] = mean
|
|
93
|
+
result.rms[row] = np.sqrt(
|
|
94
|
+
power.mean() if weights is None else np.average(power, weights=weights)
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
return result
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ovftoolkit
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Fast, lazy NumPy access to OOMMF vector-field files
|
|
5
|
+
Keywords: OOMMF,OVF,micromagnetics,NumPy,vector field
|
|
6
|
+
Author: Artem Bondarenko
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
License-File: LICENSES/mdspan.txt
|
|
10
|
+
License-File: LICENSES/nanobind.txt
|
|
11
|
+
License-File: LICENSING.md
|
|
12
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: C++
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Project-URL: Documentation, https://artemkth.github.io/OVFToolkit/
|
|
23
|
+
Project-URL: Issues, https://github.com/Artemkth/OVFToolkit/issues
|
|
24
|
+
Project-URL: Repository, https://github.com/Artemkth/OVFToolkit
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: numpy>=1.23
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# OVFToolkit
|
|
30
|
+
|
|
31
|
+
OVFToolkit reads, writes, validates, converts, and processes OOMMF vector-field
|
|
32
|
+
(OVF) files. Most users will want one of two things:
|
|
33
|
+
|
|
34
|
+
1. the `ovftoolkit` Python package for NumPy-based analysis; or
|
|
35
|
+
2. the `ovf-convert` and `ovf-batchfft` command-line tools.
|
|
36
|
+
|
|
37
|
+
The C++23 parser underneath them reads OVF 1.0 and 2.0 files, rectangular and
|
|
38
|
+
irregular meshes, text and binary data, and multi-segment files. Segments are
|
|
39
|
+
loaded lazily, so memory use follows the data currently being processed rather
|
|
40
|
+
than the total file size.
|
|
41
|
+
|
|
42
|
+
## Python package
|
|
43
|
+
|
|
44
|
+
### Install
|
|
45
|
+
|
|
46
|
+
Once the package is published on PyPI, installation is one command:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
python -m pip install ovftoolkit
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Until then, download a wheel from the project releases, or install from a source
|
|
53
|
+
checkout:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
git clone --recurse-submodules https://github.com/Artemkth/OVFToolkit.git
|
|
57
|
+
cd OVFToolkit
|
|
58
|
+
python -m pip install .
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Binary wheels require only Python 3.10 or newer and NumPy. A source build also
|
|
62
|
+
needs a C++23 compiler, Boost headers, and Python development headers. Install
|
|
63
|
+
those prerequisites with one of:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
# Debian, Ubuntu, and derivatives
|
|
67
|
+
sudo apt update
|
|
68
|
+
sudo apt install build-essential libboost-dev python3-dev python3-venv
|
|
69
|
+
|
|
70
|
+
# Arch Linux and derivatives
|
|
71
|
+
sudo pacman -S --needed base-devel boost python
|
|
72
|
+
|
|
73
|
+
# Fedora
|
|
74
|
+
sudo dnf install gcc-c++ boost-devel python3-devel
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The Python build frontend supplies nanobind and a sufficiently recent CMake in
|
|
78
|
+
an isolated build environment.
|
|
79
|
+
|
|
80
|
+
### Use
|
|
81
|
+
|
|
82
|
+
Fields expose writable NumPy arrays. Files and their segments are lazy and can
|
|
83
|
+
be iterated without loading the complete dataset:
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
import ovftoolkit as ovf
|
|
87
|
+
|
|
88
|
+
with ovf.reader("input.ovf") as source:
|
|
89
|
+
for field in source:
|
|
90
|
+
analyse(field.data)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Create a file by assigning a rectangular rank-4 or irregular rank-2 array.
|
|
94
|
+
`dummy_header` fills the required rectangular-grid metadata from the array
|
|
95
|
+
shape and cell size:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
field = ovf.VField()
|
|
99
|
+
field.data = array
|
|
100
|
+
field.dummy_header((dx, dy, dz))
|
|
101
|
+
field.header[ovf.OVFParameter.Title] = "Example"
|
|
102
|
+
|
|
103
|
+
with ovf.writer("output.ovf") as destination:
|
|
104
|
+
destination.write(field)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
For rectangular fields with coordinate metadata, `meshgrid()` returns
|
|
108
|
+
cell-center coordinate arrays aligned with the field data:
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
x, y, z = field.meshgrid()
|
|
112
|
+
assert x.shape == y.shape == z.shape == field.data.shape[:-1]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Copy metadata between fields without overwriting the destination data shape:
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
destination.header.copy_from(source.header)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Working programs live in [`examples/`](examples/). In particular,
|
|
122
|
+
[`create_ovf.py`](examples/create_ovf.py) creates a normalized in-plane vortex
|
|
123
|
+
and [`plot_ovf.py`](examples/plot_ovf.py) renders an OVF layer with NumPy and
|
|
124
|
+
Matplotlib. More examples will be linked here as they are added.
|
|
125
|
+
|
|
126
|
+

|
|
127
|
+
|
|
128
|
+
For local notebook work:
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
python -m pip install jupyterlab matplotlib
|
|
132
|
+
jupyter lab
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Command-line tools
|
|
136
|
+
|
|
137
|
+
| Tool | Purpose | Additional dependencies |
|
|
138
|
+
| --- | --- | --- |
|
|
139
|
+
| `ovf-convert` | Convert OVF to VTK XML or HDF5 | VTK and HDF5 |
|
|
140
|
+
| `ovf-batchfft` | Batch spectral analysis | FFTW and/or NVIDIA CUDA with cuFFT |
|
|
141
|
+
|
|
142
|
+
Detailed usage is documented in the
|
|
143
|
+
[`ovf-convert`](tools/ovf-convert/README.md) and
|
|
144
|
+
[`ovf-batchfft`](tools/batchfft/README.md) manuals.
|
|
145
|
+
|
|
146
|
+
When packaged builds are available, they are attached to the
|
|
147
|
+
[GitHub releases](https://github.com/Artemkth/OVFToolkit/releases). Unpack the
|
|
148
|
+
Windows archive and run the executables from its `bin` directory; the portable
|
|
149
|
+
archive carries the runtime DLLs it needs. CUDA archives additionally require a
|
|
150
|
+
compatible NVIDIA GPU and driver.
|
|
151
|
+
|
|
152
|
+
### Linux dependencies
|
|
153
|
+
|
|
154
|
+
For a complete CPU build containing both tools:
|
|
155
|
+
|
|
156
|
+
```sh
|
|
157
|
+
# Debian, Ubuntu, and derivatives
|
|
158
|
+
sudo apt update
|
|
159
|
+
sudo apt install build-essential cmake ninja-build \
|
|
160
|
+
libboost-program-options-dev libfftw3-dev libhdf5-dev libtbb-dev libvtk9-dev
|
|
161
|
+
|
|
162
|
+
# Arch Linux and derivatives
|
|
163
|
+
sudo pacman -S --needed base-devel cmake ninja boost boost-libs fftw hdf5 \
|
|
164
|
+
onetbb vtk netcdf
|
|
165
|
+
|
|
166
|
+
# Fedora
|
|
167
|
+
sudo dnf install gcc-c++ cmake ninja-build boost-devel fftw-devel hdf5-devel \
|
|
168
|
+
tbb-devel vtk-devel netcdf-devel
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
OVFToolkit requires CMake 3.30 or newer. Some long-term-support distributions
|
|
172
|
+
ship an older CMake; in that case use a newer CMake package or a temporary
|
|
173
|
+
Python environment:
|
|
174
|
+
|
|
175
|
+
```sh
|
|
176
|
+
python3 -m venv .venv-build
|
|
177
|
+
. .venv-build/bin/activate
|
|
178
|
+
python -m pip install "cmake>=3.30"
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Build and install
|
|
182
|
+
|
|
183
|
+
With the dependencies installed, the complete build is deliberately short:
|
|
184
|
+
|
|
185
|
+
```sh
|
|
186
|
+
git submodule update --init --recursive
|
|
187
|
+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
|
188
|
+
-DOVFTOOLKIT_BUILD_TOOLS=ON -DOVFTOOLKIT_USE_CUFFT=OFF
|
|
189
|
+
cmake --build build
|
|
190
|
+
cmake --install build --prefix "$HOME/.local"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The tools are installed under `$HOME/.local/bin`. Add that directory to
|
|
194
|
+
`PATH` if it is not already present. To run the test suite before installing:
|
|
195
|
+
|
|
196
|
+
```sh
|
|
197
|
+
ctest --test-dir build --output-on-failure
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Windows with vcpkg
|
|
201
|
+
|
|
202
|
+
Install Visual Studio 2022 with the C++ workload, CMake 3.30 or newer, Git, and
|
|
203
|
+
vcpkg. Set `VCPKG_ROOT` to your vcpkg directory. Forward slashes are used below
|
|
204
|
+
so paths such as `C:\Users\...` are never interpreted by CMake as escape
|
|
205
|
+
sequences.
|
|
206
|
+
|
|
207
|
+
> **VTK warning:** the default Windows build includes `ovf-convert`, so vcpkg
|
|
208
|
+
> builds VTK and its large dependency tree. A clean build can take a long time
|
|
209
|
+
> and many gigabytes. If you only need `ovf-batchfft`, use one of the no-VTK
|
|
210
|
+
> configurations below.
|
|
211
|
+
|
|
212
|
+
Build both CPU tools, including VTK/HDF5 conversion and FFTW analysis:
|
|
213
|
+
|
|
214
|
+
```powershell
|
|
215
|
+
$toolchain = "$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake".Replace('\', '/')
|
|
216
|
+
cmake -S . -B build -A x64 `
|
|
217
|
+
"-DCMAKE_TOOLCHAIN_FILE=$toolchain" `
|
|
218
|
+
-DOVFTOOLKIT_BUILD_TOOLS=ON `
|
|
219
|
+
-DOVFTOOLKIT_USE_CUFFT=OFF
|
|
220
|
+
cmake --build build --config Release --parallel
|
|
221
|
+
cmake --install build --config Release --prefix build/stage
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Build only the FFTW-based `ovf-batchfft`, without downloading or building VTK:
|
|
225
|
+
|
|
226
|
+
```powershell
|
|
227
|
+
$toolchain = "$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake".Replace('\', '/')
|
|
228
|
+
cmake -S . -B build-fftw -A x64 `
|
|
229
|
+
"-DCMAKE_TOOLCHAIN_FILE=$toolchain" `
|
|
230
|
+
-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON `
|
|
231
|
+
-DVCPKG_MANIFEST_FEATURES=fftw `
|
|
232
|
+
-DOVFTOOLKIT_BUILD_TOOLS=ON `
|
|
233
|
+
-DOVFTOOLKIT_USE_FFTW=ON `
|
|
234
|
+
-DOVFTOOLKIT_USE_CUFFT=OFF
|
|
235
|
+
cmake --build build-fftw --config Release --parallel
|
|
236
|
+
cmake --install build-fftw --config Release --prefix build-fftw/stage
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Or build only the CUDA/cuFFT version without VTK or FFTW:
|
|
240
|
+
|
|
241
|
+
```powershell
|
|
242
|
+
$toolchain = "$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake".Replace('\', '/')
|
|
243
|
+
cmake -S . -B build-cuda -A x64 -T cuda=12.9 `
|
|
244
|
+
"-DCMAKE_TOOLCHAIN_FILE=$toolchain" `
|
|
245
|
+
-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON `
|
|
246
|
+
-DOVFTOOLKIT_BUILD_TOOLS=ON `
|
|
247
|
+
-DOVFTOOLKIT_USE_FFTW=OFF `
|
|
248
|
+
-DOVFTOOLKIT_USE_CUFFT=ON
|
|
249
|
+
cmake --build build-cuda --config Release --parallel
|
|
250
|
+
cmake --install build-cuda --config Release --prefix build-cuda/stage
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The staged executables and any required dynamic-library dependencies are placed
|
|
254
|
+
together in the stage `bin` directory. Change `cuda=12.9` to the installed CUDA
|
|
255
|
+
toolset version.
|
|
256
|
+
|
|
257
|
+
The vcpkg manifest has two default features:
|
|
258
|
+
|
|
259
|
+
- `convert` supplies the VTK/HDF5 stack for `ovf-convert`;
|
|
260
|
+
- `fftw` supplies the CPU backend for `ovf-batchfft`.
|
|
261
|
+
|
|
262
|
+
`VCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON` is therefore the switch that avoids the
|
|
263
|
+
large conversion stack. Enabling `fftw` explicitly adds FFTW back without
|
|
264
|
+
adding VTK.
|
|
265
|
+
|
|
266
|
+
## Build selection
|
|
267
|
+
|
|
268
|
+
Optional project components use the same three-state convention:
|
|
269
|
+
|
|
270
|
+
| CMake setting | Meaning |
|
|
271
|
+
| --- | --- |
|
|
272
|
+
| `AUTO` | Build the component when its dependencies are usable. |
|
|
273
|
+
| `ON` | Require the component and stop configuration if required dependencies are missing. |
|
|
274
|
+
| `OFF` | Do not probe or build the component. |
|
|
275
|
+
|
|
276
|
+
The main settings are `OVFTOOLKIT_BUILD_TOOLS`,
|
|
277
|
+
`OVFTOOLKIT_BUILD_PYTHON_BINDING`, `OVFTOOLKIT_BUILD_WOLFRAM_BINDING`,
|
|
278
|
+
`OVFTOOLKIT_BUILD_MUMAX_RUNNER`, and `OVFTOOLKIT_BUILD_DOCS`. FFT backends are
|
|
279
|
+
selected independently with `OVFTOOLKIT_USE_FFTW` and
|
|
280
|
+
`OVFTOOLKIT_USE_CUFFT`.
|
|
281
|
+
|
|
282
|
+
The separately licensed mumax controller is packaged from
|
|
283
|
+
`tools/mumax-runner` as `ovftoolkit-mumax-runner`; it does not bundle CUDA,
|
|
284
|
+
mumax3, or `mumax-slave`.
|
|
285
|
+
|
|
286
|
+
## C++ library and developer documentation
|
|
287
|
+
|
|
288
|
+
The `ovfparser` C++23 library is always built. Its public interface uses
|
|
289
|
+
`std::span`, `std::mdspan`, `std::expected`, concepts, and RAII ownership. A
|
|
290
|
+
bundled Kokkos mdspan implementation is used when the standard library does not
|
|
291
|
+
yet provide a sufficiently recent `std::mdspan`.
|
|
292
|
+
|
|
293
|
+
When Doxygen is available, build the API documentation with:
|
|
294
|
+
|
|
295
|
+
```sh
|
|
296
|
+
cmake --build build --target ovftoolkit-docs
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## License
|
|
300
|
+
|
|
301
|
+
Most original OVFToolkit source is distributed under the
|
|
302
|
+
[MIT License](LICENSE). The exception is `tools/mumax-runner/`, which is a
|
|
303
|
+
separate GPL-3.0-or-later distribution because its Go executable incorporates
|
|
304
|
+
mumax3. Third-party source and libraries retain their own licenses.
|
|
305
|
+
|
|
306
|
+
The license requirements of a binary depend on the components linked into it:
|
|
307
|
+
|
|
308
|
+
| Artifact | Distribution terms |
|
|
309
|
+
| --- | --- |
|
|
310
|
+
| `ovfparser` and the Python `ovftoolkit` wheel | MIT, with the notices for included dependencies. |
|
|
311
|
+
| `ovf-convert` | OVFToolkit code remains MIT; include the VTK, HDF5, NetCDF, and transitive dependency notices from the actual build. |
|
|
312
|
+
| CUDA-only `ovf-batchfft` | OVFToolkit code remains MIT; NVIDIA's terms also apply to any CUDA redistributables. |
|
|
313
|
+
| FFTW-linked `ovf-batchfft` | When FFTW is used under its GPL terms, distribute the executable under GPL-3.0-or-later and provide its complete corresponding source. Static and dynamic linking have the same licensing consequence. |
|
|
314
|
+
| FFTW-and-cuFFT `ovf-batchfft` | Not published by this project. OVFToolkit has no FFTW copyright-holder CUDA exception; obtain legal review or a commercial FFTW license before distributing such a binary. |
|
|
315
|
+
| `mumax-slave` and the mumax runner | GPL-3.0-or-later with mumax3's GPLv3 section 7 CUDA permission; provide the exact corresponding runner and mumax3 source. |
|
|
316
|
+
| `math-ovftoolkit` | OVFToolkit source remains MIT, but check the applicable Wolfram agreement before redistributing a WSTP-linked binary. |
|
|
317
|
+
|
|
318
|
+
See [LICENSING.md](LICENSING.md) for the release checklist and precise scope,
|
|
319
|
+
and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for the dependency
|
|
320
|
+
inventory. Packaged artifacts must carry the verbatim notices for the exact
|
|
321
|
+
direct and transitive libraries they contain; for vcpkg builds these are under
|
|
322
|
+
`vcpkg_installed/<triplet>/share/<port>/copyright`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ovftoolkit/__init__.py,sha256=ODvAxLnxa7EOvehYBYpy1VmmYg9B4x6rsDIHzCASBWc,212
|
|
2
|
+
ovftoolkit/__init__.pyi,sha256=7hO7GWxyy-kVBLfE3bnc1AiaobVugnArIQs2pB4DeEQ,190
|
|
3
|
+
ovftoolkit/_native.pyd,sha256=MS7tlY0EkFJBpM0M3UGKhI3DOIs0ZdmYAfxmF2FWtz4,576000
|
|
4
|
+
ovftoolkit/_native.pyi,sha256=R5ta6X7c_J5loIG0CNRViAD32gpNOGQfH9ZRbde2Mbc,5102
|
|
5
|
+
ovftoolkit/arrays.py,sha256=PM2q0ZETlEUeD8I8q3bUhiGRVcGnaBEkwZllnXrRTf0,910
|
|
6
|
+
ovftoolkit/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
7
|
+
ovftoolkit/spectrum.py,sha256=rmtP8zpq0OkXkuwDtQ_JoAXMom9uOpP1ZIkNUxHRYE8,3695
|
|
8
|
+
ovftoolkit-0.3.0.dist-info/METADATA,sha256=5Z8KeHBa9lSLA_FZaibEzVhB5N-XxQcEsJImHLz3LvE,11681
|
|
9
|
+
ovftoolkit-0.3.0.dist-info/WHEEL,sha256=Y1h6DI9fUdCH2EQ9zbxX8rDpVTvE5dLV5-Npqf3yG0U,104
|
|
10
|
+
ovftoolkit-0.3.0.dist-info/licenses/LICENSE,sha256=k_DWSza872xLHBjmaAYt4_X2-B61pOTVaB6WCVgPT_c,1099
|
|
11
|
+
ovftoolkit-0.3.0.dist-info/licenses/LICENSING.md,sha256=3v_dnOwl4rD2DLycM7zrJYJVvTOCFPxJEdfl1HCY-z8,3592
|
|
12
|
+
ovftoolkit-0.3.0.dist-info/licenses/THIRD_PARTY_NOTICES.md,sha256=q3AGvjfeXg7rROK1RpC0zaXQU0buA71F0AJ9vG5VmV4,2375
|
|
13
|
+
ovftoolkit-0.3.0.dist-info/licenses/LICENSES/mdspan.txt,sha256=77_fM2KBpynpE_A_O_0748cCaH1seUHBz41JdfSXrUs,13463
|
|
14
|
+
ovftoolkit-0.3.0.dist-info/licenses/LICENSES/nanobind.txt,sha256=M_Tnf5JnQLMEw20eXnqa0_aOXJQkl-L0Co9H2NHRp4A,1547
|
|
15
|
+
ovftoolkit-0.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2026 Artem Bondarenko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
************************************************************************
|
|
2
|
+
|
|
3
|
+
Kokkos v. 4.0
|
|
4
|
+
Copyright (2022) National Technology & Engineering
|
|
5
|
+
Solutions of Sandia, LLC (NTESS).
|
|
6
|
+
|
|
7
|
+
Under the terms of Contract DE-NA0003525 with NTESS,
|
|
8
|
+
the U.S. Government retains certain rights in this software.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
==============================================================================
|
|
12
|
+
Kokkos is under the Apache License v2.0 with LLVM Exceptions:
|
|
13
|
+
==============================================================================
|
|
14
|
+
|
|
15
|
+
Apache License
|
|
16
|
+
Version 2.0, January 2004
|
|
17
|
+
http://www.apache.org/licenses/
|
|
18
|
+
|
|
19
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
20
|
+
|
|
21
|
+
1. Definitions.
|
|
22
|
+
|
|
23
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
24
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
25
|
+
|
|
26
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
27
|
+
the copyright owner that is granting the License.
|
|
28
|
+
|
|
29
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
30
|
+
other entities that control, are controlled by, or are under common
|
|
31
|
+
control with that entity. For the purposes of this definition,
|
|
32
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
33
|
+
direction or management of such entity, whether by contract or
|
|
34
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
35
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
36
|
+
|
|
37
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
38
|
+
exercising permissions granted by this License.
|
|
39
|
+
|
|
40
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
41
|
+
including but not limited to software source code, documentation
|
|
42
|
+
source, and configuration files.
|
|
43
|
+
|
|
44
|
+
"Object" form shall mean any form resulting from mechanical
|
|
45
|
+
transformation or translation of a Source form, including but
|
|
46
|
+
not limited to compiled object code, generated documentation,
|
|
47
|
+
and conversions to other media types.
|
|
48
|
+
|
|
49
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
50
|
+
Object form, made available under the License, as indicated by a
|
|
51
|
+
copyright notice that is included in or attached to the work
|
|
52
|
+
(an example is provided in the Appendix below).
|
|
53
|
+
|
|
54
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
55
|
+
form, that is based on (or derived from) the Work and for which the
|
|
56
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
57
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
58
|
+
of this License, Derivative Works shall not include works that remain
|
|
59
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
60
|
+
the Work and Derivative Works thereof.
|
|
61
|
+
|
|
62
|
+
"Contribution" shall mean any work of authorship, including
|
|
63
|
+
the original version of the Work and any modifications or additions
|
|
64
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
65
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
66
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
67
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
68
|
+
means any form of electronic, verbal, or written communication sent
|
|
69
|
+
to the Licensor or its representatives, including but not limited to
|
|
70
|
+
communication on electronic mailing lists, source code control systems,
|
|
71
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
72
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
73
|
+
excluding communication that is conspicuously marked or otherwise
|
|
74
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
75
|
+
|
|
76
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
77
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
78
|
+
subsequently incorporated within the Work.
|
|
79
|
+
|
|
80
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
81
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
82
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
83
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
84
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
85
|
+
Work and such Derivative Works in Source or Object form.
|
|
86
|
+
|
|
87
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
88
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
89
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
90
|
+
(except as stated in this section) patent license to make, have made,
|
|
91
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
92
|
+
where such license applies only to those patent claims licensable
|
|
93
|
+
by such Contributor that are necessarily infringed by their
|
|
94
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
95
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
96
|
+
institute patent litigation against any entity (including a
|
|
97
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
98
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
99
|
+
or contributory patent infringement, then any patent licenses
|
|
100
|
+
granted to You under this License for that Work shall terminate
|
|
101
|
+
as of the date such litigation is filed.
|
|
102
|
+
|
|
103
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
104
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
105
|
+
modifications, and in Source or Object form, provided that You
|
|
106
|
+
meet the following conditions:
|
|
107
|
+
|
|
108
|
+
(a) You must give any other recipients of the Work or
|
|
109
|
+
Derivative Works a copy of this License; and
|
|
110
|
+
|
|
111
|
+
(b) You must cause any modified files to carry prominent notices
|
|
112
|
+
stating that You changed the files; and
|
|
113
|
+
|
|
114
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
115
|
+
that You distribute, all copyright, patent, trademark, and
|
|
116
|
+
attribution notices from the Source form of the Work,
|
|
117
|
+
excluding those notices that do not pertain to any part of
|
|
118
|
+
the Derivative Works; and
|
|
119
|
+
|
|
120
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
121
|
+
distribution, then any Derivative Works that You distribute must
|
|
122
|
+
include a readable copy of the attribution notices contained
|
|
123
|
+
within such NOTICE file, excluding those notices that do not
|
|
124
|
+
pertain to any part of the Derivative Works, in at least one
|
|
125
|
+
of the following places: within a NOTICE text file distributed
|
|
126
|
+
as part of the Derivative Works; within the Source form or
|
|
127
|
+
documentation, if provided along with the Derivative Works; or,
|
|
128
|
+
within a display generated by the Derivative Works, if and
|
|
129
|
+
wherever such third-party notices normally appear. The contents
|
|
130
|
+
of the NOTICE file are for informational purposes only and
|
|
131
|
+
do not modify the License. You may add Your own attribution
|
|
132
|
+
notices within Derivative Works that You distribute, alongside
|
|
133
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
134
|
+
that such additional attribution notices cannot be construed
|
|
135
|
+
as modifying the License.
|
|
136
|
+
|
|
137
|
+
You may add Your own copyright statement to Your modifications and
|
|
138
|
+
may provide additional or different license terms and conditions
|
|
139
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
140
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
141
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
142
|
+
the conditions stated in this License.
|
|
143
|
+
|
|
144
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
145
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
146
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
147
|
+
this License, without any additional terms or conditions.
|
|
148
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
149
|
+
the terms of any separate license agreement you may have executed
|
|
150
|
+
with Licensor regarding such Contributions.
|
|
151
|
+
|
|
152
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
153
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
154
|
+
except as required for reasonable and customary use in describing the
|
|
155
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
156
|
+
|
|
157
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
158
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
159
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
160
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
161
|
+
implied, including, without limitation, any warranties or conditions
|
|
162
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
163
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
164
|
+
appropriateness of using or redistributing the Work and assume any
|
|
165
|
+
risks associated with Your exercise of permissions under this License.
|
|
166
|
+
|
|
167
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
168
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
169
|
+
unless required by applicable law (such as deliberate and grossly
|
|
170
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
171
|
+
liable to You for damages, including any direct, indirect, special,
|
|
172
|
+
incidental, or consequential damages of any character arising as a
|
|
173
|
+
result of this License or out of the use or inability to use the
|
|
174
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
175
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
176
|
+
other commercial damages or losses), even if such Contributor
|
|
177
|
+
has been advised of the possibility of such damages.
|
|
178
|
+
|
|
179
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
180
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
181
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
182
|
+
or other liability obligations and/or rights consistent with this
|
|
183
|
+
License. However, in accepting such obligations, You may act only
|
|
184
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
185
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
186
|
+
defend, and hold each Contributor harmless for any liability
|
|
187
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
188
|
+
of your accepting any such warranty or additional liability.
|
|
189
|
+
|
|
190
|
+
END OF TERMS AND CONDITIONS Apache 2.0
|
|
191
|
+
|
|
192
|
+
---- LLVM Exceptions to the Apache 2.0 License ----
|
|
193
|
+
|
|
194
|
+
As an exception, if, as a result of your compiling your source code, portions
|
|
195
|
+
of this Software are embedded into an Object form of such source code, you
|
|
196
|
+
may redistribute such embedded portions in such Object form without complying
|
|
197
|
+
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
|
|
198
|
+
|
|
199
|
+
In addition, if you combine or link compiled forms of this Software with
|
|
200
|
+
software that is licensed under the GPLv2 ("Combined Software") and if a
|
|
201
|
+
court of competent jurisdiction determines that the patent provision (Section
|
|
202
|
+
3), the indemnity provision (Section 9) or other Section of the License
|
|
203
|
+
conflicts with the conditions of the GPLv2, you may retroactively and
|
|
204
|
+
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
|
205
|
+
the License, but only in their entirety and only with respect to the Combined
|
|
206
|
+
Software.
|
|
207
|
+
|
|
208
|
+
==============================================================================
|
|
209
|
+
Software from third parties included in Kokkos:
|
|
210
|
+
==============================================================================
|
|
211
|
+
|
|
212
|
+
Kokkos contains third party software which is under different license
|
|
213
|
+
terms. All such code will be identified clearly using at least one of two
|
|
214
|
+
mechanisms:
|
|
215
|
+
1) It will be in a separate directory tree with its own `LICENSE.txt` or
|
|
216
|
+
`LICENSE` file at the top containing the specific license and restrictions
|
|
217
|
+
which apply to that software, or
|
|
218
|
+
2) It will contain specific license and restriction terms at the top of every
|
|
219
|
+
file.
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY
|
|
223
|
+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
224
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
225
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE
|
|
226
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
227
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
228
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
229
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
230
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
231
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
232
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
233
|
+
|
|
234
|
+
Questions? Contact:
|
|
235
|
+
Christian R. Trott (crtrott@sandia.gov) and
|
|
236
|
+
Damien T. Lebrun-Grandie (lebrungrandt@ornl.gov)
|
|
237
|
+
|
|
238
|
+
************************************************************************
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright (c) 2022 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
+
list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
and/or other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
14
|
+
may be used to endorse or promote products derived from this software
|
|
15
|
+
without specific prior written permission.
|
|
16
|
+
|
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Licensing guide
|
|
2
|
+
|
|
3
|
+
This file explains how the licenses in this repository apply to its source
|
|
4
|
+
and to binaries assembled with optional third-party components. It is a
|
|
5
|
+
practical release guide, not legal advice.
|
|
6
|
+
|
|
7
|
+
## Repository source
|
|
8
|
+
|
|
9
|
+
Unless a file or directory says otherwise, original OVFToolkit source is
|
|
10
|
+
licensed under the [MIT License](LICENSE).
|
|
11
|
+
|
|
12
|
+
`tools/mumax-runner/` is a deliberately separate distribution licensed under
|
|
13
|
+
GPL-3.0-or-later. Its complete license is in
|
|
14
|
+
[`tools/mumax-runner/LICENSE`](tools/mumax-runner/LICENSE), and its component
|
|
15
|
+
notice is in [`tools/mumax-runner/NOTICE`](tools/mumax-runner/NOTICE).
|
|
16
|
+
|
|
17
|
+
Git submodules, generated files, and third-party dependencies retain their own
|
|
18
|
+
copyrights and licenses. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)
|
|
19
|
+
and the license files supplied by those projects.
|
|
20
|
+
|
|
21
|
+
## Expected binary licensing
|
|
22
|
+
|
|
23
|
+
| Artifact | Project license and release requirement |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| `ovfparser` | MIT; include `LICENSE` and applicable dependency notices. |
|
|
26
|
+
| Python `ovftoolkit` wheel | MIT; include the nanobind notice and, when the fallback is bundled, the mdspan notice. |
|
|
27
|
+
| `ovf-convert` | OVFToolkit code remains MIT; include the notices for VTK, HDF5, NetCDF, and every library actually shipped with the artifact. |
|
|
28
|
+
| CUDA-only `ovf-batchfft` | OVFToolkit code remains MIT; comply with the CUDA Toolkit EULA for any NVIDIA redistributables and include all other dependency notices. |
|
|
29
|
+
| FFTW-linked `ovf-batchfft` | When using FFTW under its GPL terms, the executable must be distributed under GPL-3.0-or-later, with the complete corresponding source and notices. FFTW is GPL-2.0-or-later; GPLv3 is used for the combined executable because an Apache-2.0 dependency such as oneTBB may also be linked. A commercial FFTW license may provide different terms. |
|
|
30
|
+
| FFTW-and-cuFFT `ovf-batchfft` | Do not publish this combined binary as an OVFToolkit release. The project has no FFTW copyright-holder exception comparable to mumax3's CUDA exception. Obtain appropriate legal review or a commercial FFTW license before distributing it. |
|
|
31
|
+
| `mumax-slave` and mumax runner package | GPL-3.0-or-later, plus mumax3's GPLv3 section 7 CUDA permission. Publish the exact corresponding mumax3 and runner source used for the binary. |
|
|
32
|
+
| `math-ovftoolkit` | OVFToolkit source remains MIT. Do not publish the WSTP-linked binary until the applicable Wolfram agreement has been checked for redistribution rights. |
|
|
33
|
+
|
|
34
|
+
Static and dynamic linking do not remove the FFTW GPL obligations. A private
|
|
35
|
+
build that is not conveyed is different from publishing a binary.
|
|
36
|
+
|
|
37
|
+
## Release checklist
|
|
38
|
+
|
|
39
|
+
For every release artifact:
|
|
40
|
+
|
|
41
|
+
1. Record the dependency versions, vcpkg triplet, feature set, and exact Git
|
|
42
|
+
commits used to build it.
|
|
43
|
+
2. Include `LICENSE`, this guide, `THIRD_PARTY_NOTICES.md`, and the verbatim
|
|
44
|
+
copyright/license files for all libraries shipped or linked into it.
|
|
45
|
+
3. For vcpkg builds, collect the authoritative files from
|
|
46
|
+
`vcpkg_installed/<triplet>/share/<port>/copyright` and retain the generated
|
|
47
|
+
`vcpkg.spdx.json` files as the basis of an SBOM.
|
|
48
|
+
4. For a GPL binary, publish the complete corresponding source beside the
|
|
49
|
+
binary. A link to an upstream repository is not sufficient if it can move
|
|
50
|
+
or does not exactly match the build.
|
|
51
|
+
5. Keep FFTW-only and CUDA-only `ovf-batchfft` artifacts separate. Do not put
|
|
52
|
+
both backends in a public binary.
|
|
53
|
+
6. Review the resulting archive or wheel itself; configuring a compliant
|
|
54
|
+
build does not guarantee that its packaging step copied every notice.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
OVFToolkit can use the projects below. This inventory describes the direct
|
|
4
|
+
dependencies; an actual binary distribution must also include the verbatim
|
|
5
|
+
notices for the exact direct and transitive libraries it contains. The vcpkg
|
|
6
|
+
`share/<port>/copyright` files from the build are authoritative for a
|
|
7
|
+
vcpkg-produced artifact.
|
|
8
|
+
|
|
9
|
+
| Dependency | Used by | License / terms | Upstream |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| Boost | core headers and command-line tools | Boost Software License 1.0 | <https://www.boost.org/users/license.html> |
|
|
12
|
+
| nanobind | Python extension | BSD 3-Clause | <https://github.com/wjakob/nanobind> |
|
|
13
|
+
| Kokkos mdspan | fallback when `std::mdspan` is unavailable | Apache-2.0 WITH LLVM-exception | <https://github.com/kokkos/mdspan> |
|
|
14
|
+
| FFTW | CPU `ovf-batchfft` backend | GPL-2.0-or-later, or a commercial license | <https://www.fftw.org/> |
|
|
15
|
+
| oneTBB | parallel execution used by command-line tools | Apache-2.0 | <https://github.com/uxlfoundation/oneTBB> |
|
|
16
|
+
| VTK | `ovf-convert` | BSD 3-Clause; bundled VTK dependencies have additional notices | <https://vtk.org/> |
|
|
17
|
+
| HDF5 | `ovf-convert` | HDF5's BSD-style license | <https://www.hdfgroup.org/solutions/hdf5/> |
|
|
18
|
+
| NetCDF-C | VTK/NetCDF conversion support | BSD 3-Clause | <https://github.com/Unidata/netcdf-c> |
|
|
19
|
+
| NVIDIA CUDA Toolkit and cuFFT | CUDA batch FFT and mumax3 | NVIDIA CUDA Toolkit EULA and component-specific redistribution terms | <https://docs.nvidia.com/cuda/eula/index.html> |
|
|
20
|
+
| mumax3 | compiled into `mumax-slave` | GPL-3.0-or-later with a GPLv3 section 7 CUDA permission | <https://github.com/mumax/3> |
|
|
21
|
+
| FindMathematica and Wolfram WSTP | Wolfram binding build/runtime | FindMathematica's license and the applicable Wolfram agreement | <https://github.com/sakra/FindMathematica> |
|
|
22
|
+
| PyVista and VTK Python packages | optional imported-geometry example visualization | MIT and BSD 3-Clause, respectively | <https://pyvista.org/> |
|
|
23
|
+
| Origins of the Pig by Keenan Crane | CC0 mesh used by the pig geometry example | CC0 1.0 Universal Public Domain Dedication | <https://www.cs.cmu.edu/~kmcrane/Projects/ModelRepository/> |
|
|
24
|
+
|
|
25
|
+
The nanobind and mdspan license texts used by source distributions and wheels
|
|
26
|
+
are included under [`LICENSES/`](LICENSES/). Their inclusion records those
|
|
27
|
+
dependencies' terms; it does not change OVFToolkit's MIT license.
|