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_MASS_BUILD_32_QF_H
5 : #define PALACE_LIBCEED_L2_MASS_BUILD_32_QF_H
6 :
7 : #include "../coeff/coeff_1_qf.h"
8 : #include "../coeff/coeff_3_qf.h"
9 : #include "utils_32_qf.h"
10 :
11 0 : CEED_QFUNCTION(f_build_l2mass_32)(void *__restrict__ ctx, CeedInt Q,
12 : const CeedScalar *const *in, CeedScalar *const *out)
13 : {
14 0 : const CeedScalar *attr = in[0], *wdetJ = in[0] + Q, *adjJt = in[0] + 2 * Q, *qw = in[1];
15 0 : CeedScalar *qd1 = out[0], *qd2 = out[0] + 4 * Q;
16 :
17 0 : CeedPragmaSIMD for (CeedInt i = 0; i < Q; i++)
18 : {
19 : {
20 : CeedScalar coeff[9], adjJt_loc[6], J_loc[6], qd_loc[4];
21 0 : CoeffUnpack3((const CeedIntScalar *)ctx, (CeedInt)attr[i], coeff);
22 : MatUnpack32(adjJt + i, Q, adjJt_loc);
23 : AdjJt32(adjJt_loc, J_loc);
24 : MultAtBA32(J_loc, coeff, qd_loc);
25 :
26 0 : qd1[i + Q * 0] = wdetJ[i] * qd_loc[0];
27 0 : qd1[i + Q * 1] = wdetJ[i] * qd_loc[1];
28 0 : qd1[i + Q * 2] = wdetJ[i] * qd_loc[2];
29 0 : qd1[i + Q * 3] = wdetJ[i] * qd_loc[3];
30 : }
31 : {
32 : const CeedScalar coeff =
33 0 : CoeffUnpack1(CoeffPairSecond<3>((const CeedIntScalar *)ctx), (CeedInt)attr[i]);
34 :
35 0 : qd2[i] = coeff * qw[i] * qw[i] / wdetJ[i];
36 : }
37 : }
38 0 : return 0;
39 : }
40 :
41 : #endif // PALACE_LIBCEED_L2_MASS_BUILD_32_QF_H
|