#include "Interpolate.H" #include "Interpolate_K.H" namespace Interpolate { using namespace amrex; std::unique_ptr getInterpolatedScalar( const MultiFab& F_cp, const MultiFab& F_fp, const DistributionMapping& dm, const int r_ratio, const Real* /*dx*/, const int ngrow ) { // Prepare the structure that will contain the returned fields std::unique_ptr interpolated_F; interpolated_F = std::make_unique(F_fp.boxArray(), dm, 1, ngrow); interpolated_F->setVal(0.); // Loop through the boxes and interpolate the values from the _cp data #ifdef _OPENMP #pragma omp parallel #endif { FArrayBox ffab; // Temporary array ; contains interpolated fields for (MFIter mfi(*interpolated_F); mfi.isValid(); ++mfi) { Box finebx = mfi.fabbox(); finebx.coarsen(r_ratio).refine(r_ratio); // so that finebx is coarsenable const FArrayBox& cfab = (F_cp)[mfi]; ffab.resize(finebx); // - Fully nodal if ( F_fp.is_nodal() ){ IntVect refinement_vector{AMREX_D_DECL(r_ratio, r_ratio, r_ratio)}; node_bilinear_interp.interp(cfab, 0, ffab, 0, 1, finebx, refinement_vector, {}, {}, {}, 0, 0, RunOn::Cpu); } else { amrex::Abort("Unknown field staggering."); } // Add temporary array to the returned structure const Box& bx = (*interpolated_F)[mfi].box(); (*interpolated_F)[mfi].plus(ffab, bx, bx, 0, 0, 1); } } return interpolated_F; } std::array, 3> getInterpolatedVector( const MultiFab* Fx_cp, const MultiFab* Fy_cp, const MultiFab* Fz_cp, const MultiFab* Fx_fp, const MultiFab* Fy_fp, const MultiFab* Fz_fp, const DistributionMapping& dm, const int r_ratio, const Real* /*dx*/, const int ngrow ) { // Prepare the structure that will contain the returned fields std::array, 3> interpolated_F; interpolated_F[0] = std::make_unique(Fx_fp->boxArray(), dm, 1, ngrow); interpolated_F[1] = std::make_unique(Fy_fp->boxArray(), dm, 1, ngrow); interpolated_F[2] = std::make_unique(Fz_fp->boxArray(), dm, 1, ngrow); IntVect fx_type = interpolated_F[0]->ixType().toIntVect(); IntVect fy_type = interpolated_F[1]->ixType().toIntVect(); IntVect fz_type = interpolated_F[2]->ixType().toIntVect(); #ifdef _OPENMP #pragma omp parallel #endif for (MFIter mfi(*interpolated_F[0], TilingIfNotGPU()); mfi.isValid(); ++mfi) { Box const& boxx = mfi.growntilebox(fx_type); Box const& boxy = mfi.growntilebox(fy_type); Box const& boxz = mfi.growntilebox(fz_type); Array4 const& fx = interpolated_F[0]->array(mfi); Array4 const& fy = interpolated_F[1]->array(mfi); Array4 const& fz = interpolated_F[2]->array(mfi); Array4 const& cx = Fx_cp->const_array(mfi); Array4 const& cy = Fy_cp->const_array(mfi); Array4 const& cz = Fz_cp->const_array(mfi); amrex::ParallelFor(boxx, boxy, boxz, [=] AMREX_GPU_DEVICE (int j, int k, int l) noexcept { interp(j,k,l,fx,cx,r_ratio,fx_type); }, [=] AMREX_GPU_DEVICE (int j, int k, int l) noexcept { interp(j,k,l,fy,cy,r_ratio,fy_type); }, [=] AMREX_GPU_DEVICE (int j, int k, int l) noexcept { interp(j,k,l,fz,cz,r_ratio,fz_type); }); } return interpolated_F; } } id=17d807f05fddbcd58656cd6888c7d5b85d52e441&follow=1'>golang.org/x/net/AUTHORS (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2018-06-27Fix max-age in http server (#1890)Gravatar Miek Gieben 5-68/+91
2018-06-27Watch feature (#1527)Gravatar John Belamaric 17-57/+977
2018-06-26plugin/cache: Fix: metric `cache miss total` shall include ttl case (#1897)Gravatar Jun Li 1-8/+9
2018-06-24Replace gh-release with curl (#1896)Gravatar Yong Tang 1-3/+10
2018-06-22retry creating dnstest.Server if tcp or udp port is in use (#1799)Gravatar Ruslan Drozhdzh 1-10/+20
2018-06-21plugin/template: fix CNAME upstream handling (#1886)Gravatar Chris O'Haver 4-4/+97
2018-06-21Makefile fixes: (#1892)Gravatar Miek Gieben 4-17/+12
2018-06-21plugin/forward: Increase minimum read timeout to 200ms (#1889)Gravatar Tobias Schmidt 5-10/+10
2018-06-20Rename forward metrics socket_count_total to sockets_open (#1885)Gravatar Tobias Schmidt 1-1/+1
2018-06-20remove deprecated code (#1888)Gravatar Miek Gieben 3-4/+0
2018-06-19Ensure cache.ResponseWriter can be used asynchronously during prefetch (#1884)Gravatar Tobias Schmidt 2-8/+40
2018-06-19Release 1.1.4v1.1.4Gravatar Miek Gieben 3-4/+7
2018-06-18Follow up on #1867 : use one map in backend_lookup (#1869)Gravatar Miek Gieben 1-32/+33
2018-06-18Plugin/Rewrite - review documentation of "append" (#1877)Gravatar Francois Tur 1-2/+2
2018-06-15plugin/forward: add REFUSED test (#1878)Gravatar Miek Gieben 10-10/+62
2018-06-15Plugin/Forward - autotune the dialTimeout for connection (#1852)Gravatar Francois Tur 5-52/+84
2018-06-13Run make -f Makefile.doc (#1875)Gravatar Miek Gieben 9-71/+50
2018-06-13Bump dns version to 1.0.8 (#1873)Gravatar Miek Gieben 1-1/+1
2018-06-12plugin/file: fix local CNAME lookup (#1866)Gravatar Miek Gieben 5-28/+83
2018-06-11Remove dnsutil.Dedup (#1867)Gravatar Miek Gieben 6-61/+66
2018-06-07Update the pr template (#1862)Gravatar Miek Gieben 1-5/+1
2018-06-07Normalizing Response Duration in Log Plugin (#1860)Gravatar Malcolm Akinje 2-1/+5
2018-06-05plugin/forward: fix alignment for sync.Atomic (#1855)Gravatar Miek Gieben 1-3/+3
2018-06-05Update Makefile.release for docker image build (#1856)Gravatar Yong Tang 1-15/+0
2018-06-04Docker: drop alpine (#1843)Gravatar Miek Gieben 1-3/+6
2018-06-02Fix presubmit (#1850)Gravatar Miek Gieben 2-15/+15
2018-06-02presubmit: Check errorf as well (#1845)Gravatar Miek Gieben 19-52/+57