poplahotel.blogg.se

Fdtd algorithm
Fdtd algorithm













  1. FDTD ALGORITHM HOW TO
  2. FDTD ALGORITHM INSTALL
  3. FDTD ALGORITHM UPDATE
  4. FDTD ALGORITHM REGISTRATION
  5. FDTD ALGORITHM SIMULATOR

Note that one could also have supplied lists to index the grid in the first source ) LineSource(period=14, amplitude=1.0, phase_shift=0.0, x=, y=, z= Internally, these slices will be converted into lists to ensure this behavior: print ( grid. the source spans the diagonal of the cube defined by the slices. However, it is important to note that in this case a LineSource is added to LineSource ( period = 1550e-9 / ( 3e8 ), name = "source" ) LineSource ( period : Number = 15, # timesteps or seconds amplitude : float = 1.0, phase_shift : float = 0.0, name : str = None, )Īnd also just like an fdtd.Object, an fdtd.LineSource size is defined by its Similarly as to adding an object to the grid, an fdtd.LineSource can also beĪdded: # signature fdtd. However, it is still available via the grid.objects Since the object did not receive a name, the object won't be available as anĪttribute of the grid.

FDTD ALGORITHM REGISTRATION

Replaced by integer Nx, Ny and Nz during the registration of the object. Here, a slice with floating point numbers was chosen. object ) x=11:32, y=30:84, z=0:1Ī second object can be added to the grid: grid = fdtd. The object, this name will become available in the grid: print ( grid. Because it is given this space, the object's 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

fdtd algorithm

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 ALGORITHM 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.

fdtd algorithm

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.

fdtd algorithm

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

fdtd algorithm

In general, the "numpy" backend is preferred for standard CPU calculations

FDTD ALGORITHM HOW TO

  • "torch.cuda" (defaults to float64 tensors)įor example, this is how to choose the "torch" backend: fdtd.
  • The "numpy" backend is theĭefault one, but there are also several additional PyTorch backends: The fdtd library allows to choose a backend. The fdtd library is simply imported as follows: import fdtd Setting the backend

    FDTD ALGORITHM 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 ALGORITHM SIMULATOR

    The FDTD simulator hasĪn optional PyTorch backend, enabling FDTD simulations on a GPU. A 3D electromagnetic FDTD simulator written in Python.















    Fdtd algorithm