Skip to content
Snippets Groups Projects
Commit 6e310b71 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

fixes abstract_particle_set::writeStateChunk

parent 65df4774
No related branches found
No related tags found
No related merge requests found
Pipeline #84882 passed
......@@ -239,14 +239,42 @@ class abstract_particle_set
std::unique_ptr<particle_rnumber[]> xx = this->extractFromParticleState(0, 3);
// allocate temporary array
std::unique_ptr<particle_rnumber[]> yy = this->extractFromParticleState(i0, i0+contiguous_state_chunk);
particle_sample_writer->template save_dataset<contiguous_state_chunk>(
species_name,
field_name,
xx.get(),
&yy,
this->getParticleIndex(),
this->getLocalNumberOfParticles(),
iteration);
switch(contiguous_state_chunk)
{
case 1:
particle_sample_writer->template save_dataset<1>(
species_name,
field_name,
xx.get(),
&yy,
this->getParticleIndex(),
this->getLocalNumberOfParticles(),
iteration);
break;
case 3:
particle_sample_writer->template save_dataset<3>(
species_name,
field_name,
xx.get(),
&yy,
this->getParticleIndex(),
this->getLocalNumberOfParticles(),
iteration);
break;
case 9:
particle_sample_writer->template save_dataset<9>(
species_name,
field_name,
xx.get(),
&yy,
this->getParticleIndex(),
this->getLocalNumberOfParticles(),
iteration);
break;
default:
DEBUG_MSG("code not specialized for this value of contiguous_state_chunk in abstract_particle_set::writeStateChunk\n");
std::cerr << "error in abstract_particle_set::writeStateChunk. please contact maintainer.\n" << std::endl;
}
// deallocate temporary array
delete[] yy.release();
// deallocate position array
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment