ENGLISH-magnetic-field-simulator

🧲 Magnetic Field Simulator (FEM Based)

Click here for Korean!

Click Here to download!

🛠️ Language and Libraries used in this project

In order to implement High-performance GPU computations and interactive 3D visualization, I used libraries below.

Language Library Purpose Official Document url
Python CuPy GPU based Parallel computing CuPy
  NumPy Post-processing of GPU computation results Numpy
  Flask Constructing Local web server for Magnetic field data interactions Flask
JavaScript Three.js Real-time Magnetic field visualization via web browser Three.js

“Reveal the invisible world of Magnetic field!”
This project calculates and visualizes magnitude and direction of magnetic field in each point generated by user-given electric current, using Finite Element Method.

For research and education purpose, you can use this whatever you like. (Code modification is allowed, secondary distribution is not allowed.)

COMSOL is too expensive! I made this for moneyless students

You can run this in Google Colab WITHOUT any graphics card!


Introduction & Google Colab

Youtube video instructions are ready! Click image to watch. (English subtitle is ready)

🎥 Overall Instruction 💻 How to use this on Google Colab
Intro Colab
Introducing overall features Run this on web browser without GPU

Key Features


🛠 To run this in your computer, You need NVIDIA graphics card! If you don’t have one, run this in Google Colab

This project implements High-performance computations via NVIDIA GPU(CUDA)


🚀 Brief instructions for who has GPU(Congrats! you are rich!)

0. Download this porject

1. Execute run.bat file

2. Simulation settings

3. See results and terminate


🤝 Any Help is Welcome!

This project is a one-person project developed to provide students an academic tool to study magnetic fields for free.

Any feedback and assistance on these issues below is welcome!

  1. Magnetic field line visualization: Need to visualize smooth lines, instead of dirty/unintuitive arrows.
  2. .exe format packaging: PyInstaller crashes if I try to export this project into single .exe package.
  3. Better visualization: Reduce number of overlapping vectors. Or adjust individual opacity to see only important vectors.
  4. Make this into a server: construct GPU server that can be accessed via low-performance devices. (Partially resolved via Google Colab)
  5. Improve UI/UX: Children-friendly UI/UX. Or fix bug that window.close() does not work. (I think this is because of Chrome’s security policy)

📝 License

This project can be used freely for Education and Research purpose. You can use this without any permission for your class or personal studies!🎓

Code modification is always allowed. Secondary distribution is not allowed. If you want to share, send url of this page.


If you have any feedbacks or questions, ask me via github or email(lcp020620@kaist.ac.kr).