Changeset d13e27 for src/units/particle/interface_particles.cpp
- Timestamp:
- Mar 29, 2013, 5:03:13 PM (13 years ago)
- Children:
- f57182
- Parents:
- 5ba22b
- File:
-
- 1 edited
-
src/units/particle/interface_particles.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/units/particle/interface_particles.cpp
r5ba22b rd13e27 86 86 std::list<Particle::Particle>::iterator iter; 87 87 88 #ifdef DEBUG_OUTPUT88 #ifdef OUTPUT_DEBUG 89 89 vmg_float particle_charges = 0.0; 90 90 for (iter=particles.begin(); iter!=particles.end(); ++iter) 91 91 particle_charges += iter->Charge(); 92 92 particle_charges = MG::GetComm()->GlobalSumRoot(particle_charges); 93 comm.Print StringOnce("Particle list charge sum: %e", particle_charges);94 comm.Print String("Local number of particles: %d", particles.size());93 comm.PrintOnce(Debug, "Particle list charge sum: %e", particle_charges); 94 comm.Print(Debug, "Local number of particles: %d", particles.size()); 95 95 #endif 96 96 … … 112 112 particle_grid.Local().Begin().Z() + k); 113 113 114 #ifdef DEBUG_OUTPUT114 #ifdef OUTPUT_DEBUG 115 115 Grid::iterator grid_iter; 116 116 vmg_float charge_sum = 0.0; … … 118 118 charge_sum += grid.GetVal(*grid_iter); 119 119 charge_sum = MG::GetComm()->GlobalSum(charge_sum); 120 comm.Print StringOnce("Grid charge sum: %e", charge_sum);120 comm.PrintOnce(Debug, "Grid charge sum: %e", charge_sum); 121 121 #endif 122 122 } … … 126 126 Index i; 127 127 128 #ifdef DEBUG_OUTPUT128 #ifdef OUTPUT_DEBUG 129 129 vmg_float e = 0.0; 130 130 vmg_float e_long = 0.0; … … 185 185 (*p1)->Pot() -= (*p1)->Charge() * spl.GetAntiDerivativeAtZero(); 186 186 187 #ifdef DEBUG_OUTPUT187 #ifdef OUTPUT_DEBUG 188 188 e_long += 0.5 * (*p1)->Charge() * ip.EvaluatePotentialLR(**p1); 189 189 e_self += 0.5 * (*p1)->Charge() * (*p1)->Charge() * spl.GetAntiDerivativeAtZero(); … … 206 206 (*p1)->Field() += (*p2)->Charge() * dir * spl.EvaluateField(length); 207 207 208 #ifdef DEBUG_OUTPUT208 #ifdef OUTPUT_DEBUG 209 209 e_short_peak += 0.5 * (*p1)->Charge() * (*p2)->Charge() / length; 210 210 e_short_spline += 0.5 * (*p1)->Charge() * (*p2)->Charge() / length * spl.EvaluatePotential(length); … … 229 229 comm.CommParticlesBack(particles); 230 230 231 #ifdef DEBUG_OUTPUT231 #ifdef OUTPUT_DEBUG 232 232 vmg_float* q = factory.GetObjectStorageArray<vmg_float>("PARTICLE_CHARGE_ARRAY"); 233 233 const vmg_int& num_particles_local = factory.GetObjectStorageVal<vmg_int>("PARTICLE_NUM_LOCAL"); … … 245 245 e = comm.GlobalSumRoot(e); 246 246 247 comm.PrintStringOnce("E_long: %e", e_long); 248 comm.PrintStringOnce("E_short_peak: %e", e_short_peak); 249 comm.PrintStringOnce("E_short_spline: %e", e_short_spline); 250 comm.PrintStringOnce("E_self: %e", e_self); 251 comm.PrintStringOnce("E_total: %e", e); 252 comm.PrintStringOnce("E_total*: %e", e_long + e_short_peak + e_short_spline - e_self); 253 254 #endif /* DEBUG_OUTPUT */ 255 247 comm.PrintOnce(Debug, "E_long: %e", e_long); 248 comm.PrintOnce(Debug, "E_short_peak: %e", e_short_peak); 249 comm.PrintOnce(Debug, "E_short_spline: %e", e_short_spline); 250 comm.PrintOnce(Debug, "E_self: %e", e_self); 251 comm.PrintOnce(Debug, "E_total: %e", e); 252 comm.PrintOnce(Debug, "E_total*: %e", e_long + e_short_peak + e_short_spline - e_self); 253 #endif 256 254 }
Note:
See TracChangeset
for help on using the changeset viewer.
