Skip to content

Commit

Permalink
Fix particles (#1422)
Browse files Browse the repository at this point in the history
* fix how we locate particles with terrain

* fix particle issue that caused crash with CUDA + DEBUG
  • Loading branch information
asalmgren authored Feb 2, 2024
1 parent 8d42c92 commit 8559185
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Source/ERF.H
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ private:

#ifdef ERF_USE_PARTICLES
// Particle container with all particle species
static ParticleData particleData;
ParticleData particleData;

// variables and functions for tracers particles
bool m_use_tracer_particles; /*!< tracer particles that advect with flow */
Expand Down
4 changes: 0 additions & 4 deletions Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ Vector<AMRErrorTag> ERF::ref_tags;

SolverChoice ERF::solverChoice;

#ifdef ERF_USE_PARTICLES
ParticleData ERF::particleData;
#endif

// Time step control
amrex::Real ERF::cfl = 0.8;
amrex::Real ERF::fixed_dt = -1.0;
Expand Down
4 changes: 2 additions & 2 deletions Source/Particles/ParticleData.H
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class ParticleData
}

/*! Write checkpoint files */
void Checkpoint ( const std::string& a_fname )
void Checkpoint ( const std::string& a_fname ) const
{
BL_PROFILE("ParticleData::Checkpoint()");
for (ParticlesNamesVector::size_type i = 0; i < m_namelist.size(); i++) {
auto name( m_namelist[i] );
auto particles( m_particle_species[name] );
auto particles( m_particle_species.at(name) );
particles->Checkpoint( a_fname, name, true, particles->varNames() );
}
}
Expand Down

0 comments on commit 8559185

Please sign in to comment.