diff --git a/bfps/DNS.py b/bfps/DNS.py index 3be9123b40dba39e5aee651e84969f6a59e639f8..488ff1b08bb6ea6b0da178f4f6f0178be3263999 100644 --- a/bfps/DNS.py +++ b/bfps/DNS.py @@ -910,6 +910,7 @@ class DNS(_code): particle_file.create_group('tracers0/acceleration') if self.dns_type in ['NSVEparticlesP2P']: particle_file.create_group('tracers0/orientation') + particle_file.create_group('tracers0/vorticity') return None def launch_jobs( self, diff --git a/bfps/cpp/full_code/NSVEparticlesP2P.cpp b/bfps/cpp/full_code/NSVEparticlesP2P.cpp index a9e1493c3c601356ce040a0a7e0e7eed01086563..85caafe025379e93c8a4ec43e460efa51a7598a2 100644 --- a/bfps/cpp/full_code/NSVEparticlesP2P.cpp +++ b/bfps/cpp/full_code/NSVEparticlesP2P.cpp @@ -90,7 +90,7 @@ int NSVEparticlesP2P<rnumber>::finalize(void) return EXIT_SUCCESS; } -/** \brief Compute fluid stats and sample fields at particle locations. +/** \brief Compute fluid stats and sample particle data. */ template <typename rnumber> @@ -128,29 +128,42 @@ int NSVEparticlesP2P<rnumber>::do_stats() this->ps->getLocalNbParticles(), this->ps->get_step_idx()-1); - ///// sample velocity - //this->ps->sample_compute_field(*this->tmp_vec_field, pdata.get()); - //this->particles_sample_writer_mpi->save_dataset( - // "tracers0", - // "velocity", - // this->ps->getParticlesState(), - // &pdata, - // this->ps->getParticlesIndexes(), - // this->ps->getLocalNbParticles(), - // this->ps->get_step_idx()-1); - - ///// compute acceleration and sample it - //this->fs->compute_Lagrangian_acceleration(this->tmp_vec_field); - //this->tmp_vec_field->ift(); - //this->ps->sample_compute_field(*this->tmp_vec_field, pdata.get()); - //this->particles_sample_writer_mpi->save_dataset( - // "tracers0", - // "acceleration", - // this->ps->getParticlesState(), - // &pdata, - // this->ps->getParticlesIndexes(), - // this->ps->getLocalNbParticles(), - // this->ps->get_step_idx()-1); + /// sample velocity + this->ps->sample_compute_field(*this->tmp_vec_field, pdata1.get()); + this->particles_sample_writer_mpi->save_dataset( + "tracers0", + "velocity", + pdata0.get(), + &pdata1, + this->ps->getParticlesIndexes(), + this->ps->getLocalNbParticles(), + this->ps->get_step_idx()-1); + + /// sample vorticity + *this->tmp_vec_field = this->fs->cvorticity->get_cdata(); + this->tmp_vec_field->ift(); + this->ps->sample_compute_field(*this->tmp_vec_field, pdata1.get()); + this->particles_sample_writer_mpi->save_dataset( + "tracers0", + "vorticity", + pdata0.get(), + &pdata1, + this->ps->getParticlesIndexes(), + this->ps->getLocalNbParticles(), + this->ps->get_step_idx()-1); + + /// compute acceleration and sample it + this->fs->compute_Lagrangian_acceleration(this->tmp_vec_field); + this->tmp_vec_field->ift(); + this->ps->sample_compute_field(*this->tmp_vec_field, pdata1.get()); + this->particles_sample_writer_mpi->save_dataset( + "tracers0", + "acceleration", + pdata0.get(), + &pdata1, + this->ps->getParticlesIndexes(), + this->ps->getLocalNbParticles(), + this->ps->get_step_idx()-1); return EXIT_SUCCESS; }