Skip to content
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
19 changes: 7 additions & 12 deletions src/include/psc.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,6 @@ struct Psc
prof_stop(pr_collision);
}

// === particle injection
prof_start(pr_inject_prts);
inject_particles();
prof_stop(pr_inject_prts);

if (checks_.continuity.should_do_check(timestep)) {
mpi_printf(comm, "***** Checking continuity...\n");
prof_start(pr_checks);
Expand All @@ -503,6 +498,11 @@ struct Psc
prof_stop(pr_push_prts);
// state is now: x^{n+3/2}, p^{n+1}, E^{n+1/2}, B^{n+1/2}, j^{n+1}

// === particle injection
prof_start(pr_inject_prts);
inject_particles_(mprts_, mflds_);
prof_stop(pr_inject_prts);

// === field propagation B^{n+1/2} -> B^{n+1}
mpi_printf(comm, "***** Pushing B...\n");
prof_start(pr_push_flds);
Expand Down Expand Up @@ -591,11 +591,6 @@ struct Psc
#endif
}

// ----------------------------------------------------------------------
// inject_particles

void inject_particles() { return this->inject_particles_(grid(), mprts_); }

private:
// ----------------------------------------------------------------------
// print_profiling
Expand Down Expand Up @@ -753,8 +748,8 @@ protected:
class InjectParticlesNone
{
public:
template <typename Mparticles>
void operator()(const Grid_t& grid, Mparticles& mprts)
template <typename Mparticles, typename MfieldsState>
void operator()(Mparticles& mprts, MfieldsState& mflds)
{}
};

Expand Down
4 changes: 3 additions & 1 deletion src/psc_2d_shock.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,9 @@ void run()
double inject_fac = (g.inject_interval * grid.dt / inject_tau) /
(1. + g.inject_interval * grid.dt / inject_tau);

auto lf_inject_heat = [&](const Grid_t& grid, Mparticles& mprts) {
auto lf_inject_heat = [&](Mparticles& mprts, MfieldsState& mflds) {
const Grid_t& grid = mprts.grid();

static int pr_inject, pr_heating;
if (!pr_inject) {
pr_inject = prof_register("inject", 1., 0, 0);
Expand Down
4 changes: 3 additions & 1 deletion src/psc_flatfoil_yz.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,9 @@ void run()
double inject_fac = (g.inject_interval * grid.dt / inject_tau) /
(1. + g.inject_interval * grid.dt / inject_tau);

auto lf_inject_heat = [&](const Grid_t& grid, Mparticles& mprts) {
auto lf_inject_heat = [&](Mparticles& mprts, MfieldsState& mflds) {
const Grid_t& grid = mprts.grid();

static int pr_inject, pr_heating;
if (!pr_inject) {
pr_inject = prof_register("inject", 1., 0, 0);
Expand Down