diff --git a/Source/BoundaryConditions/PML.cpp b/Source/BoundaryConditions/PML.cpp index fb2354b38ed..9f385845eca 100644 --- a/Source/BoundaryConditions/PML.cpp +++ b/Source/BoundaryConditions/PML.cpp @@ -212,9 +212,23 @@ SigmaBox::SigmaBox (const Box& box, const BoxArray& grids, const Real* dx, const sigma_star_cumsum_fac[idim].m_hi = hi[idim]+1; } +#ifdef PULSAR + int pml_cubic_sigma = Pulsar::m_pml_cubic_sigma; + amrex::Real damping_strength = Pulsar::m_damping_strength; +#endif Array fac; for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) { +#ifdef PULSAR + if (pml_cubic_sigma == 1) { + fac[idim] = damping_strength * PhysConst::c + / ( dx[idim]*static_cast(delta[idim]*delta[idim]*delta[idim]) ); + } else { + fac[idim] = damping_strength * PhysConst::c + / ( dx[idim]*static_cast(delta[idim]*delta[idim]) ); + } +#else fac[idim] = 4.0_rt*PhysConst::c/(dx[idim]*static_cast(delta[idim]*delta[idim])); +#endif } if (regdomain.ok()) { // The union of the regular grids is a single box diff --git a/Source/Particles/PulsarParameters.H b/Source/Particles/PulsarParameters.H index 85c77a0c296..e23af69498d 100644 --- a/Source/Particles/PulsarParameters.H +++ b/Source/Particles/PulsarParameters.H @@ -704,6 +704,7 @@ public: static int m_pml_cubic_sigma; static amrex::Real m_gammarad_real; static amrex::Real m_gammarad_scaled; + static amrex::Real m_damping_strength; private: }; diff --git a/Source/Particles/PulsarParameters.cpp b/Source/Particles/PulsarParameters.cpp index 48aa76ee0e8..7970c6d3ad3 100644 --- a/Source/Particles/PulsarParameters.cpp +++ b/Source/Particles/PulsarParameters.cpp @@ -145,6 +145,7 @@ amrex::Real Pulsar::m_depositbuffer_max = 0.; int Pulsar::m_pml_cubic_sigma; amrex::Real Pulsar::m_gammarad_real = 1.; amrex::Real Pulsar::m_gammarad_scaled = 1.; +amrex::Real Pulsar::m_damping_strength = 4.; Pulsar::Pulsar () { @@ -378,6 +379,9 @@ Pulsar::ReadParameters () { pp.get("pml_cubic_sigma", m_pml_cubic_sigma); pp.query("gammarad_real", m_gammarad_real); pp.query("gammarad_scaled", m_gammarad_scaled); + pp.get("damping_strength", m_damping_strength); + amrex::Print() << " damping strength in PML " << m_damping_strength << "\n"; + amrex::Print() << " cubic pml flag : " << m_pml_cubic_sigma << "\n"; }