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 = 3;
34 const int D1D = T_D1D ? T_D1D : d1d;
35 const int Q1D = T_Q1D ? T_Q1D : q1d;
37 const bool const_c0 = c0_.
Size() == 1;
38 const auto C0 = const_c0 ?
41 const auto LD =
Reshape(lim_dist.
Read(), D1D, D1D, D1D, NE);
48 MFEM_FORALL_3D(e, NE, Q1D, Q1D, Q1D,
50 constexpr
int DIM = 3;
51 const int D1D = T_D1D ? T_D1D : d1d;
52 const int Q1D = T_Q1D ? T_Q1D : q1d;
53 constexpr
int MQ1 = T_Q1D ? T_Q1D : T_MAX;
54 constexpr
int MD1 = T_D1D ? T_D1D : T_MAX;
55 constexpr
int MDQ = (MQ1 > MD1) ? MQ1 : MD1;
57 MFEM_SHARED
double sBLD[MQ1*MD1];
58 kernels::internal::LoadB<MD1,MQ1>(D1D,Q1D,bld,sBLD);
61 MFEM_SHARED
double sm0[MDQ*MDQ*MDQ];
62 MFEM_SHARED
double sm1[MDQ*MDQ*MDQ];
68 kernels::internal::LoadX(e,D1D,LD,DDD);
70 kernels::internal::EvalX(D1D,Q1D,BLD,DDD,DDQ);
71 kernels::internal::EvalY(D1D,Q1D,BLD,DDQ,DQQ);
72 kernels::internal::EvalZ(D1D,Q1D,BLD,DQQ,QQQ);
74 MFEM_FOREACH_THREAD(qz,z,Q1D)
76 MFEM_FOREACH_THREAD(qy,y,Q1D)
78 MFEM_FOREACH_THREAD(qx,x,Q1D)
80 const double *Jtr = &J(0,0,qx,qy,qz,e);
81 const double detJtr = kernels::Det<3>(Jtr);
82 const double weight = W(qx,qy,qz) * detJtr;
83 const double coeff0 = const_c0 ? C0(0,0,0,0) : C0(qx,qy,qz,e);
84 const double weight_m = weight * lim_normal * coeff0;
87 kernels::internal::PullEval(qx,qy,qz,QQQ,D);
88 const double dist = D;
92 const double c = 1.0 / (dist * dist);
94 kernels::Diag<3>(c, grad_grad);
97 for (
int i = 0; i <
DIM; i++)
99 for (
int j = 0; j <
DIM; j++)
101 H0(i,j,qx,qy,qz,e) = weight_m * gg(i,j);
113 const int D1D =
PA.maps_lim->ndof;
114 const int Q1D =
PA.maps_lim->nqpt;
115 const int id = (D1D << 4 ) | Q1D;
124 MFEM_LAUNCH_TMOP_KERNEL(SetupGradPA_Kernel_C0_3D,
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.
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).
void AssembleGradPA_C0_3D(const Vector &) const
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims...dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.