if save_fields == 1: save.save_field_data(0, DT, field_save_iter, 0, Ji, E_int,\ B, Ve, Te, q_dens, B_damping_array, E_damping_array) # Retard velocity print('Retarding velocity...') particles.velocity_update(pos, vel, Ie, W_elec, Ib, W_mag, idx, Ep, Bp, B, E_int, v_prime, S, T, temp_N, -0.5 * DT) qq = 1 sim_time = DT print('Starting main loop...') while qq < max_inc: qq, DT, max_inc, part_save_iter, field_save_iter = \ aux.main_loop(pos, vel, idx, Ie, W_elec, Ib, W_mag, Ep, Bp, v_prime, S, T, temp_N,\ B, E_int, E_half, q_dens, q_dens_adv, Ji, ni, nu, mp_flux, \ Ve, Te, Te0, temp3De, temp3Db, temp1D, old_particles, old_fields, \ B_damping_array, E_damping_array, qq, DT, max_inc, part_save_iter, field_save_iter) if qq % part_save_iter == 0 and save_particles == 1: save.save_particle_data(sim_time, DT, part_save_iter, qq, pos, vel, idx) if qq % field_save_iter == 0 and save_fields == 1: save.save_field_data(sim_time, DT, field_save_iter, qq, Ji, E_int, B, Ve, Te, q_dens, B_damping_array, E_damping_array) if qq % 50 == 0: running_time = int(timer() - start_time) hrs = running_time // 3600 rem = running_time % 3600
save.save_particle_data(DT, part_save_iter, 0, pos, vel) if save_fields == 1: save.save_field_data(DT, field_save_iter, 0, Ji, E_int, B, Ve, Te, q_dens) particles.assign_weighting_TSC(pos, Ib, W_mag, E_nodes=False) particles.velocity_update(vel, Ie, W_elec, Ib, W_mag, idx, B, E_int, -0.5 * DT) qq = 1 print('Starting main loop...') while qq < max_inc: qq, DT, max_inc, part_save_iter, field_save_iter = \ aux.main_loop(pos, vel, idx, Ie, W_elec, Ib, W_mag, \ B, E_int, E_half, q_dens, q_dens_adv, Ji, ni, nu, \ Ve, Te, temp3D, temp3D2, temp1D, old_particles, old_fields,\ qq, DT, max_inc, part_save_iter, field_save_iter) if qq % part_save_iter == 0 and save_particles == 1: save.save_particle_data(DT, part_save_iter, qq, pos, vel) if qq % field_save_iter == 0 and save_fields == 1: save.save_field_data(DT, field_save_iter, qq, Ji, E_int, B, Ve, Te, q_dens) if qq % 50 == 0: running_time = int(timer() - start_time) hrs = running_time // 3600 rem = running_time % 3600 mins = rem // 60