25namespace quadrature_interpolator
27void InitEvalByNodesKernels();
28void InitEvalByVDimKernels();
29void InitEvalKernels();
31template <
bool P>
void InitGradByNodesKernels();
32template <
bool P>
void InitGradByVDimKernels();
33void InitTensorEvalHDivKernels();
38 using namespace internal::quadrature_interpolator;
40 InitEvalByNodesKernels();
41 InitEvalByVDimKernels();
43 InitGradByNodesKernels<false>();
44 InitGradByVDimKernels<false>();
46 InitGradByNodesKernels<true>();
47 InitGradByVDimKernels<true>();
53 InitTensorEvalHDivKernels();
68 static internal::quadrature_interpolator::Kernels kernels;
73 "Only elements with MapType VALUE and H_DIV are supported!");
88 "Only elements with MapType VALUE and H_DIV are supported!");
104namespace quadrature_interpolator
111static void Eval1D(
const int NE,
120 const int eval_flags)
124 const int nd = maps.
ndof;
125 const int nq = maps.
nqpt;
128 MFEM_VERIFY(vdim == 1 || !(eval_flags & QI::DETERMINANTS),
"");
129 MFEM_VERIFY(
bool(geom) ==
bool(eval_flags & QI::PHYSICAL_DERIVATIVES),
130 "'geom' must be given (non-null) only when evaluating physical"
134 const auto J =
Reshape(geom ? geom->
J.
Read() : nullptr, nq, NE);
135 const auto E =
Reshape(e_vec.
Read(), nd, vdim, NE);
145 for (
int q = 0; q < nq; ++q)
147 if (eval_flags & (QI::VALUES | QI::PHYSICAL_VALUES))
149 for (
int c = 0; c < vdim; c++)
152 for (
int d = 0; d < nd; ++d)
154 q_val += B(q,d)*E(d,c,e);
160 if ((eval_flags & QI::DERIVATIVES) ||
161 (eval_flags & QI::PHYSICAL_DERIVATIVES) ||
162 (eval_flags & QI::DETERMINANTS))
164 for (
int c = 0; c < vdim; c++)
167 for (
int d = 0; d < nd; ++d)
169 q_d += G(q,d)*E(d,c,e);
171 if (eval_flags & QI::PHYSICAL_DERIVATIVES)
175 if (eval_flags & QI::DERIVATIVES || eval_flags & QI::PHYSICAL_DERIVATIVES)
180 if (vdim == 1 && (eval_flags & QI::DETERMINANTS))
194template<const
int T_VDIM, const
int T_ND, const
int T_NQ>
195static void Eval2D(
const int NE,
198 const GeometricFactors *geom,
199 const DofToQuad &maps,
204 const int eval_flags)
206 using QI = QuadratureInterpolator;
208 const int nd = maps.ndof;
209 const int nq = maps.nqpt;
210 const int ND = T_ND ? T_ND : nd;
211 const int NQ = T_NQ ? T_NQ : nq;
212 const int NMAX = NQ > ND ? NQ : ND;
213 const int VDIM = T_VDIM ? T_VDIM : vdim;
215 MFEM_ASSERT(!geom || geom->mesh->SpaceDimension() == 2,
"");
216 MFEM_VERIFY(ND <= QI::MAX_ND2D,
"");
217 MFEM_VERIFY(NQ <= QI::MAX_NQ2D,
"");
218 MFEM_VERIFY(
bool(geom) ==
bool(eval_flags & QI::PHYSICAL_DERIVATIVES),
219 "'geom' must be given (non-null) only when evaluating physical"
221 const auto B =
Reshape(maps.B.Read(), NQ, ND);
222 const auto G =
Reshape(maps.G.Read(), NQ, 2, ND);
223 const auto J =
Reshape(geom ? geom->J.Read() : nullptr, NQ, 2, 2, NE);
224 const auto E =
Reshape(e_vec.Read(), ND, VDIM, NE);
226 Reshape(q_val.Write(), NQ, VDIM, NE):
229 Reshape(q_der.Write(), NQ, VDIM, 2, NE):
234 const int ND = T_ND ? T_ND : nd;
235 const int NQ = T_NQ ? T_NQ : nq;
236 const int VDIM = T_VDIM ? T_VDIM : vdim;
237 constexpr int max_ND = T_ND ? T_ND : QI::MAX_ND2D;
238 constexpr int max_VDIM = T_VDIM ? T_VDIM : QI::MAX_VDIM2D;
239 MFEM_SHARED
real_t s_E[max_VDIM*max_ND];
240 MFEM_FOREACH_THREAD(d, x, ND)
242 for (
int c = 0; c < VDIM; c++)
244 s_E[c+d*VDIM] = E(d,c,e);
249 MFEM_FOREACH_THREAD(q, x, NQ)
251 if (eval_flags & (QI::VALUES | QI::PHYSICAL_VALUES))
254 for (
int c = 0; c < VDIM; c++) { ed[c] = 0.0; }
255 for (
int d = 0; d < ND; ++d)
258 for (
int c = 0; c < VDIM; c++) { ed[c] +=
b*s_E[c+d*VDIM]; }
260 for (
int c = 0; c < VDIM; c++)
266 if ((eval_flags & QI::DERIVATIVES) ||
267 (eval_flags & QI::PHYSICAL_DERIVATIVES) ||
268 (eval_flags & QI::DETERMINANTS))
271 real_t D[QI::MAX_VDIM2D*2];
272 for (
int i = 0; i < 2*VDIM; i++) { D[i] = 0.0; }
273 for (
int d = 0; d < ND; ++d)
275 const real_t wx = G(q,0,d);
276 const real_t wy = G(q,1,d);
277 for (
int c = 0; c < VDIM; c++)
279 real_t s_e = s_E[c+d*VDIM];
280 D[c+VDIM*0] += s_e * wx;
281 D[c+VDIM*1] += s_e * wy;
284 if (eval_flags & QI::DERIVATIVES)
286 for (
int c = 0; c < VDIM; c++)
290 der(c,0,q,e) = D[c+VDIM*0];
291 der(c,1,q,e) = D[c+VDIM*1];
295 der(q,c,0,e) = D[c+VDIM*0];
296 der(q,c,1,e) = D[c+VDIM*1];
300 if (eval_flags & QI::PHYSICAL_DERIVATIVES)
303 Jloc[0] = J(q,0,0,e);
304 Jloc[1] = J(q,1,0,e);
305 Jloc[2] = J(q,0,1,e);
306 Jloc[3] = J(q,1,1,e);
308 for (
int c = 0; c < VDIM; c++)
311 const real_t v = D[c+VDIM*1];
312 const real_t JiU = Jinv[0]*
u + Jinv[1]*v;
313 const real_t JiV = Jinv[2]*
u + Jinv[3]*v;
326 if (eval_flags & QI::DETERMINANTS)
331 DeviceTensor<2> j(D, 3, 2);
332 const double E = j(0,0)*j(0,0) + j(1,0)*j(1,0) + j(2,0)*j(2,0);
333 const double F = j(0,0)*j(0,1) + j(1,0)*j(1,1) + j(2,0)*j(2,1);
334 const double G = j(0,1)*j(0,1) + j(1,1)*j(1,1) + j(2,1)*j(2,1);
335 det(q,e) = std::sqrt(E*G - F*F);
347template<const
int T_VDIM, const
int T_ND, const
int T_NQ>
348static void Eval3D(
const int NE,
351 const GeometricFactors *geom,
352 const DofToQuad &maps,
357 const int eval_flags)
359 using QI = QuadratureInterpolator;
361 const int nd = maps.ndof;
362 const int nq = maps.nqpt;
363 const int ND = T_ND ? T_ND : nd;
364 const int NQ = T_NQ ? T_NQ : nq;
365 const int NMAX = NQ > ND ? NQ : ND;
366 const int VDIM = T_VDIM ? T_VDIM : vdim;
368 MFEM_ASSERT(!geom || geom->mesh->SpaceDimension() == 3,
"");
369 MFEM_VERIFY(ND <= QI::MAX_ND3D,
"");
370 MFEM_VERIFY(NQ <= QI::MAX_NQ3D,
"");
371 MFEM_VERIFY(VDIM == 3 || !(eval_flags & QI::DETERMINANTS),
"");
372 MFEM_VERIFY(
bool(geom) ==
bool(eval_flags & QI::PHYSICAL_DERIVATIVES),
373 "'geom' must be given (non-null) only when evaluating physical"
375 const auto B =
Reshape(maps.B.Read(), NQ, ND);
376 const auto G =
Reshape(maps.G.Read(), NQ, 3, ND);
377 const auto J =
Reshape(geom ? geom->J.Read() : nullptr, NQ, 3, 3, NE);
378 const auto E =
Reshape(e_vec.Read(), ND, VDIM, NE);
380 Reshape(q_val.Write(), NQ, VDIM, NE):
383 Reshape(q_der.Write(), NQ, VDIM, 3, NE):
388 const int ND = T_ND ? T_ND : nd;
389 const int NQ = T_NQ ? T_NQ : nq;
390 const int VDIM = T_VDIM ? T_VDIM : vdim;
391 constexpr int max_ND = T_ND ? T_ND : QI::MAX_ND3D;
392 constexpr int max_VDIM = T_VDIM ? T_VDIM : QI::MAX_VDIM3D;
393 MFEM_SHARED
real_t s_E[max_VDIM*max_ND];
394 MFEM_FOREACH_THREAD(d, x, ND)
396 for (
int c = 0; c < VDIM; c++)
398 s_E[c+d*VDIM] = E(d,c,e);
403 MFEM_FOREACH_THREAD(q, x, NQ)
405 if (eval_flags & (QI::VALUES | QI::PHYSICAL_VALUES))
408 for (
int c = 0; c < VDIM; c++) { ed[c] = 0.0; }
409 for (
int d = 0; d < ND; ++d)
412 for (
int c = 0; c < VDIM; c++) { ed[c] +=
b*s_E[c+d*VDIM]; }
414 for (
int c = 0; c < VDIM; c++)
420 if ((eval_flags & QI::DERIVATIVES) ||
421 (eval_flags & QI::PHYSICAL_DERIVATIVES) ||
422 (eval_flags & QI::DETERMINANTS))
425 real_t D[QI::MAX_VDIM3D*3];
426 for (
int i = 0; i < 3*VDIM; i++) { D[i] = 0.0; }
427 for (
int d = 0; d < ND; ++d)
429 const real_t wx = G(q,0,d);
430 const real_t wy = G(q,1,d);
431 const real_t wz = G(q,2,d);
432 for (
int c = 0; c < VDIM; c++)
434 real_t s_e = s_E[c+d*VDIM];
435 D[c+VDIM*0] += s_e * wx;
436 D[c+VDIM*1] += s_e * wy;
437 D[c+VDIM*2] += s_e * wz;
440 if (eval_flags & QI::DERIVATIVES)
442 for (
int c = 0; c < VDIM; c++)
446 der(c,0,q,e) = D[c+VDIM*0];
447 der(c,1,q,e) = D[c+VDIM*1];
448 der(c,2,q,e) = D[c+VDIM*2];
452 der(q,c,0,e) = D[c+VDIM*0];
453 der(q,c,1,e) = D[c+VDIM*1];
454 der(q,c,2,e) = D[c+VDIM*2];
458 if (eval_flags & QI::PHYSICAL_DERIVATIVES)
461 for (
int col = 0; col < 3; col++)
463 for (
int row = 0; row < 3; row++)
465 Jloc[row+3*col] = J(q,row,col,e);
469 for (
int c = 0; c < VDIM; c++)
472 const real_t v = D[c+VDIM*1];
473 const real_t w = D[c+VDIM*2];
474 const real_t JiU = Jinv[0]*
u + Jinv[1]*v + Jinv[2]*w;
475 const real_t JiV = Jinv[3]*
u + Jinv[4]*v + Jinv[5]*w;
476 const real_t JiW = Jinv[6]*
u + Jinv[7]*v + Jinv[8]*w;
491 if (VDIM == 3 && (eval_flags & QI::DETERMINANTS))
512 using namespace internal::quadrature_interpolator;
515 if (ne == 0) {
return; }
521 return MultHDiv(e_vec, eval_flags, q_val, q_der);
526 const bool use_tensor_eval =
535 const int nd = maps.
ndof;
536 const int nq = maps.
nqpt;
545 (
dim == 2 && vdim == 3),
"Invalid dimensions for determinants.");
548 "mixed meshes are not supported");
555 e_vec.
Read(), q_val.
Write(), vdim, nd, nq);
561 const int s_dim = phys ? sdim :
dim;
562 GradKernels::Run(
dim,
q_layout, phys, vdim, nd, nq, ne,
564 q_der.
Write(), s_dim, vdim, nd, nq);
568 DetKernels::Run(
dim, vdim, nd, nq, ne, maps.
B.
Read(),
576 geom, maps, e_vec, q_val, q_der, q_det, eval_flags);
586 if (ne == 0) {
return; }
588 "variable order spaces are not supported yet!");
591 "this method can be used only for H(div) spaces");
592 MFEM_VERIFY((eval_flags &
594 "only VALUES, PHYSICAL_VALUES, and PHYSICAL_MAGNITUDES"
595 " evaluations are implemented!");
598 MFEM_VERIFY((
dim == 2 ||
dim == 3) &&
dim == sdim,
599 "dim = " <<
dim <<
", sdim = " << sdim
600 <<
" is not supported yet!");
602 "mixed meshes are not supported yet!");
604 MFEM_VERIFY(vdim == 1,
"vdim != 1 is not supported yet!");
606 MFEM_VERIFY(tfe !=
nullptr,
"only quad and hex elements are supported!");
608 "non-tensor-product evaluation are not supported yet!");
614 const DofToQuad &maps_c = tfe->GetDofToQuad(*ir, mode);
615 const DofToQuad &maps_o = tfe->GetDofToQuadOpen(*ir, mode);
616 const int nd = maps_c.
ndof;
617 const int nq = maps_c.
nqpt;
628 "only one of VALUES, PHYSICAL_VALUES, and PHYSICAL_MAGNITUDES"
629 " can be requested at a time!");
630 const unsigned value_eval_mode =
638 TensorEvalHDivKernels::Run(
640 dim, q_l, value_eval_mode, nd, nq,
645 MFEM_CONTRACT_VAR(q_div);
653 MFEM_CONTRACT_VAR(eval_flags);
654 MFEM_CONTRACT_VAR(q_val);
655 MFEM_CONTRACT_VAR(q_der);
656 MFEM_CONTRACT_VAR(e_vec);
657 MFEM_ABORT(
"this method is not implemented yet");
700using namespace internal::quadrature_interpolator;
707template <QVectorLayout Q_LAYOUT>
708TensorEvalKernel FallbackTensorEvalKernel(
int DIM)
710 if (
DIM == 1) {
return Values1D<Q_LAYOUT>; }
711 else if (
DIM == 2) {
return Values2D<Q_LAYOUT>; }
712 else if (
DIM == 3) {
return Values3D<Q_LAYOUT>; }
713 else { MFEM_ABORT(
""); }
716template<QVectorLayout Q_LAYOUT,
bool GRAD_PHYS>
717GradKernel GetGradKernel(
int DIM)
719 if (
DIM == 1) {
return Derivatives1D<Q_LAYOUT, GRAD_PHYS>; }
720 else if (
DIM == 2) {
return Derivatives2D<Q_LAYOUT, GRAD_PHYS>; }
721 else if (
DIM == 3) {
return Derivatives3D<Q_LAYOUT, GRAD_PHYS>; }
722 else { MFEM_ABORT(
""); }
726template<QVectorLayout Q_LAYOUT>
727GradKernel GetGradKernel(
int DIM,
bool GRAD_PHYS)
729 if (GRAD_PHYS) {
return GetGradKernel<Q_LAYOUT, true>(
DIM); }
730 else {
return GetGradKernel<Q_LAYOUT, false>(
DIM); }
733template<QVectorLayout Q_LAYOUT,
bool GRAD_PHYS>
734CollocatedGradKernel GetCollocatedGradKernel(
int DIM)
736 if (
DIM == 1) {
return CollocatedDerivatives1D<Q_LAYOUT, GRAD_PHYS>; }
737 else if (
DIM == 2) {
return CollocatedDerivatives2D<Q_LAYOUT, GRAD_PHYS>; }
738 else if (
DIM == 3) {
return CollocatedDerivatives3D<Q_LAYOUT, GRAD_PHYS>; }
739 else { MFEM_ABORT(
""); }
742template<QVectorLayout Q_LAYOUT>
743CollocatedGradKernel GetCollocatedGradKernel(
int DIM,
bool GRAD_PHYS)
745 if (GRAD_PHYS) {
return GetCollocatedGradKernel<Q_LAYOUT, true>(
DIM); }
746 else {
return GetCollocatedGradKernel<Q_LAYOUT, false>(
DIM); }
750template <
int DIM,
int VDIM,
int ND,
int NQ>
751EvalKernel QuadratureInterpolator::EvalKernels::Kernel()
753 using namespace internal::quadrature_interpolator;
754 if (
DIM == 1) {
return Eval1D; }
755 else if (
DIM == 2) {
return Eval2D<VDIM,ND,NQ>; }
756 else if (
DIM == 3) {
return Eval3D<VDIM,ND,NQ>; }
757 else { MFEM_ABORT(
""); }
761EvalKernel GetEvalKernelVDimFallback(
int VDIM)
763 using EvalKernels = QuadratureInterpolator::EvalKernels;
764 if (VDIM == 1) {
return EvalKernels::Kernel<DIM,1,0,0>(); }
765 else if (VDIM == 2) {
return EvalKernels::Kernel<DIM,2,0,0>(); }
766 else if (VDIM == 3) {
return EvalKernels::Kernel<DIM,3,0,0>(); }
767 else { MFEM_ABORT(
""); }
770EvalKernel QuadratureInterpolator::EvalKernels::Fallback(
771 int DIM,
int VDIM,
int ND,
int NQ)
773 if (
DIM == 1) {
return GetEvalKernelVDimFallback<1>(VDIM); }
774 else if (
DIM == 2) {
return GetEvalKernelVDimFallback<2>(VDIM); }
775 else if (
DIM == 3) {
return GetEvalKernelVDimFallback<3>(VDIM); }
776 else { MFEM_ABORT(
""); }
779TensorEvalKernel QuadratureInterpolator::TensorEvalKernels::Fallback(
783 else {
return FallbackTensorEvalKernel<QVectorLayout::byVDIM>(
DIM); }
786GradKernel QuadratureInterpolator::GradKernels::Fallback(
790 else {
return GetGradKernel<QVectorLayout::byVDIM>(
DIM, GRAD_PHYS); }
793CollocatedGradKernel QuadratureInterpolator::CollocatedGradKernels::Fallback(
797 else {
return GetCollocatedGradKernel<QVectorLayout::byVDIM>(
DIM, GRAD_PHYS); }
804namespace quadrature_interpolator
806void InitEvalKernels()
808 using k = QuadratureInterpolator::EvalKernels;
810 k::Specialization<2,1,1,1>::Add();
811 k::Specialization<2,1,1,4>::Add();
813 k::Specialization<2,1,4,4>::Add();
814 k::Specialization<2,1,4,9>::Add();
816 k::Specialization<2,1,9,9>::Add();
817 k::Specialization<2,1,9,16>::Add();
819 k::Specialization<2,1,16,16>::Add();
820 k::Specialization<2,1,16,25>::Add();
821 k::Specialization<2,1,16,36>::Add();
823 k::Specialization<2,1,25,25>::Add();
824 k::Specialization<2,1,25,36>::Add();
825 k::Specialization<2,1,25,49>::Add();
826 k::Specialization<2,1,25,64>::Add();
830 k::Specialization<3,1,1,1>::Add();
831 k::Specialization<3,1,1,8>::Add();
833 k::Specialization<3,1,8,8>::Add();
834 k::Specialization<3,1,8,27>::Add();
836 k::Specialization<3,1,27,27>::Add();
837 k::Specialization<3,1,27,64>::Add();
839 k::Specialization<3,1,64,64>::Add();
840 k::Specialization<3,1,64,125>::Add();
841 k::Specialization<3,1,64,216>::Add();
843 k::Specialization<3,1,125,125>::Add();
844 k::Specialization<3,1,125,216>::Add();
848 k::Specialization<2,3,1,1>::Add();
849 k::Specialization<2,3,1,4>::Add();
851 k::Specialization<2,3,4,4>::Add();
852 k::Specialization<2,3,4,9>::Add();
854 k::Specialization<2,3,9,4>::Add();
855 k::Specialization<2,3,9,9>::Add();
856 k::Specialization<2,3,9,16>::Add();
857 k::Specialization<2,3,9,25>::Add();
859 k::Specialization<2,3,16,16>::Add();
860 k::Specialization<2,3,16,25>::Add();
861 k::Specialization<2,3,16,36>::Add();
863 k::Specialization<2,3,25,25>::Add();
864 k::Specialization<2,3,25,36>::Add();
865 k::Specialization<2,3,25,49>::Add();
866 k::Specialization<2,3,25,64>::Add();
870 k::Specialization<2,2,4,4>::Add();
871 k::Specialization<2,2,4,9>::Add();
873 k::Specialization<2,2,9,9>::Add();
874 k::Specialization<2,2,9,16>::Add();
876 k::Specialization<2,2,16,16>::Add();
877 k::Specialization<2,2,16,25>::Add();
878 k::Specialization<2,2,16,36>::Add();
880 k::Specialization<2,2,25,25>::Add();
881 k::Specialization<2,2,25,36>::Add();
882 k::Specialization<2,2,25,49>::Add();
883 k::Specialization<2,2,25,64>::Add();
887 k::Specialization<3,3,8,8>::Add();
888 k::Specialization<3,3,8,27>::Add();
890 k::Specialization<3,3,27,27>::Add();
891 k::Specialization<3,3,27,64>::Add();
892 k::Specialization<3,3,27,125>::Add();
894 k::Specialization<3,3,64,64>::Add();
895 k::Specialization<3,3,64,125>::Add();
896 k::Specialization<3,3,64,216>::Add();
898 k::Specialization<3,3,125,125>::Add();
899 k::Specialization<3,3,125,216>::Add();
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
Mode mode
Describes the contents of the B, Bt, G, and Gt arrays, see Mode.
Array< real_t > G
Gradients/divergences/curls of basis functions evaluated at quadrature points.
Mode
Type of data stored in the arrays B, Bt, G, and Gt.
@ FULL
Full multidimensional representation which does not use tensor product structure. The ordering of the...
@ TENSOR
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
Array< real_t > B
Basis functions evaluated at quadrature points.
int ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number.
const class FiniteElement * FE
The FiniteElement that created and owns this object.
int nqpt
Number of quadrature points. When mode is TENSOR, this is the 1D number.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
bool IsVariableOrder() const
Returns true if the space contains elements of varying polynomial orders.
virtual const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
int GetNE() const
Returns number of elements in the mesh.
Mesh * GetMesh() const
Returns the mesh.
int GetVDim() const
Returns the vector dimension of the finite element space.
const FiniteElement * GetTypicalFE() const
Return GetFE(0) if the local mesh is not empty; otherwise return a typical FE based on the Geometry t...
Abstract class for all finite elements.
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
int GetDim() const
Returns the reference space dimension for the finite element.
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
Structure for storing mesh geometric factors: coordinates, Jacobians, and determinants of the Jacobia...
Vector J
Jacobians of the element transformations at all quadrature points.
Class for an integration rule - an Array of IntegrationPoint.
bool IsMixedMesh() const
Returns true if the mesh is a mixed mesh, false otherwise.
int Dimension() const
Dimension of the reference space used within the elements.
int SpaceDimension() const
Dimension of the physical space containing the mesh.
const GeometricFactors * GetGeometricFactors(const IntegrationRule &ir, const int flags, MemoryType d_mt=MemoryType::DEFAULT)
Return the mesh geometric factors corresponding to the given integration rule.
int GetNumGeometries(int dim) const
Return the number of geometries of the given dimension present in the mesh.
A class that performs interpolation from an E-vector to quadrature point values and/or derivatives (Q...
void(*)(const int, const real_t *, const real_t *, const real_t *, real_t *, const int, const int, const int) CollocatedGradKernelType
bool use_tensor_products
Tensor product evaluation mode.
@ VALUES
Evaluate the values at quadrature points.
@ DERIVATIVES
Evaluate the derivatives at quadrature points.
@ PHYSICAL_DERIVATIVES
Evaluate the physical derivatives.
@ DETERMINANTS
Assuming the derivative at quadrature points form a matrix, this flag can be used to compute and stor...
void(*)(const int, const int, const QVectorLayout, const GeometricFactors *, const DofToQuad &, const Vector &, Vector &, Vector &, Vector &, const int) EvalKernelType
QuadratureInterpolator(const FiniteElementSpace &fes, const IntegrationRule &ir)
void(*)(const int, const real_t *, const real_t *, const real_t *, const real_t *, real_t *, const int, const int, const int, const int) GradKernelType
void Mult(const Vector &e_vec, unsigned eval_flags, Vector &q_val, Vector &q_der, Vector &q_det) const
Interpolate the E-vector e_vec to quadrature points.
void Determinants(const Vector &e_vec, Vector &q_det) const
Compute the determinants of the derivatives (with respect to reference coordinates) of the E-vector e...
void MultTranspose(unsigned eval_flags, const Vector &q_val, const Vector &q_der, Vector &e_vec) const
Perform the transpose operation of Mult(). (TODO)
void(*)(const int, const real_t *, const real_t *, real_t *, const int, const int, const int) TensorEvalKernelType
void Values(const Vector &e_vec, Vector &q_val) const
Interpolate the values of the E-vector e_vec at quadrature points.
void PhysValues(const Vector &e_vec, Vector &q_val) const
Interpolate the physical values of the E-vector e_vec at quadrature points.
void Derivatives(const Vector &e_vec, Vector &q_der) const
Interpolate the derivatives (with respect to reference coordinates) of the E-vector e_vec at quadratu...
QVectorLayout q_layout
Output Q-vector layout.
void PhysDerivatives(const Vector &e_vec, Vector &q_der) const
Interpolate the derivatives in physical space of the E-vector e_vec at quadrature points.
static bool SupportsFESpace(const FiniteElementSpace &fespace)
Returns true if the given finite element space is supported by QuadratureInterpolator.
const IntegrationRule * IntRule
Not owned.
Vector d_buffer
Auxiliary device buffer.
const FiniteElementSpace * fespace
Not owned.
const QuadratureSpace * qspace
Not owned.
void MultHDiv(const Vector &e_vec, unsigned eval_flags, Vector &q_val, Vector &q_div) const
Auxiliary method called by Mult() when using H(div)-conforming space.
Class representing the storage layout of a QuadratureFunction.
const IntegrationRule & GetElementIntRule(int idx) const
Get the IntegrationRule associated with mesh element idx.
virtual const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read(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 T det(const tensor< T, 1, 1 > &A)
Returns the determinant of a matrix.
MFEM_HOST_DEVICE void CalcInverse(const T *data, T *inv_data)
Return the inverse of a matrix with given size and data into the matrix with data inv_data.
MFEM_HOST_DEVICE T Det(const T *data)
Compute the determinant of a square matrix of size dim with given data.
real_t u(const Vector &xvec)
T * Write(Memory< T > &mem, int size, bool on_dev=true)
Get a pointer for write access to mem with the mfem::Device's DeviceMemoryClass, if on_dev = true,...
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims... dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.
SchrodingerBaseKernels< ParMesh, ParFiniteElementSpace, ParComplexGridFunction, ParGridFunction, ParBilinearForm, ParMixedBilinearForm, ParLinearForm > Kernels
void forall_2D(int N, int X, int Y, lambda &&body)
bool UsesTensorBasis(const FiniteElementSpace &fes)
Return true if the mesh contains only one topology and the elements are tensor elements.
QVectorLayout
Type describing possible layouts for Q-vectors.
void forall(int N, lambda &&body)