18#ifdef MFEM_HAVE_GCC_PRAGMA_DIAGNOSTIC
19#pragma GCC diagnostic push
20#pragma GCC diagnostic ignored "-Wunused-function"
23#ifndef GSLIB_RELEASE_VERSION
24#define GSLIB_RELEASE_VERSION 10007
26#ifdef MFEM_HAVE_GCC_PRAGMA_DIAGNOSTIC
27#pragma GCC diagnostic pop
31#if GSLIB_RELEASE_VERSION >= 10009
32#define CODE_INTERNAL 0
34#define CODE_NOT_FOUND 2
38template<
int T_D1D = 0>
39static void InterpolateLocal2DKernel(
const double *
const gf_in,
42 double *
const int_out,
49 const int Nfields = ncomp;
50 const int MD1 = T_D1D ? T_D1D : DofQuadLimits::MAX_D1D;
51 const int D1D = T_D1D ? T_D1D : pN;
52 const int p_Np = D1D*D1D;
53 MFEM_VERIFY(MD1 <= DofQuadLimits::MAX_D1D,
54 "Increase Max allowable polynomial order.");
55 MFEM_VERIFY(pN<=DofQuadLimits::MAX_D1D,
56 "Increase Max allowable polynomial order.");
57 MFEM_VERIFY(D1D != 0,
"Polynomial order not specified.");
60 MFEM_SHARED
double wtr[2*MD1];
61 MFEM_SHARED
double sums[MD1*MD1];
64 MFEM_FOREACH_THREAD(j,x,D1D)
66 MFEM_FOREACH_THREAD(k,y,2)
68 lagrange_eval(wtr + k*D1D, r[2*i+k], j, D1D, gll1D, lagcoeff);
73 for (
int fld = 0; fld < Nfields; ++fld)
78 const int elemOffset = el[i] * p_Np * Nfields + fld * p_Np;
79 MFEM_FOREACH_THREAD(j,x,D1D)
81 MFEM_FOREACH_THREAD(k,y,D1D)
83 sums[j + k*D1D] = gf_in[elemOffset + j + k * D1D] *
91 MFEM_FOREACH_THREAD(j,x,1)
93 MFEM_FOREACH_THREAD(k,y,1)
96 for (
int jj = 0; jj < D1D*D1D; ++jj)
100 int_out[i + fld * npt] = sumv;
115 if (npt == 0) {
return; }
117 auto pfin = field_in.
Read(use_dev);
118 auto pgsl = gsl_elem_dev_l.
ReadWrite(use_dev);
119 auto pgslr = gsl_ref_l.
ReadWrite(use_dev);
120 auto pfout = field_out.
Write(use_dev);
126 InterpolateLocal2DKernel<2>(pfin, pgsl, pgslr, pfout,
127 npt, ncomp, pgll, plcf);
130 InterpolateLocal2DKernel<3>(pfin, pgsl, pgslr, pfout,
131 npt, ncomp, pgll, plcf);
134 InterpolateLocal2DKernel<4>(pfin, pgsl, pgslr, pfout,
135 npt, ncomp, pgll, plcf);
138 InterpolateLocal2DKernel<5>(pfin, pgsl, pgslr, pfout,
139 npt, ncomp, pgll, plcf);
142 InterpolateLocal2DKernel(pfin, pgsl, pgslr, pfout,
143 npt, ncomp, pgll, plcf, dof1Dsol);
T * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), on_dev).
struct mfem::FindPointsGSLIB::DevStruct DEV
void InterpolateLocal2(const Vector &field_in, Array< int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &field_out, int npt, int ncomp, int dof1dsol)
Interpolate on device for 2D.
virtual const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
virtual real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
virtual void UseDevice(bool use_dev) const
Enable execution of Vector operations using the mfem::Device.
virtual real_t * Write(bool on_dev=true)
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), on_dev).
MFEM_HOST_DEVICE void lagrange_eval(double *p0, double x, int i, int p_Nq, double *z, double *lagrangeCoeff)
void forall_2D(int N, int X, int Y, lambda &&body)