opencl_fdfd/opencl_fdfd/__init__.py

46 lines
1.7 KiB
Python
Raw Normal View History

2016-08-04 17:43:01 -07:00
"""
opencl_fdfd OpenCL 3D FDFD solver
2016-08-04 20:19:04 -07:00
opencl_fdfd is a 3D Finite Difference Frequency Domain (FDFD) electromagnetic
solver implemented in Python and OpenCL.
2016-08-04 17:43:01 -07:00
2016-08-04 20:19:04 -07:00
Its capabilities include:
2016-08-04 17:43:01 -07:00
- Arbitrary distributions of the following:
- Dielectric constant (epsilon)
- Magnetic permeabilty (mu)
- Perfect electric conductor (PEC)
- Perfect magnetic conductor (PMC)
- Variable-sized rectangular grids
- Stretched-coordinate PMLs (complex cell sizes allowed)
Currently, only periodic boundary conditions are included.
PEC/PMC boundaries can be implemented by drawing PEC/PMC cells near the edges.
Bloch boundary conditions are not included but wouldn't be very hard to add.
The default solver (opencl_fdfd.cg_solver(...)) located in main.py implements
the E-field wave operator directly (ie, as a list of OpenCL instructions
rather than a matrix). Additionally, there is a slower (and slightly more
2016-08-04 20:14:17 -07:00
versatile) solver in csr.py which attempts to solve an arbitrary sparse
2016-08-04 17:43:01 -07:00
matrix in compressed sparse row (CSR) format using the same conjugate gradient
method as the default solver. The CSR solver is significantly slower, but can
be very useful for testing alternative formulations of the FDFD wave equation.
Currently, this solver only uses a single GPU or other OpenCL accelerator; generalization
to multiple GPUs should be pretty straightforward (ie, just copy over edge values during the
matrix multiplication step).
Dependencies:
2020-07-03 13:48:24 -07:00
- meanas ( https://mpxd.net/code/jan/meanas )
2016-08-04 17:43:01 -07:00
- numpy
- pyopencl
- jinja2
"""
from .main import cg_solver
__author__ = 'Jan Petykiewicz'
from .VERSION import __version__
version = __version__