From f4b822b7eb52562fbc05be35f218185790fe4e13 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:46:52 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/simulation.hpp | 79 +++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/src/simulation.hpp b/src/simulation.hpp index 8e0f4bbf7..0739f5ec6 100644 --- a/src/simulation.hpp +++ b/src/simulation.hpp @@ -338,9 +338,9 @@ template class AMRSimulation : public amrex::AmrCore // tracer particles #ifdef AMREX_PARTICLES - void InitParticles(); // create tracer particles - int do_tracers = 0; - std::unique_ptr TracerPC; + void InitParticles(); // create tracer particles + int do_tracers = 0; + std::unique_ptr TracerPC; #endif // external objects @@ -576,9 +576,9 @@ template void AMRSimulation::setInitialCondition AverageDown(); #ifdef AMREX_PARTICLES - if (do_tracers) { - InitParticles(); - } + if (do_tracers) { + InitParticles(); + } #endif if (checkpointInterval_ > 0) { @@ -991,9 +991,9 @@ template auto AMRSimulation::timeStepWithSubcycl #ifdef AMREX_PARTICLES // redistribute particles - if (do_tracers) { - TracerPC->Redistribute(lev); - } + if (do_tracers) { + TracerPC->Redistribute(lev); + } #endif // do fix-up on all levels that have been re-gridded @@ -1121,17 +1121,17 @@ template auto AMRSimulation::timeStepWithSubcycl #ifdef AMREX_PARTICLES // redistribute particles - if (do_tracers) { - int redistribute_ngrow = 0; - if ((iteration < nsubsteps[lev]) || (lev == 0)){ - if (lev == 0){ - redistribute_ngrow = 0; - } else { - redistribute_ngrow = iteration; - } - TracerPC->Redistribute(lev, TracerPC->finestLevel(), redistribute_ngrow); - } - } + if (do_tracers) { + int redistribute_ngrow = 0; + if ((iteration < nsubsteps[lev]) || (lev == 0)) { + if (lev == 0) { + redistribute_ngrow = 0; + } else { + redistribute_ngrow = iteration; + } + TracerPC->Redistribute(lev, TracerPC->finestLevel(), redistribute_ngrow); + } + } #endif return stepsLeft; @@ -1680,17 +1680,16 @@ template void AMRSimulation::AverageDownTo(int c #ifdef AMREX_PARTICLES template void AMRSimulation::InitParticles() { - if (do_tracers) - { - AMREX_ASSERT(TracerPC == nullptr); - TracerPC = std::make_unique(this); + if (do_tracers) { + AMREX_ASSERT(TracerPC == nullptr); + TracerPC = std::make_unique(this); - AmrTracerParticleContainer::ParticleInitData pdata = {{AMREX_D_DECL(0.0, 0.0, 0.0)},{},{},{}}; + AmrTracerParticleContainer::ParticleInitData pdata = {{AMREX_D_DECL(0.0, 0.0, 0.0)}, {}, {}, {}}; - TracerPC->SetVerbose(0); - TracerPC->InitOnePerCell(0.5, 0.5, 0.5, pdata); - TracerPC->Redistribute(); - } + TracerPC->SetVerbose(0); + TracerPC->InitOnePerCell(0.5, 0.5, 0.5, pdata); + TracerPC->Redistribute(); + } } #endif @@ -1914,9 +1913,9 @@ template void AMRSimulation::WritePlotFile() WriteMetadataFile(plotfilename + "/metadata.yaml"); #ifdef AMREX_PARTICLES // write particles - if (do_tracers) { - TracerPC->WritePlotFile(plotfilename, "particles"); - } + if (do_tracers) { + TracerPC->WritePlotFile(plotfilename, "particles"); + } #endif // AMREX_PARTICLES #endif } @@ -2241,9 +2240,9 @@ template void AMRSimulation::WriteCheckpointFile // write particle data #ifdef AMREX_PARTICLES - if (do_tracers) { - TracerPC->Checkpoint(checkpointname, "particles", true); - } + if (do_tracers) { + TracerPC->Checkpoint(checkpointname, "particles", true); + } #endif // create symlink and point it at this checkpoint dir @@ -2402,11 +2401,11 @@ template void AMRSimulation::ReadCheckpointFile( #ifdef AMREX_PARTICLES // read particle data - if (do_tracers) { - AMREX_ASSERT(TracerPC == nullptr); - TracerPC = std::make_unique(this); - TracerPC->Restart(restart_chkfile, "particles"); - } + if (do_tracers) { + AMREX_ASSERT(TracerPC == nullptr); + TracerPC = std::make_unique(this); + TracerPC->Restart(restart_chkfile, "particles"); + } #endif areInitialConditionsDefined_ = true;