Skip to content

Commit

Permalink
add back bool to check if any potentials are set
Browse files Browse the repository at this point in the history
  • Loading branch information
roelof-groenewald committed Sep 11, 2024
1 parent 3f6cf60 commit 60c1ff7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public:
return PhiCalculatorEB{t, potential_eb};
}

bool m_boundary_potential_specified = false;

// set default potentials to zero in order for current tests to pass
// but forcing the user to specify a potential might be better
std::string potential_xlo_str = "0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ void PoissonBoundaryHandler::ReadParameters()
const ParmParse pp_boundary("boundary");

// Read potentials from input file
pp_boundary.query("potential_lo_x", potential_xlo_str);
pp_boundary.query("potential_hi_x", potential_xhi_str);
pp_boundary.query("potential_lo_y", potential_ylo_str);
pp_boundary.query("potential_hi_y", potential_yhi_str);
pp_boundary.query("potential_lo_z", potential_zlo_str);
pp_boundary.query("potential_hi_z", potential_zhi_str);
m_boundary_potential_specified |= pp_boundary.query("potential_lo_x", potential_xlo_str);
m_boundary_potential_specified |= pp_boundary.query("potential_hi_x", potential_xhi_str);
m_boundary_potential_specified |= pp_boundary.query("potential_lo_y", potential_ylo_str);
m_boundary_potential_specified |= pp_boundary.query("potential_hi_y", potential_yhi_str);
m_boundary_potential_specified |= pp_boundary.query("potential_lo_z", potential_zlo_str);
m_boundary_potential_specified |= pp_boundary.query("potential_hi_z", potential_zhi_str);

const ParmParse pp_warpx("warpx");
pp_warpx.query("eb_potential(x,y,z,t)", potential_eb_str);
m_boundary_potential_specified |= pp_warpx.query("eb_potential(x,y,z,t)", potential_eb_str);
}

void PoissonBoundaryHandler::DefinePhiBCs (const amrex::Geometry& geom)
Expand Down
3 changes: 2 additions & 1 deletion Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ WarpX::WarpX ()
}

// Create Electrostatic Solver object if needed
if (WarpX::electrostatic_solver_id == ElectrostaticSolverAlgo::LabFrame)
if ((WarpX::electrostatic_solver_id == ElectrostaticSolverAlgo::LabFrame)
|| (WarpX::electrostatic_solver_id == ElectrostaticSolverAlgo::LabFrameElectroMagnetostatic))
{
std::unique_ptr<LabFrameExplicitES> labframe_explicit_es = std::make_unique<LabFrameExplicitES>(nlevs_max);
m_electrostatic_solver = std::move(labframe_explicit_es);
Expand Down

0 comments on commit 60c1ff7

Please sign in to comment.