Line data Source code
1 : // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 : // SPDX-License-Identifier: Apache-2.0
3 :
4 : #ifndef PALACE_LIBCEED_L2_2_QF_H
5 : #define PALACE_LIBCEED_L2_2_QF_H
6 :
7 : #include "../coeff/coeff_2_qf.h"
8 :
9 0 : CEED_QFUNCTION(f_apply_l2_2)(void *__restrict__ ctx, CeedInt Q, const CeedScalar *const *in,
10 : CeedScalar *const *out)
11 : {
12 0 : const CeedScalar *attr = in[0], *wdetJ = in[0] + Q, *qw = in[1], *u = in[2];
13 0 : CeedScalar *v = out[0];
14 :
15 0 : CeedPragmaSIMD for (CeedInt i = 0; i < Q; i++)
16 : {
17 : CeedScalar coeff[4];
18 0 : CoeffUnpack2((const CeedIntScalar *)ctx, (CeedInt)attr[i], coeff);
19 0 : const CeedScalar w = qw[i] * qw[i] / wdetJ[i];
20 :
21 0 : const CeedScalar u0 = u[i + Q * 0];
22 0 : const CeedScalar u1 = u[i + Q * 1];
23 0 : v[i + Q * 0] = w * (coeff[0] * u0 + coeff[2] * u1);
24 0 : v[i + Q * 1] = w * (coeff[1] * u0 + coeff[3] * u1);
25 : }
26 0 : return 0;
27 : }
28 :
29 : #endif // PALACE_LIBCEED_L2_2_QF_H
|