Skip to content

Commit

Permalink
Now supporting CUDA!
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Wilhelm committed Nov 17, 2020
1 parent 98d2ec7 commit 3139b17
Show file tree
Hide file tree
Showing 102 changed files with 849 additions and 225 deletions.
2 changes: 1 addition & 1 deletion MagnetiCalc.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[DEFAULT]
version = MagnetiCalc v1.8.3.2
version = MagnetiCalc v1.8.4
backend = 0
auto_calculation = True
num_cores = 0
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ whenever I needed to solve a magnetostatic problem.

The <img src="https://render.githubusercontent.com/render/math?math=\mathbf{B}" alt="B">-field calculation
is implemented using the Biot-Savart law [1], employing multiprocessing techniques;
MagnetiCalc uses just-in-time compilation (JIT/Numba) to achieve high-performance calculations.
MagnetiCalc uses just-in-time compilation ([JIT](https://numba.pydata.org/))
and, if available, GPU-acceleration ([CUDA](https://numba.pydata.org/numba-doc/dev/cuda/overview.html))
to achieve high-performance calculations.
Additionally, the use of easily constrainable "sampling volumes" allows for selective calculation over
grids of arbitrary shape and arbitrary relative permeabilities
<img src="https://render.githubusercontent.com/render/math?math=\mu_r(\mathbf{x})" alt="µ_r(x)"> (<i>experimental</i>).
Expand Down Expand Up @@ -146,6 +148,14 @@ python3 -m pip install .
python3 -m pip uninstall magneticalc -y
```

### Enabling CUDA Support

Tested in Ubuntu 20.04, using the NVIDIA CUDA 10.1 driver and NVIDIA GeForce GTX 1650 GPU.

Please refer to the
[Numba Installation Guide](https://numba.pydata.org/numba-doc/latest/user/installing.html)
which includes the steps necessary to get CUDA up and running.

License
-------
Copyright © 2020, Paul Wilhelm, M. Sc. <[[email protected]](mailto:[email protected])>
Expand All @@ -172,7 +182,6 @@ If this software has been helpful to you in some way or another, please let me a

ToDo
----
* Add CUDA backend for Biot-Savart implementation.
* Add installation instructions for Windows, ensure consistent PyQt5 look and feel.
* Add support for modeling of core material saturation and hysteresis effects.
* Add support for selective display over a portion of the metric range, in order to get a kind of iso-contour display.
Expand All @@ -182,7 +191,7 @@ Video
-----
A very short demo of MagnetiCalc in action:

[![Magnetic Field Calculation with Python (MagnetiCalc)](https://raw.githubusercontent.com/shredEngineer/MagnetiCalc/master/docs/Video-Thumb.png)](https://www.youtube.com/watch?v=B60dk3BZO0c)
[![Magnetic Field Calculation with Python (MagnetiCalc)](https://raw.githubusercontent.com/shredEngineer/MagnetiCalc/master/docs/Video-Thumb.png)](https://www.youtube.com/watch?v=d3QKdYfOuvQ)

Links
-----
Expand Down
Binary file modified docs/Video-Thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/classIndex.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h2>
<p>
This documentation was automatically generated by
<a href="https://github.com/twisted/pydoctor/">pydoctor</a>
at 2020-11-14 08:36:11.
at 2020-11-17 02:29:47.
</p>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/magneticalc.About_Dialog.About_Dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h1 class="class"><code>magneticalc.About_Dialog.About_Dialog(<span title="PyQt5

</div>
<address>
<a href="index.html">API Documentation</a> for <a href="https://github.com/shredEngineer/MagnetiCalc">MagnetiCalc</a>, generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a> at 2020-11-14 08:36:11.
<a href="index.html">API Documentation</a> for <a href="https://github.com/shredEngineer/MagnetiCalc">MagnetiCalc</a>, generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a> at 2020-11-17 02:29:47.
</address>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/magneticalc.About_Dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1 class="module"><code>magneticalc.About_Dialog</code> <small>module documenta

</div>
<address>
<a href="index.html">API Documentation</a> for <a href="https://github.com/shredEngineer/MagnetiCalc">MagnetiCalc</a>, generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a> at 2020-11-14 08:36:11.
<a href="index.html">API Documentation</a> for <a href="https://github.com/shredEngineer/MagnetiCalc">MagnetiCalc</a>, generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a> at 2020-11-17 02:29:47.
</address>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/magneticalc.Assert_Dialog.Assert_Dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ <h1 class="class"><code>magneticalc.Assert_Dialog.Assert_Dialog</code> <small>cl

</div>
<address>
<a href="index.html">API Documentation</a> for <a href="https://github.com/shredEngineer/MagnetiCalc">MagnetiCalc</a>, generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a> at 2020-11-14 08:36:11.
<a href="index.html">API Documentation</a> for <a href="https://github.com/shredEngineer/MagnetiCalc">MagnetiCalc</a>, generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a> at 2020-11-17 02:29:47.
</address>

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/magneticalc.Assert_Dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1 class="module"><code>magneticalc.Assert_Dialog</code> <small>module document

</div>
<address>
<a href="index.html">API Documentation</a> for <a href="https://github.com/shredEngineer/MagnetiCalc">MagnetiCalc</a>, generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a> at 2020-11-14 08:36:11.
<a href="index.html">API Documentation</a> for <a href="https://github.com/shredEngineer/MagnetiCalc">MagnetiCalc</a>, generated by <a href="https://github.com/twisted/pydoctor/">pydoctor</a> at 2020-11-17 02:29:47.
</address>

</div>
Expand Down
Loading

0 comments on commit 3139b17

Please sign in to comment.