Skip to content

Commit

Permalink
isAnyThermal as static fctn is warpx class, instead of particle bound…
Browse files Browse the repository at this point in the history
…aries struct
  • Loading branch information
RevathiJambunathan committed Mar 20, 2024
1 parent 624da25 commit 93f8ae6
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
6 changes: 4 additions & 2 deletions Source/BoundaryConditions/WarpXFieldBoundaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ void WarpX::ApplyBfieldBoundary (const int lev, PatchType patch_type, DtType a_d
void WarpX::ApplyRhofieldBoundary (const int lev, MultiFab* rho,
PatchType patch_type)
{
if (PEC::isAnyParticleBoundaryReflecting() || PEC::isAnyBoundaryPEC()) {
if (PEC::isAnyParticleBoundaryReflecting() || WarpX::isAnyParticleBoundaryThermal() || PEC::isAnyBoundaryPEC())
{
PEC::ApplyReflectiveBoundarytoRhofield(rho, lev, patch_type);
}
}
Expand All @@ -115,7 +116,8 @@ void WarpX::ApplyJfieldBoundary (const int lev, amrex::MultiFab* Jx,
amrex::MultiFab* Jy, amrex::MultiFab* Jz,
PatchType patch_type)
{
if (PEC::isAnyParticleBoundaryReflecting() || PEC::isAnyBoundaryPEC()) {
if (PEC::isAnyParticleBoundaryReflecting() || WarpX::isAnyParticleBoundaryThermal() || PEC::isAnyBoundaryPEC())
{
PEC::ApplyReflectiveBoundarytoJfield(Jx, Jy, Jz, lev, patch_type);
}
}
Expand Down
3 changes: 0 additions & 3 deletions Source/Particles/ParticleBoundaries.H
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ struct ParticleBoundaries

void BuildReflectionModelParsers ();

/** True if any of the particle boundary condition type is Thermal */
bool isAnyParticleBoundaryThermal ();

// reflection models for absorbing boundaries
std::string reflection_model_xlo_str = "0.0";
std::string reflection_model_xhi_str = "0.0";
Expand Down
10 changes: 0 additions & 10 deletions Source/Particles/ParticleBoundaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,3 @@ ParticleBoundaries::BuildReflectionModelParsers ()
utils::parser::makeParser(reflection_model_zhi_str, {"v"}));
data.reflection_model_zhi = reflection_model_zhi_parser->compile<1>();
}

bool
ParticleBoundaries::isAnyParticleBoundaryThermal ()
{
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
if (WarpX::particle_boundary_lo[idim] == ParticleBoundaryType::Thermal) {return true;}
if (WarpX::particle_boundary_hi[idim] == ParticleBoundaryType::Thermal) {return true;}
}
return false;
}
3 changes: 1 addition & 2 deletions Source/Particles/PhysicalParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,9 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp

// currently supports only isotropic thermal distribution
// same distribution is applied to all boundaries
if (m_boundary_conditions.isAnyParticleBoundaryThermal()) {
if (WarpX::isAnyParticleBoundaryThermal()) {
amrex::Real boundary_uth;
utils::parser::getWithParser(pp_species_name,"boundary_uth",boundary_uth);
amrex::Print() << " thermal vel : " << boundary_uth << "\n";
m_boundary_conditions.SetThermalVelocity(boundary_uth);
}
}
Expand Down
2 changes: 2 additions & 0 deletions Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ public:

void CopyJPML ();
bool isAnyBoundaryPML();
/** True if any of the particle boundary condition type is Thermal */
static bool isAnyParticleBoundaryThermal();

PML* GetPML (int lev);
#if (defined WARPX_DIM_RZ) && (defined WARPX_USE_PSATD)
Expand Down
10 changes: 10 additions & 0 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3281,6 +3281,16 @@ WarpX::isAnyBoundaryPML()
return false;
}

bool
WarpX::isAnyParticleBoundaryThermal ()
{
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
if (WarpX::particle_boundary_lo[idim] == ParticleBoundaryType::Thermal) {return true;}
if (WarpX::particle_boundary_hi[idim] == ParticleBoundaryType::Thermal) {return true;}
}
return false;
}

std::string
TagWithLevelSuffix (std::string name, int const level)
{
Expand Down

0 comments on commit 93f8ae6

Please sign in to comment.