From a5988c066c3893e0c9fd1493977a18a76189ad7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Klatt?= Date: Wed, 19 Nov 2014 11:26:02 +0100 Subject: [PATCH] examples: boris: going multi-particle #5 a few adjustments to logging of particles next: rewriting particles ... -_- --- examples/boris/boris_sdc.cpp | 2 +- examples/boris/particle.hpp | 37 +++++++++++++++++- examples/boris/particle_3d.hpp | 69 ++++++++++++++++++++++------------ 3 files changed, 80 insertions(+), 28 deletions(-) diff --git a/examples/boris/boris_sdc.cpp b/examples/boris/boris_sdc.cpp index 51fc326d..11d7f95b 100644 --- a/examples/boris/boris_sdc.cpp +++ b/examples/boris/boris_sdc.cpp @@ -51,7 +51,6 @@ namespace pfasst auto initial_particles = sweeper->get_particles(0); distribute_particles_around_center(initial_center, initial_particles); - sweeper->set_initial_energy(); LOG(INFO) << OUT::green << "Initial Particles"; for (auto p : sweeper->get_particles(0)) { @@ -60,6 +59,7 @@ namespace pfasst } LOG(INFO) << OUT::green << "\tcenter:" << *(get_center_of_mass(sweeper->get_particles(0))); + sweeper->set_initial_energy(); sdc.run(); return sweeper->get_errors(); diff --git a/examples/boris/particle.hpp b/examples/boris/particle.hpp index bc42d6ea..20ebd0c1 100644 --- a/examples/boris/particle.hpp +++ b/examples/boris/particle.hpp @@ -10,6 +10,7 @@ using namespace std; #include #include +#include #include #include @@ -71,7 +72,8 @@ namespace pfasst typename time = time_precision > class ParticleComponentEncapsulation - : public Encapsulation