/* improved2.c: Version 2 of the improved bare-bones 1D FDTD * simulation. */ #include "fdtd2.h" #include "ezInc2.h" int main() { Grid *g; ALLOC_1D(g, 1, Grid); // allocate memory for Grid gridInit2(g); // initialize the grid ezIncInit(g); // initialize source function /* do time stepping */ for (Time = 0; Time < MaxTime; Time++) { updateH2(g); // update magnetic field updateE2(g); // update electric field Ez(0) = ezInc(Time, 0.0); // apply source function printf("%g\n", Ez(50)); // print output } // end of time-stepping return 0; }