From 7384c9642473f38da4cbb122fe16bb811ee788e9 Mon Sep 17 00:00:00 2001 From: roelof-groenewald Date: Wed, 6 Dec 2023 15:37:33 -0800 Subject: [PATCH] add afterBfieldpush callback --- .../HybridPICModel/HybridPICModel.cpp | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp b/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp index 08e4324ddfe..fd5aca815e7 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp @@ -8,6 +8,7 @@ */ #include "HybridPICModel.H" +#include "Python/callbacks.H" using namespace amrex; @@ -565,13 +566,13 @@ void HybridPICModel::CalculateEquilibCurrent ( } void HybridPICModel::BfieldEvolveRK ( - amrex::Vector, 3>>& Bfield, - amrex::Vector, 3>>& Efield, - amrex::Vector, 3>> const& Jfield, - amrex::Vector> const& rhofield, - amrex::Vector, 3>> const& edge_lengths, - amrex::Real const dt, DtType dt_type, - IntVect ng, std::optional nodal_sync ) + amrex::Vector, 3>>& Bfield, + amrex::Vector, 3>>& Efield, + amrex::Vector, 3>> const& Jfield, + amrex::Vector> const& rhofield, + amrex::Vector, 3>> const& edge_lengths, + amrex::Real const dt, DtType dt_type, + IntVect ng, std::optional nodal_sync ) { auto& warpx = WarpX::GetInstance(); for (int lev = 0; lev <= warpx.finestLevel(); ++lev) @@ -584,13 +585,13 @@ void HybridPICModel::BfieldEvolveRK ( } void HybridPICModel::BfieldEvolveRK ( - amrex::Vector, 3>>& Bfield, - amrex::Vector, 3>>& Efield, - amrex::Vector, 3>> const& Jfield, - amrex::Vector> const& rhofield, - amrex::Vector, 3>> const& edge_lengths, - amrex::Real const dt, int lev, DtType dt_type, - IntVect ng, std::optional nodal_sync ) + amrex::Vector, 3>>& Bfield, + amrex::Vector, 3>>& Efield, + amrex::Vector, 3>> const& Jfield, + amrex::Vector> const& rhofield, + amrex::Vector, 3>> const& edge_lengths, + amrex::Real const dt, int lev, DtType dt_type, + IntVect ng, std::optional nodal_sync ) { // Make copies of the B-field multifabs at t = n and create multifabs for // each direction to store the Runge-Kutta intermediate terms. Each @@ -697,13 +698,13 @@ void HybridPICModel::BfieldEvolveRK ( } void HybridPICModel::BfieldPush ( - amrex::Vector, 3>>& Bfield, - amrex::Vector, 3>>& Efield, - amrex::Vector, 3>> const& Jfield, - amrex::Vector> const& rhofield, - amrex::Vector, 3>> const& edge_lengths, - amrex::Real const dt, DtType dt_type, - IntVect ng, std::optional nodal_sync ) + amrex::Vector, 3>>& Bfield, + amrex::Vector, 3>>& Efield, + amrex::Vector, 3>> const& Jfield, + amrex::Vector> const& rhofield, + amrex::Vector, 3>> const& edge_lengths, + amrex::Real const dt, DtType dt_type, + IntVect ng, std::optional nodal_sync ) { auto& warpx = WarpX::GetInstance(); @@ -715,4 +716,6 @@ void HybridPICModel::BfieldPush ( // Push forward the B-field using Faraday's law warpx.EvolveB(dt, dt_type); warpx.FillBoundaryB(ng, nodal_sync); + + ExecutePythonCallback("afterBfieldpush"); }