12 #include "../tmop.hpp" 14 #include "../../general/forall.hpp" 15 #include "../../linalg/kernels.hpp" 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);
72 MFEM_FORALL_2D(e, NE, Q1D, Q1D, 1,
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 :
MAX_D1D;
78 constexpr
int MQ1 = T_Q1D ? T_Q1D :
MAX_Q1D;
80 MFEM_SHARED
double qd[
DIM*
DIM*MQ1*MD1];
83 for (
int v = 0; v <
DIM; v++)
85 MFEM_FOREACH_THREAD(qx,x,Q1D)
87 MFEM_FOREACH_THREAD(dy,y,D1D)
95 for (
int qy = 0; qy < Q1D; ++qy)
97 const double *Jtr = &J(0,0,qx,qy,e);
102 kernels::CalcInverse<2>(Jtr, jrt_data);
104 const double gg = G(qy,dy) * G(qy,dy);
105 const double gb = G(qy,dy) * B(qy,dy);
106 const double bb = B(qy,dy) * B(qy,dy);
107 const double bgb[4] = { bb, gb, gb, gg };
110 for (
int i = 0; i <
DIM; i++)
112 for (
int j = 0; j <
DIM; j++)
114 const double Jij = Jrt(i,i) * Jrt(j,j);
115 const double alpha = Jij * BG(i,j);
116 QD(i,j,qx,dy) +=
alpha * H(v,i,v,j,qx,qy,e);
123 MFEM_FOREACH_THREAD(dy,y,D1D)
125 MFEM_FOREACH_THREAD(dx,x,D1D)
129 for (
int qx = 0; qx < Q1D; ++qx)
131 const double gg = G(qx,dx) * G(qx,dx);
132 const double gb = G(qx,dx) * B(qx,dx);
133 const double bb = B(qx,dx) * B(qx,dx);
134 d += gg * QD(0,0,qx,dy);
135 d += gb * QD(0,1,qx,dy);
136 d += gb * QD(1,0,qx,dy);
137 d += bb * QD(1,1,qx,dy);
150 const int D1D =
PA.maps->ndof;
151 const int Q1D =
PA.maps->nqpt;
152 const int id = (D1D << 4 ) | Q1D;
158 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).
struct mfem::TMOP_Integrator::@23 PA
virtual const double * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
const double * Read(bool on_dev=true) const
Shortcut for mfem::Read( GetMemory(), TotalSize(), 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)
A basic generic Tensor class, appropriate for use on the GPU.
void AssembleDiagonalPA_2D(Vector &) const
virtual double * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(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.
Rank 3 tensor (array of matrices)