Skip to content

Commit

Permalink
removed useless class member pointers Jx_, etc. in 1D, could be done…
Browse files Browse the repository at this point in the history
… in 2D and 3D as well
  • Loading branch information
charlesprouveur committed Aug 8, 2024
1 parent f2b7bf1 commit 3e775f0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Projector/Projector1D.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Projector1D : public Projector
double dx_inv_;
double dx_ov_dt_;
int i_domain_begin_;
double *Jx_, *Jy_, *Jz_, *rho_;
//double *Jx_, *Jy_, *Jz_, *rho_;
};

#endif
Expand Down
12 changes: 6 additions & 6 deletions src/Projector/Projector1D2Order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,20 +315,20 @@ void Projector1D2Order::currentsAndDensityWrapper( ElectroMagn *EMfields, Partic
std::vector<double> *delta = &( smpi->dynamics_deltaold[ithread] );
std::vector<double> *invgf = &( smpi->dynamics_invgf[ithread] );

Jx_ = &( *EMfields->Jx_ )( 0 );
Jy_ = &( *EMfields->Jy_ )( 0 );
Jz_ = &( *EMfields->Jz_ )( 0 );
rho_ = &( *EMfields->rho_ )( 0 );
double *Jx = &( *EMfields->Jx_ )( 0 );
double *Jy = &( *EMfields->Jy_ )( 0 );
double *Jz = &( *EMfields->Jz_ )( 0 );
double *rho = &( *EMfields->rho_ )( 0 );

// If no field diagnostics this timestep, then the projection is done directly on the total arrays
if( !diag_flag ) {
if( !is_spectral ) {
for( int ipart=istart ; ipart<iend; ipart++ ) {
currents( Jx_, Jy_, Jz_, particles, ipart, ( *invgf )[ipart], &( *iold )[ipart], &( *delta )[ipart] );
currents( Jx, Jy, Jz, particles, ipart, ( *invgf )[ipart], &( *iold )[ipart], &( *delta )[ipart] );
}
} else {
for( int ipart=istart ; ipart<iend; ipart++ ) {
currentsAndDensity( Jx_, Jy_, Jz_, rho_, particles, ipart, ( *invgf )[ipart], &( *iold )[ipart], &( *delta )[ipart] );
currentsAndDensity( Jx, Jy, Jz, rho, particles, ipart, ( *invgf )[ipart], &( *iold )[ipart], &( *delta )[ipart] );
}
}
// Otherwise, the projection may apply to the species-specific arrays
Expand Down
12 changes: 6 additions & 6 deletions src/Projector/Projector1D4Order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,20 +361,20 @@ void Projector1D4Order::currentsAndDensityWrapper( ElectroMagn *EMfields, Partic
std::vector<double> *delta = &( smpi->dynamics_deltaold[ithread] );
std::vector<double> *invgf = &( smpi->dynamics_invgf[ithread] );

Jx_ = &( *EMfields->Jx_ )( 0 );
Jy_ = &( *EMfields->Jy_ )( 0 );
Jz_ = &( *EMfields->Jz_ )( 0 );
rho_ = &( *EMfields->rho_ )( 0 );
double *Jx = &( *EMfields->Jx_ )( 0 );
double *Jy = &( *EMfields->Jy_ )( 0 );
double *Jz = &( *EMfields->Jz_ )( 0 );
double *rho = &( *EMfields->rho_ )( 0 );

// If no field diagnostics this timestep, then the projection is done directly on the total arrays
if( !diag_flag ) {
if( !is_spectral ) {
for( int ipart=istart ; ipart<iend; ipart++ ) {
currents( Jx_, Jy_, Jz_, particles, ipart, ( *invgf )[ipart], &( *iold )[ipart], &( *delta )[ipart] );
currents( Jx, Jy, Jz, particles, ipart, ( *invgf )[ipart], &( *iold )[ipart], &( *delta )[ipart] );
}
} else {
for( int ipart=istart ; ipart<iend; ipart++ ) {
currentsAndDensity( Jx_, Jy_, Jz_, rho_, particles, ipart, ( *invgf )[ipart], &( *iold )[ipart], &( *delta )[ipart] );
currentsAndDensity( Jx, Jy, Jz, rho, particles, ipart, ( *invgf )[ipart], &( *iold )[ipart], &( *delta )[ipart] );
}
}
// Otherwise, the projection may apply to the species-specific arrays
Expand Down

0 comments on commit 3e775f0

Please sign in to comment.