fap2 = collector.FieldAtPoint("fap2", savedir + "graph/{}".format(filename), TF, loc2, 'cupy') fap3 = collector.FieldAtPoint("fap3", savedir + "graph/{}".format(filename), TF, loc3, 'cupy') fap4 = collector.FieldAtPoint("fap4", savedir + "graph/{}".format(filename), TF, loc4, 'cupy') fap5 = collector.FieldAtPoint("fap5", savedir + "graph/{}".format(filename), TF, loc5, 'cupy') #------------------------------------------------------------------# #-------------------- Graphtool object settings -------------------# #------------------------------------------------------------------# # Set plotfield options plot_per = 100 TFgraphtool = plotfield.Graphtool(TF, 'TF', savedir) #------------------------------------------------------------------# #------------------------ Time loop begins ------------------------# #------------------------------------------------------------------# # Save what time the simulation begins. start_time = datetime.datetime.now() # time loop begins for tstep in range(Tsteps): # At the start point if tstep == 0: TF.MPIcomm.Barrier() if TF.MPIrank == 0:
# Line source along y axis. #FDTDspace.set_src((src_xpos, 0, FDTDspace.Nzc), (src_xpos+1, FDTDspace.Ny, FDTDspace.Nzc+1)) # Line source along z axis. #FDTDspace.set_src((src_xpos, FDTDspace.Nyc, 0), (src_xpos+1, FDTDspace.Nyc+1, FDTDspace.Nz)) # Set Poynting vector calculator. leftx, rightx = int(Nx/4), int(Nx*3/4) lefty, righty = int(Ny/4), int(Ny*3/4) leftz, rightz = int(Nz/4), int(Nz*3/4) #Sx_R_getter = rft.Sx("SF_R", "./graph/Sx", FDTDspace, (rightx, lefty, leftz), (rightx+1, righty, rightz), freqs, 'cupy') # Set plotfield options FDTDgraphtool = plotfield.Graphtool(FDTDspace, 'FDTD', savedir) PSTDgraphtool = plotfield.Graphtool(PSTDspace, 'PSTD', savedir) Diffgraphtool = plotfield.Graphtool(Diffspace, 'Diff', savedir) # Save what time the simulation begins. start_time = datetime.datetime.now() # time loop begins for tstep in range(FDTDspace.tsteps+1): # At the start point if tstep == 0: FDTDspace.MPIcomm.Barrier() if FDTDspace.MPIrank == 0: print("Total time step: %d" %(FDTDspace.tsteps)) print(("Size of a total field array : %05.2f Mbytes" %(FDTDspace.TOTAL_NUM_GRID_SIZE)))
#Box = structure.Box(Space, Box1_srt, Box1_end, 4., 1.) # Set PML and PBC Space.set_PML({'x': '', 'y': '', 'z': ''}, 10) Space.apply_PBC({'y': False, 'z': False}) # Save eps, mu and PML data. #Space.save_PML_parameters('./') #Space.save_eps_mu(savedir) # Set position of Src, Ref and Trs. Space.set_src_pos((Space.Nxc, Space.Nyc, Space.Nzc), (Space.Nxc + 1, Space.Nyc + 1, Space.Nzc + 1)) # Set plotfield options graphtool = plotfield.Graphtool(Space, 'TF', savedir) # initialize the core Space.init_update_equations(omp_on=True) # Save what time the simulation begins. start_time = datetime.datetime.now() # time loop begins for tstep in range(Space.tsteps): # At the start point if tstep == 0: Space.MPIcomm.Barrier() if Space.MPIrank == 0: print("Total time step: %d" % (Space.tsteps))
(righty, rightz), freqs, 'cupy') SF_Sx_R_calculator = rft.Sx("Sx_SF_R", "./graph/Sx", SF, rightx, (lefty, leftz), (righty, rightz), freqs, 'cupy') SF_Sy_L_calculator = rft.Sy("Sy_SF_L", "./graph/Sy", SF, lefty, (leftx, leftz), (rightx, rightz), freqs, 'cupy') SF_Sy_R_calculator = rft.Sy("Sy_SF_R", "./graph/Sy", SF, righty, (leftx, leftz), (rightx, rightz), freqs, 'cupy') SF_Sz_L_calculator = rft.Sz("Sz_SF_L", "./graph/Sz", SF, leftz, (leftx, lefty), (rightx, righty), freqs, 'cupy') SF_Sz_R_calculator = rft.Sz("Sz_SF_R", "./graph/Sz", SF, rightz, (leftx, lefty), (rightx, righty), freqs, 'cupy') # Set plotfield options TFgraphtool = plotfield.Graphtool(TF, 'TF', savedir) IFgraphtool = plotfield.Graphtool(IF, 'IF', savedir) SFgraphtool = plotfield.Graphtool(SF, 'SF', savedir) # Save what time the simulation begins. start_time = datetime.datetime.now() # time loop begins for tstep in range(Tsteps): # At the start point if tstep == 0: TF.MPIcomm.Barrier() if TF.MPIrank == 0: print("Total time step: %d" % (TF.tsteps)) print(("Size of a total field array : %05.2f Mbytes" %