Fdtd python
First of all, the object is given the space Object ( permittivity = 1.7 ** 2, name = "object" ) They are in stead derived from its placing in the grid: grid = fdtd. Note that the values obj.Nx, obj.Ny and obj.Nz are not given to the Just like for the grid, the Object expects a permittivity to be a floats orĪn array of the following possible shapes In this case we'll make an object with a different permittivity than Mixing between the axes are present through Pockels coefficients or many To introduce for example absorbing materials or biaxial materials for which
FDTD PYTHON UPDATE
Object ( permittivity : Tensorlike, name : str = None )Īn object defines a part of the grid with modified update equations, allowing Grid ( shape = ( 25e-6, 15e-6, 1 ), # 25um x 15um x 1 (grid_spacing) -> 2D FDTD ) print ( grid ) Grid(shape=(161,97,1), grid_spacing=1.55e-07, courant_number=0.70)Īn other option to locally change the permittivity or permeability in the Stability reasons, it is recommended not to change this value. 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ġ 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 Internally, these variables will be converted (for performance 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 followingĪ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 integers:Ī grid_spacing can be given. If the shape is given in integers, itĭenotes the width, height and length of the grid in terms of the If the shape is given in floats, it denotes the width, 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 Number-types The FDTD grid defines the simulation region.
The "cuda" backends are only available for computers with a GPU. Preferred over "float32" for FDTD simulations, however, "float32" might In general, "float64" precision is always In general, the "numpy" backend is preferred for standard CPU calculations
FDTD PYTHON HOW TO
FDTD PYTHON INSTALL
The development version can be installed by cloning the repository git clone Īnd linking it with pip pip install -e fdtdĭevelopment dependencies can be installed with pip install -e fdtdĪll improvements or additions (for example new objects, sources or detectors) are The fdtd-library can be installed with pip: pip install fdtd
FDTD PYTHON SIMULATOR
The FDTD simulator hasĪn optional PyTorch backend, enabling FDTD simulations on a GPU.
A 3D electromagnetic FDTD simulator written in Python.