1. I think you can use any wave-form. How to do it would depend on the software you are using. An example would be providing a data file specifying the amplitude of pusle at a series of time steps. Now the accuracy of the result and the time to convergence would be affected by the wave-form. If your source runs for 10000 time steps before reaching "practical" zero, you would check carefully whether the output has stablized much earlier (say 5000). If the simulation is terminated too early, you have error. You would also think about numerical dispersion...
2. Obviously you can mix FDTD with other method. Some commercial codes (e.g. WASP-net) does that. From a theoretical point of view, those methods are used to solve some differential equations, and you could appy equivalent principle to decompose a problem domain into subdomains and apply different methods in each of them.
Maybe you can find the 2d and 3d code in the book by Taflove.
Computational Electrodynamics: The Finite-Difference Time-Domain Method by Allen Taflove, Susan C. Hagness (Hardcover - June 2000)
Or You can find another book
Electromagnetic Simulation Using the FDTD Method by Dennis M. Sullivan (Author) (Hardcover)
Absorbing Boundary Conditions are necessary to keep outgoing H and E fields from being reflected back into the problem space. Normally, in calculating the E field, we know the surrounding H values;this is a fundamental assumption in the FDTD method.At the edge of the problem space we will not have the value to one side.
Suppose we are looking for a boundary condition in the end.If the wave is going toward the boundary condition in free space, it is travelling at c, the speed of light.So in one time step of the FDTD algorithm,it travels:
distance=c*dt=c*(dx/2c)=dx/2
The above equation explains that it takes two time steps for a wave to cross one cell.So a common sense approach tells as that a common boundary condition would be Ex(0)=Ex(n-2)(1)
It is relativeley easy to implement this.Store a value of Ex(1) for two time steps and then put it in Ex(0).
Yes we can see this from the book of Sullivan. But, in the code you have pasted above, how were the time indexes "n" and "n-2" are presented, i.e. in
" ex(1) = ex_low_m2
ex_low_m2 = ex_low_m1
ex_low_m1 = ex(2) "
I saw just that ex(1) = ex(2).
Sorry for my zombie question. Thanks!
Absorbing Boundary ... So in one time step of the FDTD algorithm,it travels:
distance=c*dt=c*(dx/2c)=dx/2
The above equation explains that it takes two time steps for a wave to cross one cell.So a common sense approach tells as that a common boundary condition would be Ex(0)=Ex(n-2)(1)
It is relativeley easy to implement this.Store a value of Ex(1) for two time steps and then put it in Ex(0).