Commit 91b64e4a authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

fixes rhs additional_data usage for p2p call

parent 25607346
Pipeline #100544 passed with stages
in 9 minutes and 56 seconds
......@@ -58,11 +58,13 @@ class tracer_with_collision_counter_rhs: public tracer_rhs<rnumber, be, tt>
// interpolation adds on top of existing values, so result must be cleared.
std::fill_n(result, pset.getLocalNumberOfParticles()*3, 0);
int interpolation_result = (*(this->velocity))(t, pset, result);
additional_data.push_back(std::unique_ptr<abstract_particle_set::particle_rnumber[]>(
new abstract_particle_set::particle_rnumber[pset.getLocalNumberOfParticles()*pset.getStateSize()]));
additional_data.insert(
additional_data.begin(),
std::unique_ptr<abstract_particle_set::particle_rnumber[]>(
new abstract_particle_set::particle_rnumber[pset.getLocalNumberOfParticles()*pset.getStateSize()]));
// copy rhs values to temporary array
pset.copy_state_tofrom(
additional_data[additional_data.size()-1].get(),
additional_data[0].get(),
result);
this->p2p_gc.reset_collision_pairs();
pset.template applyP2PKernel<
......@@ -74,9 +76,9 @@ class tracer_with_collision_counter_rhs: public tracer_rhs<rnumber, be, tt>
// copy shuffled rhs values
pset.copy_state_tofrom(
result,
additional_data[additional_data.size()-1].get());
additional_data[0].get());
// clear temporary array
additional_data.pop_back();
additional_data.erase(additional_data.begin());
return interpolation_result;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment