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 InterpolateLocal1DKernel(
const double *
const gf_in,
42 double *
const int_out,
49 const int MD1 = T_D1D ? T_D1D : DofQuadLimits::MAX_D1D;
50 const int D1D = T_D1D ? T_D1D : pN;
52 MFEM_VERIFY(MD1 <= DofQuadLimits::MAX_D1D,
53 "Increase Max allowable polynomial order.");
54 MFEM_VERIFY(pN<=DofQuadLimits::MAX_D1D,
55 "Increase Max allowable polynomial order.");
56 MFEM_VERIFY(D1D != 0,
"Polynomial order not specified.");
60 MFEM_SHARED
double wtr[MD1];
61 MFEM_SHARED
double sums[MD1];
64 MFEM_FOREACH_THREAD(j,x,D1D)
66 lagrange_eval(wtr, r[i], j, p_Nq, gll1D, lagcoeff);
70 for (
int fld=0; fld<nfields; ++fld)
75 const int elemOffset = el[i]*nfields*p_Nq + fld*p_Nq;
76 MFEM_FOREACH_THREAD(j,x,D1D)
78 sums[j] = wtr[j] * gf_in[elemOffset + j];
82 MFEM_FOREACH_THREAD(j,x,1)
86 for (
int jj=0; jj<D1D; ++jj)
90 int_out[fld*npt + i] = sumv;
105 MFEM_VERIFY(
dim == 1,
"Kernel for edges only.");
106 if (npt == 0) {
return; }
108 auto pfin = field_in.
Read(use_dev);
109 auto pgsl = gsl_elem_dev_l.
ReadWrite(use_dev);
110 auto pgslr = gsl_ref_l.
ReadWrite(use_dev);
111 auto pfout = field_out.
Write(use_dev);
117 InterpolateLocal1DKernel<2>(pfin, pgsl, pgslr, pfout,
118 npt, ncomp, pgll, plcf);
121 InterpolateLocal1DKernel<3>(pfin, pgsl, pgslr, pfout,
122 npt, ncomp, pgll, plcf);
125 InterpolateLocal1DKernel<4>(pfin, pgsl, pgslr, pfout,
126 npt, ncomp, pgll, plcf);
129 InterpolateLocal1DKernel<5>(pfin, pgsl, pgslr, pfout,
130 npt, ncomp, pgll, plcf);
133 InterpolateLocal1DKernel(pfin, pgsl, pgslr, pfout,
134 npt, ncomp, pgll, plcf, dof1Dsol);
T * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), on_dev).
void InterpolateLocal1(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 1D.
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)