You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
opencl_fdtd/README.md

54 lines
1.6 KiB
Markdown

# opencl_fdtd
8 years ago
**opencl_fdtd** is a python application for running 3D time-domain
8 years ago
electromagnetic simulations on parallel compute hardware (mainly GPUs).
8 years ago
**Performance** highly depends on what hardware you have available:
* A 395x345x73 cell simulation (~10 million points, 8-cell absorbing boundaries)
7 years ago
runs at around 91 iterations/sec. on my AMD RX480.
* On an Nvidia GTX 580, it runs at 66 iterations/sec
* On my laptop (Nvidia 940M) the same simulation achieves ~12 iterations/sec.
8 years ago
* An L3 photonic crystal cavity ringdown simulation (1550nm source, 40nm
7 years ago
discretization, 8000 steps) takes about 3 minutes on my laptop.
8 years ago
**Capabilities** are currently pretty minimal:
* Absorbing boundaries (CPML)
7 years ago
* Perfect electrical conductors (PECs; to use set epsilon to inf)
* Anisotropic media (eps_xx, eps_yy, eps_zz, mu_xx, ...)
8 years ago
* Direct access to fields (eg., you can trivially add a soft or hard
7 years ago
current source with just sim.E[ind] += sin(f0 * t), or save any portion
8 years ago
of a field to a file)
7 years ago
8 years ago
## Installation
**Requirements:**
* python 3 (written and tested with 3.5)
* numpy
* pyopencl
7 years ago
* jinja2
* [fdfd_tools](https://mpxd.net/code/jan/fdfd_tools)
7 years ago
Optional (used for examples):
7 years ago
* dill (for file output)
* [gridlock](https://mpxd.net/code/jan/gridlock)
* [masque](https://mpxd.net/code/jan/masque)
8 years ago
8 years ago
To get the code, just clone this repository:
```bash
git clone https://mpxd.net/code/jan/opencl_fdtd.git
```
8 years ago
You can install the requirements and their dependencies easily with
```bash
8 years ago
pip install -r requirements.txt
```
## Running
The root directory contains ``fdtd.py``, which sets up and runs a sample simulation
(cavity ringdown).
```bash
python3 fdtd.py
```