diff options
author | 2019-03-01 11:14:21 -0800 | |
---|---|---|
committer | 2019-03-01 11:14:21 -0800 | |
commit | 26fdde5c879d3fa965bc5f2b4bda7432b4ae0e50 (patch) | |
tree | 9455e4117e8cac9625132368881872bcff727d95 /Source/Utils/WarpXTagging.cpp | |
parent | 24ae5647745f93978c88a005acefdcacf356e418 (diff) | |
parent | 7e7dccaa7fb1206f829f8747f2ec2ad80bec599c (diff) | |
download | WarpX-26fdde5c879d3fa965bc5f2b4bda7432b4ae0e50.tar.gz WarpX-26fdde5c879d3fa965bc5f2b4bda7432b4ae0e50.tar.zst WarpX-26fdde5c879d3fa965bc5f2b4bda7432b4ae0e50.zip |
Merge pull request #56 from ECP-WarpX/source_subfolders
Reorganize Source with subfolders
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; + } + } + } +} + |