30 return J(0,0) * (J(1,1) * J(2,2) - J(2,1) * J(1,2)) -
31 J(1,0) * (J(0,1) * J(2,2) - J(2,1) * J(0,2)) +
32 J(2,0) * (J(0,1) * J(1,2) - J(1,1) * J(0,2));
39 const int nd1d = ORDER + 1;
40 const int nvert_per_el = nd1d*nd1d;
42 const int v0 = kx + nd1d*ky;
43 const int v1 = kx + 1 + nd1d*ky;
44 const int v2 = kx + 1 + nd1d*(ky + 1);
45 const int v3 = kx + nd1d*(ky + 1);
47 const int e0 =
SDIM*(v0 + nvert_per_el*iel_ho);
48 const int e1 =
SDIM*(v1 + nvert_per_el*iel_ho);
49 const int e2 =
SDIM*(v2 + nvert_per_el*iel_ho);
50 const int e3 =
SDIM*(v3 + nvert_per_el*iel_ho);
76 const real_t *X,
int iel_ho,
int kx,
int ky,
int kz,
80 const int nd1d = ORDER + 1;
81 const int nvert_per_el = nd1d*nd1d*nd1d;
83 const int v0 = kx + nd1d*(ky + nd1d*kz);
84 const int v1 = kx + 1 + nd1d*(ky + nd1d*kz);
85 const int v2 = kx + 1 + nd1d*(ky + 1 + nd1d*kz);
86 const int v3 = kx + nd1d*(ky + 1 + nd1d*kz);
87 const int v4 = kx + nd1d*(ky + nd1d*(kz + 1));
88 const int v5 = kx + 1 + nd1d*(ky + nd1d*(kz + 1));
89 const int v6 = kx + 1 + nd1d*(ky + 1 + nd1d*(kz + 1));
90 const int v7 = kx + nd1d*(ky + 1 + nd1d*(kz + 1));
92 const int e0 =
dim*(v0 + nvert_per_el*iel_ho);
93 const int e1 =
dim*(v1 + nvert_per_el*iel_ho);
94 const int e2 =
dim*(v2 + nvert_per_el*iel_ho);
95 const int e3 =
dim*(v3 + nvert_per_el*iel_ho);
96 const int e4 =
dim*(v4 + nvert_per_el*iel_ho);
97 const int e5 =
dim*(v5 + nvert_per_el*iel_ho);
98 const int e6 =
dim*(v6 + nvert_per_el*iel_ho);
99 const int e7 =
dim*(v7 + nvert_per_el*iel_ho);
141 J(0,0) = -(1-y)*v[0][0] + (1-y)*v[0][1] + y*v[0][2] - y*v[0][3];
142 J(0,1) = -(1-x)*v[0][0] - x*v[0][1] + x*v[0][2] + (1-x)*v[0][3];
144 J(1,0) = -(1-y)*v[1][0] + (1-y)*v[1][1] + y*v[1][2] - y*v[1][3];
145 J(1,1) = -(1-x)*v[1][0] - x*v[1][1] + x*v[1][2] + (1-x)*v[1][3];
151 J(0,0) = -(1-y)*v[0][0] + (1-y)*v[0][1] + y*v[0][2] - y*v[0][3];
152 J(0,1) = -(1-x)*v[0][0] - x*v[0][1] + x*v[0][2] + (1-x)*v[0][3];
154 J(1,0) = -(1-y)*v[1][0] + (1-y)*v[1][1] + y*v[1][2] - y*v[1][3];
155 J(1,1) = -(1-x)*v[1][0] - x*v[1][1] + x*v[1][2] + (1-x)*v[1][3];
157 J(2,0) = -(1-y)*v[2][0] + (1-y)*v[2][1] + y*v[2][2] - y*v[2][3];
158 J(2,1) = -(1-x)*v[2][0] - x*v[2][1] + x*v[2][2] + (1-x)*v[2][3];
165 real_t vx[4], vy[4], vz[4];
166 real_t *v[] = {vx, vy, vz};
169 for (
int iqy=0; iqy<2; ++iqy)
171 for (
int iqx=0; iqx<2; ++iqx)
185 const real_t w_detJ = w/detJ;
186 const real_t E = J(0,0)*J(0,0) + J(1,0)*J(1,0);
187 const real_t F = J(0,0)*J(0,1) + J(1,0)*J(1,1);
188 const real_t G = J(0,1)*J(0,1) + J(1,1)*J(1,1);
189 Q(0,iqy,iqx) = w_detJ * (RT ? E : G);
190 Q(1,iqy,iqx) = w_detJ * (RT ? F : -F);
191 Q(2,iqy,iqx) = w_detJ * (RT ? G : E);
192 Q(3,iqy,iqx) = (ND || RT) ? w_detJ : w*detJ;
196 const real_t E = J(0,0)*J(0,0) + J(1,0)*J(1,0) + J(2,0)*J(2,0);
197 const real_t F = J(0,0)*J(0,1) + J(1,0)*J(1,1) + J(2,0)*J(2,1);
198 const real_t G = J(0,1)*J(0,1) + J(1,1)*J(1,1) + J(2,1)*J(2,1);
199 const real_t detJ = sqrt(E*G - F*F);
200 const real_t w_detJ = w/detJ;
201 Q(0,iqy,iqx) = w_detJ * (RT ? E : G);
202 Q(1,iqy,iqx) = w_detJ * (RT ? F : -F);
203 Q(2,iqy,iqx) = w_detJ * (RT ? G : E);
204 Q(3,iqy,iqx) = (ND || RT) ? w_detJ : w*detJ;
217 J(0,0) = -(1-y)*(1-z)*vx[0]
218 + (1-y)*(1-z)*vx[1] + y*(1-z)*vx[2] - y*(1-z)*vx[3]
219 - (1-y)*z*vx[4] + (1-y)*z*vx[5] + y*z*vx[6] - y*z*vx[7];
221 J(0,1) = -(1-x)*(1-z)*vx[0]
222 - x*(1-z)*vx[1] + x*(1-z)*vx[2] + (1-x)*(1-z)*vx[3]
223 - (1-x)*z*vx[4] - x*z*vx[5] + x*z*vx[6] + (1-x)*z*vx[7];
225 J(0,2) = -(1-x)*(1-y)*vx[0] - x*(1-y)*vx[1]
226 - x*y*vx[2] - (1-x)*y*vx[3] + (1-x)*(1-y)*vx[4]
227 + x*(1-y)*vx[5] + x*y*vx[6] + (1-x)*y*vx[7];
229 J(1,0) = -(1-y)*(1-z)*vy[0] + (1-y)*(1-z)*vy[1]
230 + y*(1-z)*vy[2] - y*(1-z)*vy[3] - (1-y)*z*vy[4]
231 + (1-y)*z*vy[5] + y*z*vy[6] - y*z*vy[7];
233 J(1,1) = -(1-x)*(1-z)*vy[0] - x*(1-z)*vy[1]
234 + x*(1-z)*vy[2] + (1-x)*(1-z)*vy[3]- (1-x)*z*vy[4] -
235 x*z*vy[5] + x*z*vy[6] + (1-x)*z*vy[7];
237 J(1,2) = -(1-x)*(1-y)*vy[0] - x*(1-y)*vy[1]
238 - x*y*vy[2] - (1-x)*y*vy[3] + (1-x)*(1-y)*vy[4]
239 + x*(1-y)*vy[5] + x*y*vy[6] + (1-x)*y*vy[7];
241 J(2,0) = -(1-y)*(1-z)*vz[0] + (1-y)*(1-z)*vz[1]
242 + y*(1-z)*vz[2] - y*(1-z)*vz[3]- (1-y)*z*vz[4] +
243 (1-y)*z*vz[5] + y*z*vz[6] - y*z*vz[7];
245 J(2,1) = -(1-x)*(1-z)*vz[0] - x*(1-z)*vz[1]
246 + x*(1-z)*vz[2] + (1-x)*(1-z)*vz[3] - (1-x)*z*vz[4]
247 - x*z*vz[5] + x*z*vz[6] + (1-x)*z*vz[7];
249 J(2,2) = -(1-x)*(1-y)*vz[0] - x*(1-y)*vz[1]
250 - x*y*vz[2] - (1-x)*y*vz[3] + (1-x)*(1-y)*vz[4]
251 + x*(1-y)*vz[5] + x*y*vz[6] + (1-x)*y*vz[7];
256 A(0,0) = (J(1,1) * J(2,2)) - (J(1,2) * J(2,1));
257 A(0,1) = (J(2,1) * J(0,2)) - (J(0,1) * J(2,2));
258 A(0,2) = (J(0,1) * J(1,2)) - (J(1,1) * J(0,2));
259 A(1,0) = (J(2,0) * J(1,2)) - (J(1,0) * J(2,2));
260 A(1,1) = (J(0,0) * J(2,2)) - (J(0,2) * J(2,0));
261 A(1,2) = (J(1,0) * J(0,2)) - (J(0,0) * J(1,2));
262 A(2,0) = (J(1,0) * J(2,1)) - (J(2,0) * J(1,1));
263 A(2,1) = (J(2,0) * J(0,1)) - (J(0,0) * J(2,1));
264 A(2,2) = (J(0,0) * J(1,1)) - (J(0,1) * J(1,0));
MFEM_HOST_DEVICE void SetupLORQuadData2D(const real_t *X, int iel_ho, int kx, int ky, DeviceTensor< 3 > &Q, bool piola)
MFEM_HOST_DEVICE void Jacobian3D(const real_t x, const real_t y, const real_t z, const real_t vx[8], const real_t vy[8], const real_t vz[8], DeviceMatrix &J)
MFEM_HOST_DEVICE void LORVertexCoordinates3D(const real_t *X, int iel_ho, int kx, int ky, int kz, real_t vx[8], real_t vy[8], real_t vz[8])