| 104 | == FDTD-2D == |

| 105 | {{{ |

| 106 | for(t=0; t<=T-1; t++) |

| 107 | { |

| 108 | for (j=0; j<=N-1; j++) |

| 109 | ey[0][j] = t; |

| 110 | for (i=1; i<=N-1; i++) |

| 111 | for (j=0; j<=N-1; j++) |

| 112 | ey[i][j] = ey[i][j] - 0.5*(hz[i][j]-hz[i-1][j]); |

| 113 | for (i=0; i<=N-1; i++) |

| 114 | for (j=1; j<=N-1; j++) |

| 115 | ex[i][j] = ex[i][j] - 0.5*(hz[i][j]-hz[i][j-1]); |

| 116 | for (i=0; i<=N-1; i++) |

| 117 | for (j=0; j<=N-1; j++) |

| 118 | hz[i][j] = hz[i][j] - 0.7*(ex[i][j+1]-ex[i][j]+ey[i+1][j]-ey[i][j]); |

| 119 | } |

| 120 | }}} |

| 121 | |

| 122 | === Sequential (single core) === |

| 123 | [[Image(fdtd-2d.png,nolink)]] |

| 124 | |

| 125 | === Parallel (multi-core) === |

| 126 | [[Image(fdtd-2d-par.png,nolink)]] |

| 127 | |