MCPcopy Create free account
hub / github.com/BLAST-WarpX/warpx / ComputeSchwingerGlobalBox

Method ComputeSchwingerGlobalBox

Source/Particles/MultiParticleContainer.cpp:1691–1752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1689}
1690
1691amrex::Box
1692MultiParticleContainer::ComputeSchwingerGlobalBox () const
1693{
1694 auto & warpx = WarpX::GetInstance();
1695 constexpr int level_0 = 0;
1696 amrex::Geometry const & geom = warpx.Geom(level_0);
1697
1698#if defined(WARPX_DIM_3D)
1699 const amrex::Array<amrex::Real,3> schwinger_min{m_qed_schwinger_xmin,
1700 m_qed_schwinger_ymin,
1701 m_qed_schwinger_zmin};
1702 const amrex::Array<amrex::Real,3> schwinger_max{m_qed_schwinger_xmax,
1703 m_qed_schwinger_ymax,
1704 m_qed_schwinger_zmax};
1705#else
1706 const amrex::Array<amrex::Real,2> schwinger_min{m_qed_schwinger_xmin,
1707 m_qed_schwinger_zmin};
1708 const amrex::Array<amrex::Real,2> schwinger_max{m_qed_schwinger_xmax,
1709 m_qed_schwinger_zmax};
1710#endif
1711
1712 // Box inside which Schwinger is activated
1713 amrex::Box schwinger_global_box;
1714
1715 for (int dir=0; dir<AMREX_SPACEDIM; dir++)
1716 {
1717 // Dealing with these corner cases should ensure that we don't overflow on the integers
1718 if (schwinger_min[dir] < geom.ProbLo(dir))
1719 {
1720 schwinger_global_box.setSmall(dir, std::numeric_limits<int>::lowest());
1721 }
1722 else if (schwinger_min[dir] > geom.ProbHi(dir))
1723 {
1724 schwinger_global_box.setSmall(dir, std::numeric_limits<int>::max());
1725 }
1726 else
1727 {
1728 // Schwinger pairs are currently created on the lower nodes of a cell. Using ceil here
1729 // excludes all cells whose lower node is strictly lower than schwinger_min[dir].
1730 schwinger_global_box.setSmall(dir, static_cast<int>(std::ceil(
1731 (schwinger_min[dir] - geom.ProbLo(dir)) / geom.CellSize(dir))));
1732 }
1733
1734 if (schwinger_max[dir] < geom.ProbLo(dir))
1735 {
1736 schwinger_global_box.setBig(dir, std::numeric_limits<int>::lowest());
1737 }
1738 else if (schwinger_max[dir] > geom.ProbHi(dir))
1739 {
1740 schwinger_global_box.setBig(dir, std::numeric_limits<int>::max());
1741 }
1742 else
1743 {
1744 // Schwinger pairs are currently created on the lower nodes of a cell. Using floor here
1745 // excludes all cells whose lower node is strictly higher than schwinger_max[dir].
1746 schwinger_global_box.setBig(dir, static_cast<int>(std::floor(
1747 (schwinger_max[dir] - geom.ProbLo(dir)) / geom.CellSize(dir))));
1748 }

Callers

nothing calls this directly

Calls 1

CellSizeMethod · 0.80

Tested by

no test coverage detected