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
msh (
nsfds2.fdgrid.mesh.Mesh
) – Meshcfg (
nsfds2.init.config.CfgSetup
) – Configuration
- property columns
Return max terminal width.