Skip to content

Commit

Permalink
removing flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Hughes committed Nov 8, 2024
1 parent 58d29e7 commit 1355ea0
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion include/Particles.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class Particles : public ManagedAllocation {
};

CUDA_CALLABLE_MEMBER
Particles(std::size_t nP,std::size_t nStreams,libconfig::Config &cfg, Flags *gitr_flags) :
Particles(std::size_t nP,std::size_t nStreams,libconfig::Config &cfg) :
nParticles{getVariable_cfg<unsigned int> (cfg,"impurityParticleSource.nP")},
index{nParticles, 0},
x{nP,0.0},
Expand Down
3 changes: 1 addition & 2 deletions include/particle_diagnostics.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ typedef float gitr_precision;


struct particle_diagnostics {
Flags *flags;
Particles *particlesPointer;
Boundary *boundaryVector;
bool times_logarithmic;
Expand All @@ -46,7 +45,7 @@ struct particle_diagnostics {
gitr_precision *particle_angle_histogram;
int nSurfaces;

particle_diagnostics(Flags *_flags, Particles *_particlesPointer, Boundary *_boundaryVector, bool _time_logarithmic,
particle_diagnostics(Particles *_particlesPointer, Boundary *_boundaryVector, bool _time_logarithmic,
gitr_precision _bin_edge_0_time, gitr_precision _bin_edge_1_time, gitr_precision _bin_edge_dt,
int _n_bins_time, gitr_precision *_particle_time_histogram, bool _angle_logarithmic,
gitr_precision _bin_edge_0_angle, gitr_precision _bin_edge_1_angle, gitr_precision _bin_edge_dtheta,
Expand Down
6 changes: 3 additions & 3 deletions src/atomic_data_broker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ std::vector< double > atomic_data_broker::run_2()

int nParticles = getVariable_cfg<int> (cfg,"impurityParticleSource.nP");

auto particleArray = new Particles(nParticles,nParticles,cfg,gitr_flags);
auto particleArray = new Particles(nParticles,nParticles,cfg);

thrust::counting_iterator<std::size_t> particle_iterator0(0);
thrust::counting_iterator<std::size_t> particle_iterator_end(nParticles);
Expand Down Expand Up @@ -216,7 +216,7 @@ void atomic_data_broker::run_1()

auto gitr_flags = new Flags(cfg);

auto particleArray = new Particles(nParticles,nParticles,cfg,gitr_flags);
auto particleArray = new Particles(nParticles,nParticles,cfg);
#ifdef __CUDACC__
typedef curandState rand_type;
#else
Expand Down Expand Up @@ -395,7 +395,7 @@ void atomic_data_broker::run()

auto gitr_flags = new Flags(cfg);

auto particleArray = new Particles(nParticles,nParticles,cfg,gitr_flags);
auto particleArray = new Particles(nParticles,nParticles,cfg);

#ifdef __CUDACC__
typedef curandState rand_type;
Expand Down
2 changes: 1 addition & 1 deletion src/boris_data_broker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ std::vector< double > boris_data_broker_0::run_1()

// create a particle
auto particleArray =
new Particles( num_particles, deprecated_constructor_argument, cfg_geom, gitr_flags );
new Particles( num_particles, deprecated_constructor_argument, cfg_geom );

thrust::counting_iterator<std::size_t> particle_iterator_start(0);

Expand Down
4 changes: 2 additions & 2 deletions src/coulomb_data_broker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ double coulomb_data_broker::run_3()

int nParticles = getVariable_cfg<int> (cfg,"impurityParticleSource.nP");
int seed01 = getVariable_cfg<int> (cfg,"operators.ionization.seed");
auto particleArray = new Particles(nParticles,nParticles,cfg,gitr_flags);
auto particleArray = new Particles(nParticles,nParticles,cfg);

for(int i=0; i<nParticles; i++) particleArray->vz[i] = 4580.0;

Expand Down Expand Up @@ -269,7 +269,7 @@ double coulomb_data_broker::run_2()

int nParticles = getVariable_cfg<int> (cfg,"impurityParticleSource.nP");

auto particleArray = new Particles(nParticles,nParticles,cfg,gitr_flags);
auto particleArray = new Particles(nParticles,nParticles,cfg);

thrust::counting_iterator<std::size_t> particle_iterator0(0);
thrust::counting_iterator<std::size_t> particle_iterator_end(nParticles);
Expand Down
4 changes: 2 additions & 2 deletions src/cross_field_diffusion_broker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ double cross_field_diffusion_broker::run_1()

int nSurfaces = importGeometry( cfg_geom, boundaries, use_3d_geom, cylsymm, surface_potential );

auto particleArray = new Particles( nP, 1, cfg_geom, gitr_flags );
auto particleArray = new Particles( nP, 1, cfg_geom);
for(int i=0;i<nP;i++)
{
particleArray->setParticleV(i,0.2,0.0,0.0, 10, 10, 10, 4, 5, 1.0,dt);
Expand Down Expand Up @@ -299,7 +299,7 @@ double cross_field_diffusion_broker::run()

//REQUIRE( nSurfaces == 2 );

auto particleArray = new Particles( nP, 1, cfg_geom, gitr_flags );
auto particleArray = new Particles( nP, 1, cfg_geom);
std::cout << "p " << particleArray->charge[0] << " x " << particleArray->xprevious[0]<<std::endl;

/* dummy variables for hashing */
Expand Down
8 changes: 4 additions & 4 deletions src/gitr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1333,8 +1333,8 @@ if( GENERATE_LC > 0 )
std::cout << "Creating tracer particles" << std::endl;
thrust::counting_iterator<std::size_t> lcBegin(pair.first);
thrust::counting_iterator<std::size_t> lcEnd(pair.second - 1);
auto forwardTracerParticles = new Particles(nTracers, 1, cfg, gitr_flags );
auto backwardTracerParticles = new Particles(nTracers, 1, cfg, gitr_flags );
auto forwardTracerParticles = new Particles(nTracers, 1, cfg);
auto backwardTracerParticles = new Particles(nTracers, 1, cfg);
int addIndex = 0;
std::cout << "Initializing tracer particles" << std::endl;

Expand Down Expand Up @@ -3215,7 +3215,7 @@ if( efield_interp == 1 )
std::cout << "World rank " << world_rank << " has " << nPPerRank[world_rank]
<< " starting at " << pStartIndx[world_rank]
<< " ending at " << pStartIndx[world_rank]+nPPerRank[world_rank] << std::endl;
auto particleArray = new Particles(nParticles,1,cfg,gitr_flags);
auto particleArray = new Particles(nParticles,1,cfg);

gitr_precision x, y, z, E, vtotal, vx, vy, vz, Ex, Ey, Ez, amu, Z, charge, phi, theta,
Ex_prime, Ez_prime, theta_transform;
Expand Down Expand Up @@ -3986,7 +3986,7 @@ if( efield_interp == 1 )
sim::Array<gitr_precision> histogram_particle_angle(nSurfaces*n_bins_angle,0.0);

particle_diagnostics particle_diagnostics0(
gitr_flags, particleArray, &boundaries[0], times_logarithmic, bin_edge_0_time,
particleArray, &boundaries[0], times_logarithmic, bin_edge_0_time,
bin_edge_1_time, bin_edge_dt, n_bins_time, &histogram_particle_time.front(),
angle_logarithmic, bin_edge_0_angle, bin_edge_1_angle, bin_edge_dtheta,
n_bins_angle, &histogram_particle_angle.front(), nSurfaces);
Expand Down
4 changes: 2 additions & 2 deletions src/particle_diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "spectroscopy.h"


particle_diagnostics::particle_diagnostics(Flags *_flags,
particle_diagnostics::particle_diagnostics(
Particles *_particlesPointer,
Boundary *_boundaryVector,
bool _times_logarithmic,
Expand All @@ -21,7 +21,7 @@ particle_diagnostics::particle_diagnostics(Flags *_flags,

:

flags(_flags), particlesPointer(_particlesPointer), boundaryVector(_boundaryVector), times_logarithmic(_times_logarithmic),
particlesPointer(_particlesPointer), boundaryVector(_boundaryVector), times_logarithmic(_times_logarithmic),
bin_edge_0_time(_bin_edge_0_time), bin_edge_1_time(_bin_edge_1_time), bin_edge_dt(_bin_edge_dt),
n_bins_time(_n_bins_time), particle_time_histogram(_particle_time_histogram), angle_logarithmic(_angle_logarithmic),
bin_edge_0_angle(_bin_edge_0_angle), bin_edge_1_angle(_bin_edge_1_angle), bin_edge_dtheta(_bin_edge_dtheta),
Expand Down
4 changes: 2 additions & 2 deletions test_src/boris_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ TEST_CASE( "Complex Boris Motion" )

/* create a particle */
auto particleArray =
new Particles( num_particles, deprecated_constructor_argument, cfg_geom, gitr_flags );
new Particles( num_particles, deprecated_constructor_argument, cfg_geom );

//thrust::counting_iterator<std::size_t> particle_iterator_start(0);

Expand Down Expand Up @@ -514,7 +514,7 @@ TEST_CASE( "Complex Boris Motion" )

/* create a particle */
auto particleArray =
new Particles( num_particles, deprecated_constructor_argument, cfg_geom, gitr_flags );
new Particles( num_particles, deprecated_constructor_argument, cfg_geom );

//thrust::counting_iterator<std::size_t> particle_iterator_start(0);

Expand Down

0 comments on commit 1355ea0

Please sign in to comment.