diff --git a/PlotScript/src/Release/sample.exe b/PlotScript/src/Release/sample.exe index d23c400..935523b 100644 Binary files a/PlotScript/src/Release/sample.exe and b/PlotScript/src/Release/sample.exe differ diff --git a/PlotScript/visualization.py b/PlotScript/visualization.py index d3a049f..caa4f0f 100644 --- a/PlotScript/visualization.py +++ b/PlotScript/visualization.py @@ -3,10 +3,10 @@ import pandas as pd import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation +import numpy as np components_num = {"Ex": '1', "Ey": '2', "Ez": '3', "Bx": '4', "By": '5', "Bz": '6'} - def get_animation(component): folder_path = f'OutFiles_{components_num[component]}' file_names_base = sorted(glob.glob(folder_path + '/*.csv')) @@ -15,10 +15,11 @@ def get_animation(component): fig, ax = plt.subplots() def update(frame): + mut = 0 ax.clear() data = pd.read_csv(file_names[frame], sep=';') data = data.apply(lambda x: x.str.replace(',', '.').astype(float) if x.dtype == 'object' else x) - ax.imshow(data, cmap='viridis', interpolation='nearest') + ax.imshow(data, cmap='RdBu', vmin=-0.5, vmax=0.5, interpolation='none') ax.set_title('Frame {}'.format(frame + 1)) ani = FuncAnimation(fig, update, frames=len(file_names), interval=50) @@ -49,6 +50,6 @@ def execute_cpp(grid_size, iters_num, single_iteration_flag=True): if __name__ == '__main__': - # execute_cpp(50, 100, False) + execute_cpp(75, 410, False) get_animation("Ex") # get_heatmap("Ex", 86) diff --git a/samples/sample.cpp b/samples/sample.cpp index 0ea08cf..7add225 100644 --- a/samples/sample.cpp +++ b/samples/sample.cpp @@ -182,7 +182,7 @@ int main(int argc, char* argv[]) { #ifdef __USE_SPHERICAL_WAVE__ int N = 70; - int Iterations = 300; + int Iterations = 10; spherical_wave(N, Iterations, "../../PlotScript/"); #endif diff --git a/src/FDTD.cpp b/src/FDTD.cpp index 8f493d5..45c3b9e 100644 --- a/src/FDTD.cpp +++ b/src/FDTD.cpp @@ -2,7 +2,7 @@ #include -#define __DEBUG_PML__ +//#define __DEBUG_PML__ //#define __OUTPUT_SIGMA__ Field::Field(const int _Ni = 1, const int _Nj = 1, const int _Nk = 1) @@ -481,7 +481,7 @@ std::vector> FDTD::update_fields(const int time) double max_val_1 = 0.0; double max_val_2 = 0.0; int t_start = 50; - int t_final = 280; + int t_final = 400; #endif // __DEBUG_PML__ for (int t = 0; t < time; t++)