84 const real_t metric_normal,
99 MFEM_VERIFY(mid == 302 || mid == 303 || mid == 315 || mid == 318 ||
100 mid == 321 || mid == 332 || mid == 338,
101 "3D metric not yet implemented!");
103 const bool const_m0 = mc_.
Size() == 1;
105 constexpr int DIM = 3;
106 const int D1D = T_D1D ? T_D1D : d1d;
107 const int Q1D = T_Q1D ? T_Q1D : q1d;
109 const auto MC = const_m0 ?
120 const real_t *metric_data = metric_param.
Read();
124 const int D1D = T_D1D ? T_D1D : d1d;
125 const int Q1D = T_Q1D ? T_Q1D : q1d;
126 constexpr int MQ1 = T_Q1D ? T_Q1D : T_MAX;
127 constexpr int MD1 = T_D1D ? T_D1D : T_MAX;
129 MFEM_SHARED
real_t BG[2][MQ1*MD1];
130 MFEM_SHARED
real_t DDD[3][MD1*MD1*MD1];
131 MFEM_SHARED
real_t DDQ[6][MD1*MD1*MQ1];
132 MFEM_SHARED
real_t DQQ[9][MD1*MQ1*MQ1];
133 MFEM_SHARED
real_t QQQ[9][MQ1*MQ1*MQ1];
135 kernels::internal::LoadX<MD1>(e,D1D,X,DDD);
136 kernels::internal::LoadBG<MD1,MQ1>(D1D,Q1D,
b,g,BG);
138 kernels::internal::GradX<MD1,MQ1>(D1D,Q1D,BG,DDD,DDQ);
139 kernels::internal::GradY<MD1,MQ1>(D1D,Q1D,BG,DDQ,DQQ);
140 kernels::internal::GradZ<MD1,MQ1>(D1D,Q1D,BG,DQQ,QQQ);
142 MFEM_FOREACH_THREAD(qz,z,Q1D)
144 MFEM_FOREACH_THREAD(qy,y,Q1D)
146 MFEM_FOREACH_THREAD(qx,x,Q1D)
148 const real_t *Jtr = &J(0,0,qx,qy,qz,e);
150 const real_t m_coef = const_m0 ? MC(0,0,0,0) : MC(qx,qy,qz,e);
151 const real_t weight = metric_normal * m_coef *
152 W(qx,qy,qz) * detJtr;
160 kernels::internal::PullGrad<MQ1>(Q1D,qx,qy,qz, QQQ, Jpr);
168 mid == 302 ? EvalW_302(Jpt) :
169 mid == 303 ? EvalW_303(Jpt) :
170 mid == 315 ? EvalW_315(Jpt) :
171 mid == 318 ? EvalW_318(Jpt) :
172 mid == 321 ? EvalW_321(Jpt) :
173 mid == 332 ? EvalW_332(Jpt, metric_data) :
174 mid == 338 ? EvalW_338(Jpt, metric_data) : 0.0;
176 E(qx,qy,qz,e) = weight * EvalW;
181 return energy * ones;
MFEM_HOST_DEVICE void Mult(const int height, const int width, const TA *data, const TX *x, TY *y)
Matrix vector multiplication: y = A x, where the matrix A is of size height x width with given data,...
MFEM_REGISTER_TMOP_KERNELS(void, DatcSize, const int NE, const int ncomp, const int sizeidx, const real_t input_min_size, const DenseMatrix &w_, const Array< real_t > &b_, const Vector &x_, const Vector &nc_reduce, DenseTensor &j_, const int d1d, const int q1d)