OpenCL FDTD electromagnetic simulation in 3 dimensions
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
Go to file
Jan Petykiewicz d5fd78d493 Revert "Add restrict keyword to pointers (not sharing the same memory for multiple fields)"
This reverts commit 60b70bb332.

It appears to have minimal performance impact, and fails to compile on
nvidia cards.
il y a 5 ans
opencl_fdtd Revert "Add restrict keyword to pointers (not sharing the same memory for multiple fields)" il y a 5 ans
.gitignore expand gitignores il y a 5 ans
LICENSE.md Use markdown for license il y a 8 ans
README.md move code to new location il y a 6 ans
fdtd.py Update example with bloch fields il y a 5 ans
pcgen.py Fix triangular lattice code in pgcgen il y a 8 ans
requirements.txt move code to new location il y a 6 ans
setup.py Use readme as long_description il y a 6 ans

README.md

opencl_fdtd

opencl_fdtd is a python application for running 3D time-domain electromagnetic simulations on parallel compute hardware (mainly GPUs).

Performance highly depends on what hardware you have available:

  • A 395x345x73 cell simulation (~10 million points, 8-cell absorbing boundaries) 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.
  • An L3 photonic crystal cavity ringdown simulation (1550nm source, 40nm discretization, 8000 steps) takes about 3 minutes on my laptop.

Capabilities are currently pretty minimal:

  • Absorbing boundaries (CPML)
  • Perfect electrical conductors (PECs; to use set epsilon to inf)
  • Anisotropic media (eps_xx, eps_yy, eps_zz, mu_xx, ...)
  • Direct access to fields (eg., you can trivially add a soft or hard current source with just sim.E[ind] += sin(f0 * t), or save any portion of a field to a file)

Installation

Requirements:

  • python 3 (written and tested with 3.5)
  • numpy
  • pyopencl
  • jinja2
  • fdfd_tools

Optional (used for examples):

To get the code, just clone this repository:

git clone https://mpxd.net/code/jan/opencl_fdtd.git

You can install the requirements and their dependencies easily with

pip install -r requirements.txt

Running

The root directory contains fdtd.py, which sets up and runs a sample simulation (cavity ringdown).

python3 fdtd.py