You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
readme: fix broken link and add initialize instruction (#431)
Updates the example usage in the README to include initialization of
AMReX. This is not strictly required for the example, but avoids the
potential for users to follow the example for more complex usage that
causes segfaults when AMReX is not initialized (#327).
Also fixes a broken link.
@@ -24,21 +24,27 @@ pyAMReX [can be installed](https://pyamrex.readthedocs.io/en/latest/install/user
24
24
25
25
### Usage
26
26
27
-
Please see the [manual](https://pyamrex.readthedocs.io/en/latest/usage/how_to_run.html) and our [test cases](https://github.com/AMReX-Codes/pyamrex/tree/development/tests) for detailed examples.
27
+
Please see the [manual](https://pyamrex.readthedocs.io/en/latest/usage/examples.html) and our [test cases](https://github.com/AMReX-Codes/pyamrex/tree/development/tests) for detailed examples.
28
28
29
29
Use AMReX objects and APIs from Python:
30
30
```python
31
31
import amrex.space3d as amr
32
32
33
+
amr.initialize([])
34
+
33
35
small_end = amr.IntVect()
34
36
big_end = amr.IntVect(2, 3, 4)
35
37
36
38
b = amr.Box(small_end, big_end)
37
39
print(b)
38
40
39
41
# ...
42
+
43
+
amr.finalize()
40
44
```
41
45
46
+
Note that many AMReX functions may cause a segmentation fault if run without first initializing AMReX (`amr.initialize([])`).
47
+
42
48
## Developers
43
49
44
50
If you are new to CMake, [this short tutorial](https://hsf-training.github.io/hsf-training-cmake-webpage/) from the HEP Software foundation is the perfect place to get started with it.
@@ -241,6 +247,6 @@ If you have questions about your rights to use or distribute this software,
241
247
please contact Berkeley Lab's Intellectual Property Office at
0 commit comments