diff options
author | 2021-08-23 16:08:41 -0700 | |
---|---|---|
committer | 2021-08-23 16:08:41 -0700 | |
commit | 247cd790c74dfd7fde9f41708001e7184c615ff0 (patch) | |
tree | a46b74c30b3b8440824075609e3c99f5bac21482 /Source/Particles/ParticleBoundaryBuffer.cpp | |
parent | 7e40185d7c0a81a4cb1b49263a363763a27c26c5 (diff) | |
download | WarpX-247cd790c74dfd7fde9f41708001e7184c615ff0.tar.gz WarpX-247cd790c74dfd7fde9f41708001e7184c615ff0.tar.zst WarpX-247cd790c74dfd7fde9f41708001e7184c615ff0.zip |
Scalar field interpolator from grid to particle position (#2221)
* refactored distance to EB calculation to have a more general function to interpolate from a scalar field on the grid to a given position
* changed RZ error message to general interpolation function
* changed function names to specify that scalar field interpolation is for a nodal field only
Diffstat (limited to 'Source/Particles/ParticleBoundaryBuffer.cpp')
-rw-r--r-- | Source/Particles/ParticleBoundaryBuffer.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/Particles/ParticleBoundaryBuffer.cpp b/Source/Particles/ParticleBoundaryBuffer.cpp index 5f29baa09..f84d05b28 100644 --- a/Source/Particles/ParticleBoundaryBuffer.cpp +++ b/Source/Particles/ParticleBoundaryBuffer.cpp @@ -9,6 +9,7 @@ #include "EmbeddedBoundary/DistanceToEB.H" #include "Particles/ParticleBoundaryBuffer.H" #include "Particles/MultiParticleContainer.H" +#include "Particles/Gather/ScalarFieldGather.H" #include <AMReX_Geometry.H> #include <AMReX_ParmParse.H> @@ -217,11 +218,9 @@ void ParticleBoundaryBuffer::gatherParticles (MultiParticleContainer& mypc, amrex::ParticleReal xp, yp, zp; getPosition(ip, xp, yp, zp); - int ii, jj, kk; - amrex::Real W[AMREX_SPACEDIM][2]; - DistanceToEB::compute_weights(xp, yp, zp, plo, dxi, ii, jj, kk, W); - - amrex::Real phi_value = DistanceToEB::interp_distance(ii, jj, kk, W, phiarr); + amrex::Real phi_value = doGatherScalarFieldNodal( + xp, yp, zp, phiarr, dxi, plo + ); return phi_value < 0.0 ? 1 : 0; }, CopyAndTimestamp{timestamp_index, timestep}, 0, dst_index); |