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_21_QF_H
5 : #define PALACE_LIBCEED_L2_MASS_21_QF_H
6 :
7 : #include "../coeff/coeff_1_qf.h"
8 : #include "../coeff/coeff_2_qf.h"
9 : #include "utils_21_qf.h"
10 :
11 0 : CEED_QFUNCTION(f_apply_l2mass_21)(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 : *u = in[2], *divu = in[3];
16 0 : CeedScalar *__restrict__ v = out[0], *__restrict__ divv = out[1];
17 :
18 0 : CeedPragmaSIMD for (CeedInt i = 0; i < Q; i++)
19 : {
20 : {
21 0 : const CeedScalar u_loc[1] = {u[i + Q * 0]};
22 : CeedScalar coeff[4], adjJt_loc[2], J_loc[2], v_loc[1];
23 0 : CoeffUnpack2((const CeedIntScalar *)ctx, (CeedInt)attr[i], coeff);
24 0 : MatUnpack21(adjJt + i, Q, adjJt_loc);
25 : AdjJt21(adjJt_loc, J_loc);
26 : MultAtBCx21(J_loc, coeff, J_loc, u_loc, v_loc);
27 :
28 0 : v[i + Q * 0] = wdetJ[i] * v_loc[0];
29 : }
30 : {
31 : const CeedScalar coeff =
32 0 : CoeffUnpack1(CoeffPairSecond<2>((const CeedIntScalar *)ctx), (CeedInt)attr[i]);
33 :
34 0 : divv[i] = (coeff * qw[i] * qw[i] / wdetJ[i]) * divu[i];
35 : }
36 : }
37 0 : return 0;
38 : }
39 :
40 : #endif // PALACE_LIBCEED_L2_MASS_21_QF_H
|