From 93f8ae6b4a14c197cced45f95ed71077bab09215 Mon Sep 17 00:00:00 2001 From: RevathiJambunathan Date: Tue, 19 Mar 2024 21:45:32 -0700 Subject: [PATCH] isAnyThermal as static fctn is warpx class, instead of particle boundaries struct --- Source/BoundaryConditions/WarpXFieldBoundaries.cpp | 6 ++++-- Source/Particles/ParticleBoundaries.H | 3 --- Source/Particles/ParticleBoundaries.cpp | 10 ---------- Source/Particles/PhysicalParticleContainer.cpp | 3 +-- Source/WarpX.H | 2 ++ Source/WarpX.cpp | 10 ++++++++++ 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Source/BoundaryConditions/WarpXFieldBoundaries.cpp b/Source/BoundaryConditions/WarpXFieldBoundaries.cpp index a9e2cf29fe9..4844585cc90 100644 --- a/Source/BoundaryConditions/WarpXFieldBoundaries.cpp +++ b/Source/BoundaryConditions/WarpXFieldBoundaries.cpp @@ -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); } } @@ -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); } } diff --git a/Source/Particles/ParticleBoundaries.H b/Source/Particles/ParticleBoundaries.H index 7e578f190d7..c056436770d 100644 --- a/Source/Particles/ParticleBoundaries.H +++ b/Source/Particles/ParticleBoundaries.H @@ -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"; diff --git a/Source/Particles/ParticleBoundaries.cpp b/Source/Particles/ParticleBoundaries.cpp index 93412b30a46..10268a9c01f 100644 --- a/Source/Particles/ParticleBoundaries.cpp +++ b/Source/Particles/ParticleBoundaries.cpp @@ -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; -} diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index b9b2d10156d..d9a101901b3 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -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); } } diff --git a/Source/WarpX.H b/Source/WarpX.H index 1e8516000f2..75fb1dc1bce 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -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) diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index c929718b043..b7380938a7d 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -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) {