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

WarpX class : current_centering_* variables no longer static #5641

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions Source/Initialization/WarpXInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,19 +424,19 @@ WarpX::PrintMainPICparameters ()
amrex::Print() << " | - field_centering_nox = " << WarpX::field_centering_nox << "\n";
amrex::Print() << " | - field_centering_noy = " << WarpX::field_centering_noy << "\n";
amrex::Print() << " | - field_centering_noz = " << WarpX::field_centering_noz << "\n";
amrex::Print() << " | - current_centering_nox = " << WarpX::current_centering_nox << "\n";
amrex::Print() << " | - current_centering_noy = " << WarpX::current_centering_noy << "\n";
amrex::Print() << " | - current_centering_noz = " << WarpX::current_centering_noz << "\n";
amrex::Print() << " | - current_centering_nox = " << m_current_centering_nox << "\n";
amrex::Print() << " | - current_centering_noy = " << m_current_centering_noy << "\n";
amrex::Print() << " | - current_centering_noz = " << m_current_centering_noz << "\n";
}
else if (dims=="2"){
amrex::Print() << " | - field_centering_nox = " << WarpX::field_centering_nox << "\n";
amrex::Print() << " | - field_centering_noz = " << WarpX::field_centering_noz << "\n";
amrex::Print() << " | - current_centering_nox = " << WarpX::current_centering_nox << "\n";
amrex::Print() << " | - current_centering_noz = " << WarpX::current_centering_noz << "\n";
amrex::Print() << " | - current_centering_nox = " << m_current_centering_nox << "\n";
amrex::Print() << " | - current_centering_noz = " << m_current_centering_noz << "\n";
}
else if (dims=="1"){
amrex::Print() << " | - field_centering_noz = " << WarpX::field_centering_noz << "\n";
amrex::Print() << " | - current_centering_noz = " << WarpX::current_centering_noz << "\n";
amrex::Print() << " | - current_centering_noz = " << m_current_centering_noz << "\n";
}
}
if (WarpX::use_hybrid_QED){
Expand Down
18 changes: 9 additions & 9 deletions Source/Parallelization/WarpXComm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,9 @@ void WarpX::UpdateCurrentNodalToStag (amrex::MultiFab& dst, amrex::MultiFab cons
amrex::Array4<amrex::Real> const& dst_arr = dst.array(mfi);

// Order of finite-order centering of currents
const int cc_nox = WarpX::current_centering_nox;
const int cc_noy = WarpX::current_centering_noy;
const int cc_noz = WarpX::current_centering_noz;
const int cc_nox = m_current_centering_nox;
const int cc_noy = m_current_centering_noy;
const int cc_noz = m_current_centering_noz;

// Device vectors of stencil coefficients used for finite-order centering of currents
amrex::Real const * stencil_coeffs_x = WarpX::device_current_centering_stencil_coeffs_x.data();
Expand Down Expand Up @@ -1406,14 +1406,14 @@ void WarpX::SumBoundaryJ (
if (do_current_centering)
{
#if defined(WARPX_DIM_1D_Z)
ng_depos_J[0] += WarpX::current_centering_noz / 2;
ng_depos_J[0] += m_current_centering_noz / 2;
#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
ng_depos_J[0] += WarpX::current_centering_nox / 2;
ng_depos_J[1] += WarpX::current_centering_noz / 2;
ng_depos_J[0] += m_current_centering_nox / 2;
ng_depos_J[1] += m_current_centering_noz / 2;
#elif defined(WARPX_DIM_3D)
ng_depos_J[0] += WarpX::current_centering_nox / 2;
ng_depos_J[1] += WarpX::current_centering_noy / 2;
ng_depos_J[2] += WarpX::current_centering_noz / 2;
ng_depos_J[0] += m_current_centering_nox / 2;
ng_depos_J[1] += m_current_centering_noy / 2;
ng_depos_J[2] += m_current_centering_noz / 2;
#endif
}

Expand Down
14 changes: 7 additions & 7 deletions Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,6 @@ public:
//! Order of finite centering of fields (from staggered grid to nodal grid), along z
static int field_centering_noz;

//! Order of finite centering of currents (from nodal grid to staggered grid), along x
static int current_centering_nox;
//! Order of finite centering of currents (from nodal grid to staggered grid), along y
static int current_centering_noy;
//! Order of finite centering of currents (from nodal grid to staggered grid), along z
static int current_centering_noz;

//! Number of modes for the RZ multi-mode version
static int n_rz_azimuthal_modes;
//! Number of MultiFab components
Expand Down Expand Up @@ -1379,6 +1372,13 @@ private:
std::unique_ptr<MultiParticleContainer> mypc;
std::unique_ptr<MultiDiagnostics> multi_diags;

//! Order of finite centering of currents (from nodal grid to staggered grid), along x
int m_current_centering_nox = 2;
//! Order of finite centering of currents (from nodal grid to staggered grid), along y
int m_current_centering_noy = 2;
//! Order of finite centering of currents (from nodal grid to staggered grid), along z
int m_current_centering_noz = 2;

// Fluid container
bool do_fluid_species = false;
std::unique_ptr<MultiFluidContainer> myfl;
Expand Down
23 changes: 9 additions & 14 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@ int WarpX::field_centering_nox = 2;
int WarpX::field_centering_noy = 2;
int WarpX::field_centering_noz = 2;

// Order of finite-order centering of currents (nodal to staggered)
int WarpX::current_centering_nox = 2;
int WarpX::current_centering_noy = 2;
int WarpX::current_centering_noz = 2;

bool WarpX::use_fdtd_nci_corr = false;
bool WarpX::galerkin_interpolation = true;

Expand Down Expand Up @@ -1036,9 +1031,9 @@ WarpX::ReadParameters ()
field_centering_noz = 8;
// Finite-order centering of currents (nodal to staggered)
do_current_centering = true;
current_centering_nox = 8;
current_centering_noy = 8;
current_centering_noz = 8;
m_current_centering_nox = 8;
m_current_centering_noy = 8;
m_current_centering_noz = 8;
}

#ifdef WARPX_DIM_RZ
Expand Down Expand Up @@ -1076,18 +1071,18 @@ WarpX::ReadParameters ()
"warpx.do_current_centering=1 can be used only with warpx.grid_type=hybrid");

utils::parser::queryWithParser(
pp_warpx, "current_centering_nox", current_centering_nox);
pp_warpx, "current_centering_nox", m_current_centering_nox);
utils::parser::queryWithParser(
pp_warpx, "current_centering_noy", current_centering_noy);
pp_warpx, "current_centering_noy", m_current_centering_noy);
utils::parser::queryWithParser(
pp_warpx, "current_centering_noz", current_centering_noz);
pp_warpx, "current_centering_noz", m_current_centering_noz);

AllocateCenteringCoefficients(device_current_centering_stencil_coeffs_x,
device_current_centering_stencil_coeffs_y,
device_current_centering_stencil_coeffs_z,
current_centering_nox,
current_centering_noy,
current_centering_noz,
m_current_centering_nox,
m_current_centering_noy,
m_current_centering_noz,
grid_type);
}

Expand Down
Loading