Finite Differences Time Domain


The FDTD class is the heart of nsfds2. It coordinates all the calculations that have to be led to perform the Finite Differences Time Domain (FDTD) simulation. The FDTD works with :

  • a configuration file (parsed by nsfds2.init.config.CfgSetup)

  • initial fields (created by nsfds2.init.fields.Fields)

  • a mesh (created with fdgrid)

Example

from nsfds2.init import CfgSetup, Fields
from nsfds2.fdtd import FDTD
from fdgrid.mesh import Mesh

# Read simulation parameter in config file ~/nsfds2/nsfds2.conf
cfg = CfgSetup()

# Define the mesh
msh = Mesh((cfg.nx, cfg.nz), (cfg.dx, cfg.dz), origin=(cfg.ix0, cfg.iz0), obstacles=[])

# Create simulation
fdtd = FDTD(msh, cfg)
fdtd.run()

class nsfds2.fdtd.FDTD(msh, cfg)[source]

The Finite Differences Time Domain Solver

Parameters
check_results()[source]

Check if computation diverges.

property columns

Return max terminal width.

log()[source]

Display timings.

num2phys()[source]

Convert curvilinear coordinates : from numeric to physical.

phys2num()[source]

Convert curvilinear coordinates : from physical to numeric.

run()[source]

Run the main loop.