12 #include "../tmop.hpp"
14 #include "../linearform.hpp"
15 #include "../../general/forall.hpp"
16 #include "../../linalg/kernels.hpp"
22 const double lim_normal,
33 constexpr
int DIM = 2;
34 constexpr
int NBZ = 1;
35 const int D1D = T_D1D ? T_D1D : d1d;
36 const int Q1D = T_Q1D ? T_Q1D : q1d;
38 const bool const_c0 = c0_.
Size() == 1;
39 const auto C0 = const_c0 ?
42 const auto LD =
Reshape(lim_dist.
Read(), D1D, D1D, NE);
49 MFEM_FORALL_2D(e, NE, Q1D, Q1D, NBZ,
51 const int D1D = T_D1D ? T_D1D : d1d;
52 const int Q1D = T_Q1D ? T_Q1D : q1d;
53 constexpr
int NBZ = 1;
54 constexpr
int MQ1 = T_Q1D ? T_Q1D : T_MAX;
55 constexpr
int MD1 = T_D1D ? T_D1D : T_MAX;
57 MFEM_SHARED
double BLD[MQ1*MD1];
59 MFEM_SHARED
double XY[NBZ][MD1*MD1];
60 MFEM_SHARED
double DQ[NBZ][MD1*MQ1];
61 MFEM_SHARED
double QQ[NBZ][MQ1*MQ1];
63 kernels::internal::LoadX<MD1,NBZ>(e,D1D,LD,XY);
65 kernels::internal::LoadB<MD1,MQ1>(D1D,Q1D,bld,BLD);
67 kernels::internal::EvalX<MD1,MQ1,NBZ>(D1D,Q1D,BLD,XY,DQ);
68 kernels::internal::EvalY<MD1,MQ1,NBZ>(D1D,Q1D,BLD,DQ,QQ);
70 MFEM_FOREACH_THREAD(qy,y,Q1D)
72 MFEM_FOREACH_THREAD(qx,x,Q1D)
74 const double *Jtr = &J(0,0,qx,qy,e);
75 const double detJtr = kernels::Det<2>(Jtr);
76 const double weight = W(qx,qy) * detJtr;
77 const double coeff0 = const_c0 ? C0(0,0,0) : C0(qx,qy,e);
78 const double weight_m = weight * lim_normal * coeff0;
81 kernels::internal::PullEval<MQ1,NBZ>(Q1D,qx,qy,QQ,D);
82 const double dist = D;
86 const double c = 1.0 / (dist * dist);
88 kernels::Diag<2>(c, grad_grad);
91 for (
int i = 0; i <
DIM; i++)
93 for (
int j = 0; j <
DIM; j++)
95 H0(i,j,qx,qy,e) = weight_m * gg(i,j);
105 MFEM_CONTRACT_VAR(X);
107 const int D1D =
PA.maps_lim->ndof;
108 const int Q1D =
PA.maps_lim->nqpt;
109 const int id = (D1D << 4 ) | Q1D;
118 MFEM_LAUNCH_TMOP_KERNEL(SetupGradPA_C0_2D,
id,ln,LD,C0,N,J,W,BLD,H0);
struct mfem::TMOP_Integrator::@23 PA
const double * Read(bool on_dev=true) const
Shortcut for mfem::Read( GetMemory(), TotalSize(), on_dev).
int Size() const
Returns the size of the vector.
virtual double * Write(bool on_dev=true)
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), on_dev).
MFEM_REGISTER_TMOP_KERNELS(void, DatcSize, const int NE, const int ncomp, const int sizeidx, const DenseMatrix &w_, const Array< double > &b_, const Vector &x_, DenseTensor &j_, const int d1d, const int q1d)
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
A basic generic Tensor class, appropriate for use on the GPU.
void AssembleGradPA_C0_2D(const Vector &) const
Rank 3 tensor (array of matrices)
virtual const double * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims...dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.