61 constexpr int DIM = 2;
62 const int D1D = T_D1D ? T_D1D : d1d;
63 const int Q1D = T_Q1D ? T_Q1D : q1d;
65 const auto B =
Reshape(
b.Read(), Q1D, D1D);
74 constexpr int DIM = 2;
75 const int D1D = T_D1D ? T_D1D : d1d;
76 const int Q1D = T_Q1D ? T_Q1D : q1d;
77 constexpr int MD1 = T_D1D ? T_D1D : DofQuadLimits::MAX_D1D;
78 constexpr int MQ1 = T_Q1D ? T_Q1D : DofQuadLimits::MAX_Q1D;
83 for (
int v = 0; v <
DIM; v++)
85 MFEM_FOREACH_THREAD(qx,x,Q1D)
87 MFEM_FOREACH_THREAD(qy,y,Q1D)
89 const real_t *Jtr = &J(0,0,qx,qy,e);
94 for (
int m = 0; m <
DIM; m++)
96 for (
int n = 0; n <
DIM; n++)
100 Href(v,m,n,qx,qy) = 0.0;
101 for (
int s = 0;
s <
DIM;
s++)
103 for (
int t = 0;
t <
DIM;
t++)
106 Jrt(m,
s) * H(v,
s,v,
t,qx,qy,e) * Jrt(n,
t);
118 for (
int v = 0; v <
DIM; v++)
121 MFEM_FOREACH_THREAD(qx,x,Q1D)
123 MFEM_FOREACH_THREAD(dy,y,D1D)
125 for (
int m = 0; m <
DIM; m++)
127 for (
int n = 0; n <
DIM; n++)
134 for (
int qy = 0; qy < Q1D; ++qy)
136 const real_t By = B(qy,dy);
137 const real_t Gy = G(qy,dy);
138 for (
int m = 0; m <
DIM; m++)
140 for (
int n = 0; n <
DIM; n++)
142 const real_t L = (m == 1 ? Gy : By);
143 const real_t R = (n == 1 ? Gy : By);
144 QD(m,n,qx,dy) += L * Href(v,m,n,qx,qy) * R;
153 MFEM_FOREACH_THREAD(dy,y,D1D)
155 MFEM_FOREACH_THREAD(dx,x,D1D)
159 for (
int qx = 0; qx < Q1D; ++qx)
161 const real_t Bx = B(qx,dx);
162 const real_t Gx = G(qx,dx);
164 for (
int m = 0; m <
DIM; m++)
166 for (
int n = 0; n <
DIM; n++)
168 const real_t L = (m == 0 ? Gx : Bx);
169 const real_t R = (n == 0 ? Gx : Bx);
170 d += L * QD(m,n,qx,dy) * R;
185 const int D1D =
PA.maps->ndof;
186 const int Q1D =
PA.maps->nqpt;
187 const int id = (D1D << 4 ) | Q1D;
193 MFEM_LAUNCH_TMOP_KERNEL(AssembleDiagonalPA_Kernel_2D,
id,N,B,G,J,
H,D);
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
Rank 3 tensor (array of matrices)
const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read( GetMemory(), TotalSize(), on_dev).
A basic generic Tensor class, appropriate for use on the GPU.
void AssembleDiagonalPA_2D(Vector &) const
struct mfem::TMOP_Integrator::@23 PA
virtual const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
virtual real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
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_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)
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims... dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.
void forall_2D(int N, int X, int Y, lambda &&body)