Skip to content
Snippets Groups Projects
Commit 6922eeb5 authored by Chichi Lalescu's avatar Chichi Lalescu
Browse files

remove unneeded member data

parent 21967cce
No related branches found
No related tags found
No related merge requests found
...@@ -450,7 +450,7 @@ class NavierStokes(bfps.fluid_base.fluid_particle_base): ...@@ -450,7 +450,7 @@ class NavierStokes(bfps.fluid_base.fluid_particle_base):
double *velocity = new double[ps{0}->array_size]; double *velocity = new double[ps{0}->array_size];
ps{0}->sample_vec_field(vel_{1}, velocity); ps{0}->sample_vec_field(vel_{1}, velocity);
ps{0}->sample_vec_field(acc_{1}, acceleration); ps{0}->sample_vec_field(acc_{1}, acceleration);
if (ps{0}->fs->rd->myrank == 0) if (ps{0}->myrank == 0)
{{ {{
//VELOCITY begin //VELOCITY begin
std::string temp_string = (std::string("/particles/") + std::string temp_string = (std::string("/particles/") +
...@@ -512,7 +512,7 @@ class NavierStokes(bfps.fluid_base.fluid_particle_base): ...@@ -512,7 +512,7 @@ class NavierStokes(bfps.fluid_base.fluid_particle_base):
neighbours, neighbours,
self.particle_species) self.particle_species)
self.particle_start += ('ps{0} = new rFFTW_particles<VELOCITY_TRACER, {1}, {2}>(\n' + self.particle_start += ('ps{0} = new rFFTW_particles<VELOCITY_TRACER, {1}, {2}>(\n' +
'fname, fs, vel_{3},\n' + 'fname, vel_{3},\n' +
'nparticles,\n' + 'nparticles,\n' +
'niter_part, tracers{0}_integration_steps);\n').format( 'niter_part, tracers{0}_integration_steps);\n').format(
self.particle_species, self.C_dtype, neighbours, fields_name) self.particle_species, self.C_dtype, neighbours, fields_name)
... ...
......
...@@ -42,7 +42,6 @@ extern int myrank, nprocs; ...@@ -42,7 +42,6 @@ extern int myrank, nprocs;
template <int particle_type, class rnumber, int interp_neighbours> template <int particle_type, class rnumber, int interp_neighbours>
rFFTW_particles<particle_type, rnumber, interp_neighbours>::rFFTW_particles( rFFTW_particles<particle_type, rnumber, interp_neighbours>::rFFTW_particles(
const char *NAME, const char *NAME,
fluid_solver_base<rnumber> *FSOLVER,
rFFTW_interpolator<rnumber, interp_neighbours> *FIELD, rFFTW_interpolator<rnumber, interp_neighbours> *FIELD,
const int NPARTICLES, const int NPARTICLES,
const int TRAJ_SKIP, const int TRAJ_SKIP,
...@@ -60,7 +59,6 @@ rFFTW_particles<particle_type, rnumber, interp_neighbours>::rFFTW_particles( ...@@ -60,7 +59,6 @@ rFFTW_particles<particle_type, rnumber, interp_neighbours>::rFFTW_particles(
assert((INTEGRATION_STEPS <= 6) && assert((INTEGRATION_STEPS <= 6) &&
(INTEGRATION_STEPS >= 1)); (INTEGRATION_STEPS >= 1));
strncpy(this->name, NAME, 256); strncpy(this->name, NAME, 256);
this->fs = FSOLVER;
this->nparticles = NPARTICLES; this->nparticles = NPARTICLES;
this->vel = FIELD; this->vel = FIELD;
this->integration_steps = INTEGRATION_STEPS; this->integration_steps = INTEGRATION_STEPS;
...@@ -76,35 +74,6 @@ rFFTW_particles<particle_type, rnumber, interp_neighbours>::rFFTW_particles( ...@@ -76,35 +74,6 @@ rFFTW_particles<particle_type, rnumber, interp_neighbours>::rFFTW_particles(
this->rhs[i] = new double[this->array_size]; this->rhs[i] = new double[this->array_size];
std::fill_n(this->rhs[i], this->array_size, 0.0); 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> template <int particle_type, class rnumber, int interp_neighbours>
...@@ -115,8 +84,6 @@ rFFTW_particles<particle_type, rnumber, interp_neighbours>::~rFFTW_particles() ...@@ -115,8 +84,6 @@ rFFTW_particles<particle_type, rnumber, interp_neighbours>::~rFFTW_particles()
{ {
delete[] this->rhs[i]; delete[] this->rhs[i];
} }
delete[] this->lbound;
delete[] this->ubound;
} }
template <int particle_type, class rnumber, int interp_neighbours> template <int particle_type, class rnumber, int interp_neighbours>
... ...
......
...@@ -43,7 +43,6 @@ class rFFTW_particles ...@@ -43,7 +43,6 @@ class rFFTW_particles
public: public:
int myrank, nprocs; int myrank, nprocs;
MPI_Comm comm; MPI_Comm comm;
fluid_solver_base<rnumber> *fs;
rnumber *data; rnumber *data;
/* state will generally hold all the information about the particles. /* state will generally hold all the information about the particles.
...@@ -57,8 +56,6 @@ class rFFTW_particles ...@@ -57,8 +56,6 @@ class rFFTW_particles
int array_size; int array_size;
int integration_steps; int integration_steps;
int traj_skip; int traj_skip;
double *lbound;
double *ubound;
rFFTW_interpolator<rnumber, interp_neighbours> *vel; rFFTW_interpolator<rnumber, interp_neighbours> *vel;
/* simulation parameters */ /* simulation parameters */
...@@ -66,21 +63,15 @@ class rFFTW_particles ...@@ -66,21 +63,15 @@ class rFFTW_particles
int iteration; int iteration;
double dt; double dt;
/* physical parameters of field */
double dx, dy, dz;
/* methods */ /* methods */
/* constructor and destructor. /* constructor and destructor.
* allocate and deallocate: * allocate and deallocate:
* this->state * this->state
* this->rhs * this->rhs
* this->lbound
* this->ubound
* */ * */
rFFTW_particles( rFFTW_particles(
const char *NAME, const char *NAME,
fluid_solver_base<rnumber> *FSOLVER,
rFFTW_interpolator<rnumber, interp_neighbours> *FIELD, rFFTW_interpolator<rnumber, interp_neighbours> *FIELD,
const int NPARTICLES, const int NPARTICLES,
const int TRAJ_SKIP, const int TRAJ_SKIP,
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment