105 const int eval_flags)
107 const int nd1d = maps.
ndof;
108 const int nq1d = maps.
nqpt;
109 const int ND1D = T_ND1D ? T_ND1D : nd1d;
110 const int NQ1D = T_NQ1D ? T_NQ1D : nq1d;
111 const int VDIM = T_VDIM ? T_VDIM : vdim;
114 MFEM_VERIFY(VDIM == 2 || !(eval_flags &
DETERMINANTS),
"");
118 auto sign = signs.
Read();
132 const int ND1D = T_ND1D ? T_ND1D : nd1d;
133 const int NQ1D = T_NQ1D ? T_NQ1D : nq1d;
134 const int VDIM = T_VDIM ? T_VDIM : vdim;
135 constexpr int max_ND1D = T_ND1D ? T_ND1D :
MAX_ND1D;
136 constexpr int max_VDIM = T_VDIM ? T_VDIM :
MAX_VDIM2D;
137 real_t r_F[max_ND1D][max_VDIM];
138 for (
int d = 0; d < ND1D; d++)
140 for (
int c = 0; c < VDIM; c++)
142 r_F[d][c] = F(d,c,
f);
145 for (
int q = 0; q < NQ1D; ++q)
150 for (
int c = 0; c < VDIM; c++) { ed[c] = 0.0; }
151 for (
int d = 0; d < ND1D; ++d)
154 for (
int c = 0; c < VDIM; c++) { ed[c] +=
b*r_F[d][c]; }
156 for (
int c = 0; c < VDIM; c++)
167 for (
int i = 0; i < VDIM; i++) { D[i] = 0.0; }
168 for (
int d = 0; d < ND1D; ++d)
171 for (
int c = 0; c < VDIM; c++)
179 for (
int c = 0; c < VDIM; c++)
195 const real_t norm = sqrt(D[0]*D[0]+D[1]*D[1]);
202 const real_t s = sign[
f] ? -1.0 : 1.0;
205 n(0,q,
f) = s*D[1]/norm;
206 n(1,q,
f) = -s*D[0]/norm;
210 n(q,0,
f) = s*D[1]/norm;
211 n(q,1,
f) = -s*D[0]/norm;
232 const int eval_flags)
234 const int nd1d = maps.
ndof;
235 const int nq1d = maps.
nqpt;
236 const int ND1D = T_ND1D ? T_ND1D : nd1d;
237 const int NQ1D = T_NQ1D ? T_NQ1D : nq1d;
238 const int VDIM = T_VDIM ? T_VDIM : vdim;
241 MFEM_VERIFY(VDIM == 3 || !(eval_flags &
DETERMINANTS),
"");
244 auto F =
Reshape(e_vec.
Read(), ND1D, ND1D, VDIM, NF);
245 auto sign = signs.
Read();
258 constexpr int max_ND1D = T_ND1D ? T_ND1D :
MAX_ND1D;
259 constexpr int max_NQ1D = T_NQ1D ? T_NQ1D :
MAX_NQ1D;
260 constexpr int max_VDIM = T_VDIM ? T_VDIM :
MAX_VDIM3D;
261 real_t r_F[max_ND1D][max_ND1D][max_VDIM];
262 for (
int d1 = 0; d1 < ND1D; d1++)
264 for (
int d2 = 0; d2 < ND1D; d2++)
266 for (
int c = 0; c < VDIM; c++)
268 r_F[d1][d2][c] = F(d1,d2,c,
f);
274 real_t Bu[max_NQ1D][max_ND1D][max_VDIM];
275 for (
int d2 = 0; d2 < ND1D; ++d2)
277 for (
int q = 0; q < NQ1D; ++q)
279 for (
int c = 0; c < VDIM; c++) { Bu[q][d2][c] = 0.0; }
280 for (
int d1 = 0; d1 < ND1D; ++d1)
283 for (
int c = 0; c < VDIM; c++)
285 Bu[q][d2][c] +=
b*r_F[d1][d2][c];
290 real_t BBu[max_NQ1D][max_NQ1D][max_VDIM];
291 for (
int q2 = 0; q2 < NQ1D; ++q2)
293 for (
int q1 = 0; q1 < NQ1D; ++q1)
295 for (
int c = 0; c < VDIM; c++) { BBu[q2][q1][c] = 0.0; }
296 for (
int d2 = 0; d2 < ND1D; ++d2)
299 for (
int c = 0; c < VDIM; c++)
301 BBu[q2][q1][c] +=
b*Bu[q1][d2][c];
304 for (
int c = 0; c < VDIM; c++)
306 const real_t v = BBu[q2][q1][c];
318 real_t Gu[max_NQ1D][max_ND1D][max_VDIM];
319 real_t Bu[max_NQ1D][max_ND1D][max_VDIM];
320 for (
int d2 = 0; d2 < ND1D; ++d2)
322 for (
int q = 0; q < NQ1D; ++q)
324 for (
int c = 0; c < VDIM; c++)
329 for (
int d1 = 0; d1 < ND1D; ++d1)
333 for (
int c = 0; c < VDIM; c++)
335 const real_t u = r_F[d1][d2][c];
342 real_t BGu[max_NQ1D][max_NQ1D][max_VDIM];
343 real_t GBu[max_NQ1D][max_NQ1D][max_VDIM];
344 for (
int q2 = 0; q2 < NQ1D; ++q2)
346 for (
int q1 = 0; q1 < NQ1D; ++q1)
348 for (
int c = 0; c < VDIM; c++)
350 BGu[q2][q1][c] = 0.0;
351 GBu[q2][q1][c] = 0.0;
353 for (
int d2 = 0; d2 < ND1D; ++d2)
356 const real_t g = G(q2,d2);
357 for (
int c = 0; c < VDIM; c++)
359 BGu[q2][q1][c] +=
b*Gu[q1][d2][c];
360 GBu[q2][q1][c] += g*Bu[q1][d2][c];
367 for (
int c = 0; c < VDIM; c++)
369 for (
int q2 = 0; q2 < NQ1D; ++q2)
371 for (
int q1 = 0; q1 < NQ1D; ++q1)
375 der(c,0,q1,q2,
f) = BGu[q2][q1][c];
376 der(c,1,q1,q2,
f) = GBu[q2][q1][c];
380 der(q1,q2,c,0,
f) = BGu[q2][q1][c];
381 der(q1,q2,c,1,
f) = GBu[q2][q1][c];
387 if (VDIM == 3 && ((eval_flags &
NORMALS) ||
391 for (
int q2 = 0; q2 < NQ1D; ++q2)
393 for (
int q1 = 0; q1 < NQ1D; ++q1)
395 const real_t s = sign[
f] ? -1.0 : 1.0;
396 n[0] = s*( BGu[q2][q1][1]*GBu[q2][q1][2]-GBu[q2][q1][1]*
398 n[1] = s*(-BGu[q2][q1][0]*GBu[q2][q1][2]+GBu[q2][q1][0]*
400 n[2] = s*( BGu[q2][q1][0]*GBu[q2][q1][1]-GBu[q2][q1][0]*
402 const real_t norm = sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);
408 nor(0,q1,q2,
f) = n[0]/norm;
409 nor(1,q1,q2,
f) = n[1]/norm;
410 nor(2,q1,q2,
f) = n[2]/norm;
414 nor(q1,q2,0,
f) = n[0]/norm;
415 nor(q1,q2,1,
f) = n[1]/norm;
416 nor(q1,q2,2,
f) = n[2]/norm;
438 const int eval_flags)
440 MFEM_PERF_SCOPE(
"FaceQuadInterpolator::SmemEval3D");
441 const int nd1d = maps.
ndof;
442 const int nq1d = maps.
nqpt;
443 const int ND1D = T_ND1D ? T_ND1D : nd1d;
444 const int NQ1D = T_NQ1D ? T_NQ1D : nq1d;
445 const int VDIM = T_VDIM ? T_VDIM : vdim;
448 MFEM_VERIFY(VDIM == 3 || !(eval_flags &
DETERMINANTS),
"");
451 auto F =
Reshape(e_vec.
Read(), ND1D, ND1D, VDIM, NF);
452 auto sign = signs.
Read();
466 constexpr int max_ND1D = T_ND1D ? T_ND1D :
MAX_ND1D;
467 constexpr int max_NQ1D = T_NQ1D ? T_NQ1D :
MAX_NQ1D;
468 constexpr int max_VDIM = T_VDIM ? T_VDIM :
MAX_VDIM3D;
470 MFEM_SHARED
real_t sm1[max_NQ1D*max_NQ1D*max_VDIM];
471 MFEM_SHARED
real_t sm2[max_NQ1D*max_ND1D*max_VDIM];
473 auto s_F = (
real_t(*)[max_ND1D][max_VDIM])sm1;
474 MFEM_FOREACH_THREAD(d1,x,ND1D)
476 MFEM_FOREACH_THREAD(d2,y,ND1D)
478 MFEM_FOREACH_THREAD(c,z,VDIM)
480 s_F[d1][d2][c] = F(d1,d2,c,
f);
488 auto Bu = (
real_t (*)[max_ND1D][max_VDIM])sm2;
489 MFEM_FOREACH_THREAD(d2,x,ND1D)
491 MFEM_FOREACH_THREAD(q1,y,NQ1D)
493 MFEM_FOREACH_THREAD(c,z,VDIM)
496 for (
int d1 = 0; d1 < ND1D; ++d1)
498 thrdBu += B(q1,d1)*s_F[d1][d2][c];
500 Bu[q1][d2][c] = thrdBu;
506 MFEM_FOREACH_THREAD(q2,x,NQ1D)
508 MFEM_FOREACH_THREAD(q1,y,NQ1D)
510 MFEM_FOREACH_THREAD(c,z,VDIM)
513 for (
int d2 = 0; d2 < ND1D; ++d2)
515 v += B(q2,d2)*Bu[q1][d2][c];
529 auto Gu = (
real_t (*)[max_ND1D][max_VDIM])sm2;
530 MFEM_SHARED
real_t Bu[max_NQ1D][max_ND1D][max_VDIM];
531 MFEM_FOREACH_THREAD(d2,x,ND1D)
533 MFEM_FOREACH_THREAD(q1,y,NQ1D)
535 MFEM_FOREACH_THREAD(c,z,VDIM)
539 for (
int d1 = 0; d1 < ND1D; ++d1)
541 const real_t u = s_F[d1][d2][c];
542 thrdBu += B(q1,d1)*
u;
543 thrdGu += G(q1,d1)*
u;
545 Gu[q1][d2][c] = thrdGu;
546 Bu[q1][d2][c] = thrdBu;
552 auto BGu = (
real_t (*)[max_NQ1D][max_VDIM])sm1;
553 MFEM_SHARED
real_t GBu[max_NQ1D][max_NQ1D][max_VDIM];
554 MFEM_FOREACH_THREAD(q2,x,NQ1D)
556 MFEM_FOREACH_THREAD(q1,y,NQ1D)
558 MFEM_FOREACH_THREAD(c,z,VDIM)
562 for (
int d2 = 0; d2 < ND1D; ++d2)
564 thrdBGu += B(q2,d2)*Gu[q1][d2][c];
565 thrdGBu += G(q2,d2)*Bu[q1][d2][c];
567 BGu[q2][q1][c] = thrdBGu;
568 GBu[q2][q1][c] = thrdGBu;
576 MFEM_FOREACH_THREAD(q2,x,NQ1D)
578 MFEM_FOREACH_THREAD(q1,y,NQ1D)
580 MFEM_FOREACH_THREAD(c,z,VDIM)
584 der(c,0,q1,q2,
f) = BGu[q2][q1][c];
585 der(c,1,q1,q2,
f) = GBu[q2][q1][c];
589 der(q1,q2,c,0,
f) = BGu[q2][q1][c];
590 der(q1,q2,c,1,
f) = GBu[q2][q1][c];
597 if (VDIM == 3 && ((eval_flags &
NORMALS) ||
601 MFEM_FOREACH_THREAD(q2,x,NQ1D)
603 MFEM_FOREACH_THREAD(q1,y,NQ1D)
605 if (MFEM_THREAD_ID(z) == 0)
607 const real_t s = sign[
f] ? -1.0 : 1.0;
608 n[0] = s*( BGu[q2][q1][1]*GBu[q2][q1][2]-GBu[q2][q1][1]*
610 n[1] = s*(-BGu[q2][q1][0]*GBu[q2][q1][2]+GBu[q2][q1][0]*
612 n[2] = s*( BGu[q2][q1][0]*GBu[q2][q1][1]-GBu[q2][q1][0]*
615 const real_t norm = sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);
623 nor(0,q1,q2,
f) = n[0]/norm;
624 nor(1,q1,q2,
f) = n[1]/norm;
625 nor(2,q1,q2,
f) = n[2]/norm;
629 nor(q1,q2,0,
f) = n[0]/norm;
630 nor(q1,q2,1,
f) = n[1]/norm;
631 nor(q1,q2,2,
f) = n[2]/norm;