S.allocate_main() S.allocate_coeff() Drude = DrudeAde( Nx, Ny, Nz, 0, 0, 0, S ) Drude.allocate_main() Drude.allocate_coeff() epr = 9.0685 pfreq = 2*pi*2155.6*1e12/sc.sqrt(epr) gamma = 2*pi*18.36*1e12 S.epr_x[50:101,50:100,:] = epr S.epr_y[50:100,50:101,:] = epr S.epr_z[50:100,50:100,:] = epr S.set_coeff() Drude.pfreq_x[50:101,50:100,:] = pfreq Drude.pfreq_y[50:100,50:101,:] = pfreq Drude.pfreq_z[50:100,50:100,:] = pfreq Drude.gamma_x[50:101,50:100,:] = gamma Drude.gamma_y[50:100,50:101,:] = gamma Drude.gamma_z[50:100,50:100,:] = gamma Drude.set_coeff() Cpml.set_space( S ) Cpml.allocate_psi() Cpml.allocate_coeff() #-------------------------------------------------------------------- print '-'*47
S.allocate_main() S.allocate_coeff() Drude = DrudeAde(Nx, Ny, Nz, 0, 0, 0, S) Drude.allocate_main() Drude.allocate_coeff() epr = 9.0685 pfreq = 2 * pi * 2155.6 * 1e12 / sc.sqrt(epr) gamma = 2 * pi * 18.36 * 1e12 S.epr_x[50:101, 50:100, :] = epr S.epr_y[50:100, 50:101, :] = epr S.epr_z[50:100, 50:100, :] = epr S.set_coeff() Drude.pfreq_x[50:101, 50:100, :] = pfreq Drude.pfreq_y[50:100, 50:101, :] = pfreq Drude.pfreq_z[50:100, 50:100, :] = pfreq Drude.gamma_x[50:101, 50:100, :] = gamma Drude.gamma_y[50:100, 50:101, :] = gamma Drude.gamma_z[50:100, 50:100, :] = gamma Drude.set_coeff() Cpml.set_space(S) Cpml.allocate_psi() Cpml.allocate_coeff() #-------------------------------------------------------------------- print '-' * 47
#print 'node_length_x_list:', node_length_x_list if myrank is not server: node_length_x = node_length_x_list[myrank-1] node_Nx = node_Nx_list[myrank-1] S = Dielectric( node_Nx+2, Ny+2, Nz+2, dx, Ncore ) wrapbox_pt1 = [ sc.array(node_length_x_list[:myrank-1],'f').sum(), 0, 0 ] wrapbox_pt2 = [ sc.array(node_length_x_list[:myrank],'f').sum(), space_dim[1], space_dim[2] ] length = list( sc.array(wrapbox_pt2) - sc.array(wrapbox_pt1) ) center_pt = list( sc.array(wrapbox_pt1) + sc.array(length)/2 ) #print 'rank:',myrank,'wrapbox_pt', wrapbox_pt1, wrapbox_pt2 #print 'center_pt:',center_pt,'length:',length S.set_wrapbox( wrapbox_pt1, wrapbox_pt2, center_pt, length ) S.allocate_main() S.allocate_coeff() S.set_coeff( structure_groups, wrapbox_groups ) Cpml = CpmlNonKappaMpi( node_Nx_list, Npml, pml_apply_direction ) Cpml.set_space( S ) Cpml.allocate_psi() Cpml.allocate_coeff() target_list, mpi_func_list = calc_oddeven( myrank ) for output in output_list: output.set_space( S, node_Nx_list ) for src in src_list: src.set_space( S, node_Nx_list ) for i, obj in enumerate( [S, Cpml] ): mpi.send( obj.mem_usage, server, tag=i ) else: