12 #include "../tmop.hpp"
14 #include "../../general/forall.hpp"
15 #include "../../linalg/kernels.hpp"
30 constexpr
int DIM = 3;
31 const int D1D = T_D1D ? T_D1D : d1d;
32 const int Q1D = T_Q1D ? T_Q1D : q1d;
41 MFEM_FORALL_3D(e, NE, Q1D, Q1D, Q1D,
43 constexpr
int DIM = 3;
44 const int D1D = T_D1D ? T_D1D : d1d;
45 const int Q1D = T_Q1D ? T_Q1D : q1d;
46 constexpr
int MD1 = T_D1D ? T_D1D :
MAX_D1D;
47 constexpr
int MQ1 = T_Q1D ? T_Q1D :
MAX_Q1D;
49 MFEM_SHARED
double qqd[MQ1*MQ1*MD1];
50 MFEM_SHARED
double qdd[MQ1*MD1*MD1];
54 for (
int v = 0; v <
DIM; ++v)
56 for (
int i = 0; i <
DIM; i++)
58 for (
int j = 0; j <
DIM; j++)
61 MFEM_FOREACH_THREAD(qx,x,Q1D)
63 MFEM_FOREACH_THREAD(qy,y,Q1D)
65 MFEM_FOREACH_THREAD(dz,z,D1D)
69 for (
int qz = 0; qz < Q1D; ++qz)
71 const double *Jtr = &J(0,0,qx,qy,qz,e);
74 kernels::CalcInverse<3>(Jtr, jrt);
75 const double Bz = B(qz,dz);
76 const double Gz = G(qz,dz);
77 const double L = i==2 ? Gz : Bz;
78 const double R = j==2 ? Gz : Bz;
79 const double Jij = Jrt(i,i) * Jrt(j,j);
80 const double h = H(v,i,v,j,qx,qy,qz,e);
81 QQD(qx,qy,dz) += L * Jij * h * R;
88 MFEM_FOREACH_THREAD(qx,x,Q1D)
90 MFEM_FOREACH_THREAD(dz,z,D1D)
92 MFEM_FOREACH_THREAD(dy,y,D1D)
96 for (
int qy = 0; qy < Q1D; ++qy)
98 const double By = B(qy,dy);
99 const double Gy = G(qy,dy);
100 const double L = i==1 ? Gy : By;
101 const double R = j==1 ? Gy : By;
102 QDD(qx,dy,dz) += L * QQD(qx,qy,dz) * R;
109 MFEM_FOREACH_THREAD(dz,z,D1D)
111 MFEM_FOREACH_THREAD(dy,y,D1D)
113 MFEM_FOREACH_THREAD(dx,x,D1D)
117 for (
int qx = 0; qx < Q1D; ++qx)
119 const double Bx = B(qx,dx);
120 const double Gx = G(qx,dx);
121 const double L = i==0 ? Gx : Bx;
122 const double R = j==0 ? Gx : Bx;
123 d += L * QDD(qx,dy,dz) * R;
125 D(dx,dy,dz,v,e) += d;
139 const int D1D =
PA.maps->ndof;
140 const int Q1D =
PA.maps->nqpt;
141 const int id = (D1D << 4 ) | Q1D;
147 MFEM_LAUNCH_TMOP_KERNEL(AssembleDiagonalPA_Kernel_3D,
id,N,B,G,J,H,D);
struct mfem::TMOP_Integrator::@23 PA
const double * Read(bool on_dev=true) const
Shortcut for mfem::Read( GetMemory(), TotalSize(), on_dev).
void AssembleDiagonalPA_3D(Vector &) const
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.
virtual double * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
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.