diff options
author | 2019-02-12 10:42:13 -0800 | |
---|---|---|
committer | 2019-02-12 10:42:13 -0800 | |
commit | eb07f18b380cb6b7205c05e7828f00a0fa2b8161 (patch) | |
tree | cbb167e4b8fd3b49ee67ec7f7857e3541e13f7d4 /Source/Utils/WarpXTagging.cpp | |
parent | ed342beeed6f6ed30fe6c4ff5eff502d973fa4d7 (diff) | |
download | WarpX-eb07f18b380cb6b7205c05e7828f00a0fa2b8161.tar.gz WarpX-eb07f18b380cb6b7205c05e7828f00a0fa2b8161.tar.zst WarpX-eb07f18b380cb6b7205c05e7828f00a0fa2b8161.zip |
re-order tree structure of source code
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; + } + } + } +} + |