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 InterpolateLocal3DKernel(
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*D1D;
53 MFEM_VERIFY(MD1 <= DofQuadLimits::MAX_D1D,
54 "Increase Max allowable polynomial order.");
55 MFEM_VERIFY(D1D != 0,
"Polynomial order not specified.");
56#define MAXC(a, b) (((a) > (b)) ? (a) : (b))
57 const int nThreadsy = MAXC(D1D, 3);
60 MFEM_SHARED
double wtr[3*MD1];
61 MFEM_SHARED
double sums[MD1*MD1];
64 MFEM_FOREACH_THREAD(j,x,D1D)
66 MFEM_FOREACH_THREAD(k,y,3)
68 lagrange_eval(wtr + k*D1D, r[3*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] = 0.0;
84 for (
int l = 0; l < D1D; ++l)
86 sums[j + k*D1D] += gf_in[elemOffset + j + k*D1D + l*D1D*D1D] *
89 sums[j+k*D1D] *= wtr[D1D+k]*wtr[j];
94 MFEM_FOREACH_THREAD(j,x,1)
96 MFEM_FOREACH_THREAD(k,y,1)
99 for (
int jj = 0; jj < D1D*D1D; ++jj)
103 int_out[i + fld * npt] = sumv;
118 if (npt == 0) {
return; }
120 auto pfin = field_in.
Read(use_dev);
121 auto pgsle = gsl_elem_dev_l.
ReadWrite(use_dev);
122 auto pgslr = gsl_ref_l.
ReadWrite(use_dev);
123 auto pfout = field_out.
Write(use_dev);
129 InterpolateLocal3DKernel<2>(pfin, pgsle, pgslr, pfout,
130 npt, ncomp, pgll, plcf);
133 InterpolateLocal3DKernel<3>(pfin, pgsle, pgslr, pfout,
134 npt, ncomp, pgll, plcf);
137 InterpolateLocal3DKernel<4>(pfin, pgsle, pgslr, pfout,
138 npt, ncomp, pgll, plcf);
141 InterpolateLocal3DKernel<5>(pfin, pgsle, pgslr, pfout,
142 npt, ncomp, pgll, plcf);
145 InterpolateLocal3DKernel(pfin, pgsle, pgslr, pfout,
146 npt, ncomp, pgll, plcf, dof1Dsol);
T * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), on_dev).
void InterpolateLocal3(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 3D.
struct mfem::FindPointsGSLIB::DevStruct DEV
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)