diff --git a/bfps/NavierStokes.py b/bfps/NavierStokes.py index 20e1093181a2cd018cb4a1f53a7a89979d93ade2..8eea54a1d6d71db562badf85280f34f20099906c 100644 --- a/bfps/NavierStokes.py +++ b/bfps/NavierStokes.py @@ -450,7 +450,7 @@ class NavierStokes(bfps.fluid_base.fluid_particle_base): double *velocity = new double[ps{0}->array_size]; ps{0}->sample_vec_field(vel_{1}, velocity); ps{0}->sample_vec_field(acc_{1}, acceleration); - if (ps{0}->fs->rd->myrank == 0) + if (ps{0}->myrank == 0) {{ //VELOCITY begin std::string temp_string = (std::string("/particles/") + @@ -512,7 +512,7 @@ class NavierStokes(bfps.fluid_base.fluid_particle_base): neighbours, self.particle_species) self.particle_start += ('ps{0} = new rFFTW_particles<VELOCITY_TRACER, {1}, {2}>(\n' + - 'fname, fs, vel_{3},\n' + + 'fname, vel_{3},\n' + 'nparticles,\n' + 'niter_part, tracers{0}_integration_steps);\n').format( self.particle_species, self.C_dtype, neighbours, fields_name) diff --git a/bfps/cpp/rFFTW_particles.cpp b/bfps/cpp/rFFTW_particles.cpp index d16768fa127c2970eaac8535e09efbbd8589a778..8a8f2ffdf7173a3e9ec2b75d84cfa4b2112fddc9 100644 --- a/bfps/cpp/rFFTW_particles.cpp +++ b/bfps/cpp/rFFTW_particles.cpp @@ -42,7 +42,6 @@ extern int myrank, nprocs; template <int particle_type, class rnumber, int interp_neighbours> rFFTW_particles<particle_type, rnumber, interp_neighbours>::rFFTW_particles( const char *NAME, - fluid_solver_base<rnumber> *FSOLVER, rFFTW_interpolator<rnumber, interp_neighbours> *FIELD, const int NPARTICLES, const int TRAJ_SKIP, @@ -60,7 +59,6 @@ rFFTW_particles<particle_type, rnumber, interp_neighbours>::rFFTW_particles( assert((INTEGRATION_STEPS <= 6) && (INTEGRATION_STEPS >= 1)); strncpy(this->name, NAME, 256); - this->fs = FSOLVER; this->nparticles = NPARTICLES; this->vel = FIELD; this->integration_steps = INTEGRATION_STEPS; @@ -76,35 +74,6 @@ rFFTW_particles<particle_type, rnumber, interp_neighbours>::rFFTW_particles( this->rhs[i] = new double[this->array_size]; std::fill_n(this->rhs[i], this->array_size, 0.0); } - - // compute dx, dy, dz; - this->dx = 4*acos(0) / (this->fs->dkx*this->fs->rd->sizes[2]); - this->dy = 4*acos(0) / (this->fs->dky*this->fs->rd->sizes[1]); - this->dz = 4*acos(0) / (this->fs->dkz*this->fs->rd->sizes[0]); - - // compute lower and upper bounds - this->lbound = new double[nprocs]; - this->ubound = new double[nprocs]; - double *tbound = new double[nprocs]; - std::fill_n(tbound, nprocs, 0.0); - tbound[this->myrank] = this->fs->rd->starts[0]*this->dz; - MPI_Allreduce( - tbound, - this->lbound, - nprocs, - MPI_DOUBLE, - MPI_SUM, - this->comm); - std::fill_n(tbound, nprocs, 0.0); - tbound[this->myrank] = (this->fs->rd->starts[0] + this->fs->rd->subsizes[0])*this->dz; - MPI_Allreduce( - tbound, - this->ubound, - nprocs, - MPI_DOUBLE, - MPI_SUM, - this->comm); - delete[] tbound; } template <int particle_type, class rnumber, int interp_neighbours> @@ -115,8 +84,6 @@ rFFTW_particles<particle_type, rnumber, interp_neighbours>::~rFFTW_particles() { delete[] this->rhs[i]; } - delete[] this->lbound; - delete[] this->ubound; } template <int particle_type, class rnumber, int interp_neighbours> diff --git a/bfps/cpp/rFFTW_particles.hpp b/bfps/cpp/rFFTW_particles.hpp index 41581f841609baf2078958217782bc1ead47b99a..e2ba8a87b63d7463f021e0ab991f97f161fac4c3 100644 --- a/bfps/cpp/rFFTW_particles.hpp +++ b/bfps/cpp/rFFTW_particles.hpp @@ -43,7 +43,6 @@ class rFFTW_particles public: int myrank, nprocs; MPI_Comm comm; - fluid_solver_base<rnumber> *fs; rnumber *data; /* state will generally hold all the information about the particles. @@ -57,8 +56,6 @@ class rFFTW_particles int array_size; int integration_steps; int traj_skip; - double *lbound; - double *ubound; rFFTW_interpolator<rnumber, interp_neighbours> *vel; /* simulation parameters */ @@ -66,21 +63,15 @@ class rFFTW_particles int iteration; double dt; - /* physical parameters of field */ - double dx, dy, dz; - /* methods */ /* constructor and destructor. * allocate and deallocate: * this->state * this->rhs - * this->lbound - * this->ubound * */ rFFTW_particles( const char *NAME, - fluid_solver_base<rnumber> *FSOLVER, rFFTW_interpolator<rnumber, interp_neighbours> *FIELD, const int NPARTICLES, const int TRAJ_SKIP,