diff --git a/README.md b/README.md index 20033d4..a646fc3 100644 --- a/README.md +++ b/README.md @@ -516,11 +516,11 @@ TODO: ADD A SENTENCE TO EXPLAIN THE RESULTS It is also possible using the [3D_plotter_animations.jl](./docs/3D_plotter_animations.jl) to generate some animations. To generate the animation we iterate over the $n_z$-values and we take the corresponding field `[:, :, k]` entry (where `k` is the iterate index). The PML layer is represented by the black rectangle. -|![](./docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.0.gif)|![](./docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.0.gif)|![](./docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.0.gif)| +|![](./docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)|![](./docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)|![](./docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)| |:--:| :--: | :--: | | *Ex field*| *Ey field* | *Ez field* | -|![](./docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.0.gif)|![](./docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.0.gif)|![](./docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.0.gif)| +|![](./docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)|![](./docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)|![](./docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)| |:--:| :--: | :--: | | *Hx field*| *Hy field* | *Hz field*| @@ -528,6 +528,31 @@ TODO: ADD A SENTENCE TO EXPLAIN THE RESULTS 2. $\text{pml alpha}=0.1$ (i.e. slightly PML boundary) + +By running the [3D_plotter_surfaces.jl](./docs/3D_plotter_surfaces.jl) file we get the value of each field ($E_x$, $E_y$, $E_z$, $H_x$, $H_x$, $H_z$) as a slice at index $nz/2$ (or $nz/2 - 1$). + +|![](./docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png)|![](./docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png)|![](./docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png)| +|:--:| :--: | :--: | +| *Ex field at nz/2*| *Ey field at nz/2* | *Ez field at nz/2* | + +|![](./docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png)|![](./docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png)|![](./docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png)| +|:--:| :--: | :--: | +| *Hx field at nz/2*| *Hy field at nz/2* | *Hz field at nz/2-1* | + +TODO: ADD A SENTENCE TO EXPLAIN THE RESULTS + +It is also possible using the [3D_plotter_animations.jl](./docs/3D_plotter_animations.jl) to generate some animations. To generate the animation we iterate over the $n_z$-values and we take the corresponding field `[:, :, k]` entry (where `k` is the iterate index). The PML layer is represented by the black rectangle. + +|![](./docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)|![](./docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)|![](./docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)| +|:--:| :--: | :--: | +| *Ex field*| *Ey field* | *Ez field* | + +|![](./docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)|![](./docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)|![](./docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif)| +|:--:| :--: | :--: | +| *Hx field*| *Hy field* | *Hz field*| + +TODO: ADD A SENTENCE TO EXPLAIN THE RESULTS + 3. $\text{pml alpha}=5.0$ (i.e. PML boundary) ## Testing diff --git a/docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif b/docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif new file mode 100644 index 0000000..bb7d0d1 Binary files /dev/null and b/docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif differ diff --git a/docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png b/docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png new file mode 100644 index 0000000..09fb4ca Binary files /dev/null and b/docs/3D/Ex_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png differ diff --git a/docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif b/docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif new file mode 100644 index 0000000..e4f6cab Binary files /dev/null and b/docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif differ diff --git a/docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png b/docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png new file mode 100644 index 0000000..555c78a Binary files /dev/null and b/docs/3D/Ey_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png differ diff --git a/docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif b/docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif new file mode 100644 index 0000000..afecae3 Binary files /dev/null and b/docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif differ diff --git a/docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png b/docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png new file mode 100644 index 0000000..ddd37a5 Binary files /dev/null and b/docs/3D/Ez_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png differ diff --git a/docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif b/docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif new file mode 100644 index 0000000..4884219 Binary files /dev/null and b/docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif differ diff --git a/docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png b/docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png new file mode 100644 index 0000000..3e704b6 Binary files /dev/null and b/docs/3D/Hx_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png differ diff --git a/docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif b/docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif new file mode 100644 index 0000000..459eac3 Binary files /dev/null and b/docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif differ diff --git a/docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png b/docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png new file mode 100644 index 0000000..8e24479 Binary files /dev/null and b/docs/3D/Hy_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png differ diff --git a/docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif b/docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif new file mode 100644 index 0000000..0359ab9 Binary files /dev/null and b/docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.gif differ diff --git a/docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png b/docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png new file mode 100644 index 0000000..0051f80 Binary files /dev/null and b/docs/3D/Hz_3D_pml_nx_256_ny_256_nz_100_alpha_0.1.png differ diff --git a/scripts/2D_maxwell_pml_xPU.jl b/scripts/2D_maxwell_pml_xPU.jl index 35aabee..6caec63 100644 --- a/scripts/2D_maxwell_pml_xPU.jl +++ b/scripts/2D_maxwell_pml_xPU.jl @@ -115,7 +115,7 @@ Use the Finite Difference Time Domain (FDTD) solver to solve Maxwell's equations ENV["GKSwstype"]="nul" if isdir("../docs/viz_out_2D")==false mkdir("../docs/viz_out_2D") end loadpath = "../docs/viz_out_2D/"; anim = Animation(loadpath,String[]) - println("Animation directory: $(anim.dir)") + if do_test==false println("Animation directory: $(anim.dir)") end iframe = 0 end diff --git a/scripts/3D_maxwell_pml_xPU.jl b/scripts/3D_maxwell_pml_xPU.jl index 50d626c..3f4666c 100644 --- a/scripts/3D_maxwell_pml_xPU.jl +++ b/scripts/3D_maxwell_pml_xPU.jl @@ -146,7 +146,7 @@ Update the PML for the Ez field in the z-direction end """ - maxwell(nx_, ny_, nz_, nt_, pml_alpha_; do_visu=false, do_check=true, do_test=true) + maxwell(nx_, ny_, nz_, nt_, pml_alpha_; do_visu=false, do_test=true) Use the Finite Difference Time Domain (FDTD) solver to solve Maxwell's equations @@ -244,7 +244,9 @@ Use the Finite Difference Time Domain (FDTD) solver to solve Maxwell's equations @parallel compute_d_xa!(Ey, dx_Ey) @parallel (1:size(Hz, 1), 1:size(Hz, 2), 1:size(Hz, 3)) update_Hz!(Hz, dt, μ0, σ, Ex, dy_Ex, Ey, dx_Ey, dx, dy) - println(it) + if do_test == false + println(it) + end end # Visualisation @@ -273,9 +275,12 @@ end #maxwell() -#maxwell(nx_, ny_, nz_, nt_, pml_alpha_; do_visu=false, do_check=true, do_test=true) -#maxwell(100, 100, 100, 1000, 0.1; do_visu=true, do_test=false) +#maxwell(nx_, ny_, nz_, nt_, pml_alpha_; do_visu=false, do_test=true) +# Functions used for testing +#maxwell(100, 100, 100, 1000, 0.1; do_visu=true, do_test=false) #maxwell(100, 100, 100, 100, 0.1; do_visu=true, do_test=true) -#maxwell(256, 256, 100, 15000, 0.0, do_visu=true, do_test=false) \ No newline at end of file +# Function used for the simulations in README.md +#maxwell(256, 256, 100, 15000, 0.0, do_visu=true, do_test=false) +#maxwell(256, 256, 100, 15000, 0.1, do_visu=true, do_test=false) \ No newline at end of file