diff options
author | 2019-03-06 16:09:35 -0800 | |
---|---|---|
committer | 2019-03-06 16:09:35 -0800 | |
commit | 1e44150d0cc7d2b295f8f3e1b6968b97df4efab3 (patch) | |
tree | 28303c8c0c318421b9cda3d504993fb2caeb0815 /Source/Utils/WarpXTagging.cpp | |
parent | 028011d44564f0745f3036b10bbd2ddadd0a0cf6 (diff) | |
parent | f0bea186a253a97d82a78dcd227d07879a0eea1d (diff) | |
download | WarpX-1e44150d0cc7d2b295f8f3e1b6968b97df4efab3.tar.gz WarpX-1e44150d0cc7d2b295f8f3e1b6968b97df4efab3.tar.zst WarpX-1e44150d0cc7d2b295f8f3e1b6968b97df4efab3.zip |
Merge branch 'dev' into RZgeometry
Diffstat (limited to 'Source/Utils/WarpXTagging.cpp')
-rw-r--r-- | Source/Utils/WarpXTagging.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/Utils/WarpXTagging.cpp b/Source/Utils/WarpXTagging.cpp new file mode 100644 index 000000000..21acbefdc --- /dev/null +++ b/Source/Utils/WarpXTagging.cpp @@ -0,0 +1,34 @@ + +#include <WarpX.H> +#include <AMReX_BoxIterator.H> +#include <array> +#include <algorithm> + +using namespace amrex; + +void +WarpX::ErrorEst (int lev, TagBoxArray& tags, Real time, int /*ngrow*/) +{ + const Real* problo = Geometry::ProbLo(); + const Real* dx = Geom(lev).CellSize(); + +#ifdef _OPENMP +#pragma omp parallel +#endif + for (MFIter mfi(tags); mfi.isValid(); ++mfi) + { + auto& fab = tags[mfi]; + const Box& bx = fab.box(); + for (BoxIterator bi(bx); bi.ok(); ++bi) + { + const IntVect& cell = bi(); + RealVect pos {AMREX_D_DECL((cell[0]+0.5)*dx[0]+problo[0], + (cell[1]+0.5)*dx[1]+problo[1], + (cell[2]+0.5)*dx[2]+problo[2])}; + if (pos > fine_tag_lo && pos < fine_tag_hi) { + fab(cell) = TagBox::SET; + } + } + } +} + |