

Simulations (the dimensionality will be derived by the shape of the grid). It is chosen to be the maximum number allowed by the Courant-Friedrichs-Lewy Condition:ġ for 1D simulations, 1/√2 for 2D simulations and 1/√3 for 3D Time_step of the simulation and the grid_spacing of the grid. Is possible to change those arrays after making the grid.įinally, the courant_number of the grid determines the relation between the Grid.inverse_permeability array of shape (grid.Nx, grid.Ny, grid.Nz, 3). Reasons) to their inverses grid.inverse_permittivity array and a
Fdtd cuda software#
The software performance limits are estimated through algorithms parameters. Internally, these variables will be converted (for performance for real physics calculation with the use of CUDA, OpenMP, MPI technologies. Permittivity for each of the major axes (so-called _uniaxial_ or _biaxial_

In the last case, the shape implies the possibility for different Recommended minimum grid_spacing turns out to be 50pmįor the permittivity and permeability floats or arrays with theĪre expected. Wavelength 1550nm and a material with refractive index of 3.1, the This means that for a grid containing a source with For stability reasons, it is recommended toĬhoose a grid spacing that is at least 10 times smaller than the _smallest_


Internally, these numbers will be translated to threeĪ grid_spacing can be given. The cuda backends are only available for computers with a GPU. In general, float64 precision is always preferred over float32 for FDTD simulations, however, float32 might give a significant performance boost. Given in integers, it denotes the width, height and length of the grid in terms tbackend('torch') In general, the numpy backend is preferred for standard CPU calculations with float64 precision. If the shape is given in floats, itĭenotes the width, height and length of the grid in meters. Grid ( shape : Tuple, grid_spacing : float = 155e-9, permittivity : float = 1.0, permeability : float = 1.0, courant_number : float = None, )Ī grid is defined by its shape, which is just a 3D tuple of The formulas appearing in this answer have been generated by using mimetex.# signature fdtd.
Fdtd cuda update#
For example, the update equation for the x-component of the magnetic field isįinally, it should be mentioned that another source of discussion for 3D FDTD in CUDA is the Parallel ForAll blog, seeįinite Difference Methods in CUDA C/C++, Part 1įinite Difference Methods in CUDA C++, Part 2 Electromagnetic fields are vector fields and in this case the above update equation is replaced by six equations for the three components of electric and magnetic fields. Which also provides a thorough discussion on the effective stencil calculation. Elsherbeni, "Compute Unified Device Architecture (CUDA) Based Finite-ĭifference Time-Domain (FDTD) Implementation", Appl.
Fdtd cuda code#
A good reference in this respect implementing a 3D FDTD code for electromagnetics and taking particular care to the efficiency of the stencil calculation is the following: The code is not for electromagnetic applications as the updating rule is the following:īut it can be easily extended to electromagnetics. The code has been optimized for Tesla cards and uses shared memory to load slices of the 3D computational domain to enable fast stencil evaluations (reducing read redundancy). Micikevicius, "3D Finite Difference Computation on GPUs using CUDA" This is a late answer provided here to remove this question from the unanswered list.Īs the OP mentioned, the CUDA-SDK provides a 3D Finite Difference Time Domain (FDTD) solver and a description of this solver is provided in the paper
