Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable tracer particles at run time #156

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions Source/NS_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,20 @@ NavierStokes::variableSetUp ()
derive_lst.addComponent("avg_pressure",desc_lst,Press_Type,Pressure,1);

#ifdef AMREX_PARTICLES
//
// The particle count at this level.
//
derive_lst.add("particle_count",IndexType::TheCellType(),1,
dernull,the_same_box);
derive_lst.addComponent("particle_count",desc_lst,State_Type,Density,1);
//
// The total # of particles at our level or above.
//
derive_lst.add("total_particle_count",IndexType::TheCellType(),1,
dernull,the_same_box);
derive_lst.addComponent("total_particle_count",desc_lst,State_Type,Density,1);
if (do_nspc) {
//
// The particle count at this level.
//
derive_lst.add("particle_count",IndexType::TheCellType(),1,
dernull,the_same_box);
derive_lst.addComponent("particle_count",desc_lst,State_Type,Density,1);
//
// The total # of particles at our level or above.
//
derive_lst.add("total_particle_count",IndexType::TheCellType(),1,
dernull,the_same_box);
derive_lst.addComponent("total_particle_count",desc_lst,State_Type,Density,1);
}
#endif

//
Expand Down
4 changes: 3 additions & 1 deletion Source/NavierStokes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,9 @@ NavierStokes::initData ()
}

#ifdef AMREX_PARTICLES
initParticleData ();
if (do_nspc) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this if you've added if (!do_nspc) { return; } in NSB::initParticleData? I suppose it doesn't really matter though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. It does not matter.

initParticleData ();
}
#endif
}

Expand Down
4 changes: 3 additions & 1 deletion Source/NavierStokesBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ NavierStokesBase::advance_setup (Real /*time*/,
umac_n_grow = 1;

#ifdef AMREX_PARTICLES
if (ncycle > umac_n_grow) {
if (ncycle > umac_n_grow && NSPC) {
umac_n_grow = ncycle;
}
#endif
Expand Down Expand Up @@ -3813,6 +3813,8 @@ NavierStokesBase::read_particle_params ()
void
NavierStokesBase::initParticleData ()
{
if (!do_nspc) { return; }

if (level == 0)
{
if (NSPC == 0)
Expand Down
Loading