Lines Matching +full:- +full:a

1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
4 // SPDX-License-Identifier: BSD-2-Clause
18 CEED_QFUNCTION_HELPER CeedScalar Max(CeedScalar a, CeedScalar b) { return a < b ? b : a; } in Max() argument
19 CEED_QFUNCTION_HELPER CeedScalar Min(CeedScalar a, CeedScalar b) { return a < b ? a : b; } in Min() argument
21 CEED_QFUNCTION_HELPER void SwapScalar(CeedScalar *a, CeedScalar *b) { in SwapScalar() argument
22 CeedScalar temp = *a; in SwapScalar()
23 *a = *b; in SwapScalar()
35 // @brief Set vector of length N to a value alpha
43 // @brief Copy 3x3 matrix from A to B
44 …FUNCTION_HELPER void CopyMat3(const CeedScalar A[3][3], CeedScalar B[3][3]) { CopyN((const CeedSca… in CopyMat3()
58 w[0] = (u[1] * v[2]) - (u[2] * v[1]); in Cross3()
59 w[1] = (u[2] * v[0]) - (u[0] * v[2]); in Cross3()
60 w[2] = (u[0] * v[1]) - (u[1] * v[0]); in Cross3()
65 v[0] = gradient[2][1] - gradient[1][2]; in Curl3()
66 v[1] = gradient[0][2] - gradient[2][0]; in Curl3()
67 v[2] = gradient[1][0] - gradient[0][1]; in Curl3()
70 // @brief Matrix vector product, b = Ax + b. A is NxM, x is M, b is N
71 CEED_QFUNCTION_HELPER void MatVecNM(const CeedScalar *A, const CeedScalar *x, const CeedInt N, cons… in MatVecNM() argument
75 CeedPragmaSIMD for (CeedInt i = 0; i < N; i++) b[i] += DotN(&A[i * M], x, M); in MatVecNM()
78 … i = 0; i < M; i++) { CeedPragmaSIMD for (CeedInt j = 0; j < N; j++) b[i] += A[j * M + i] * x[j]; } in MatVecNM()
84 CEED_QFUNCTION_HELPER void MatVec3(const CeedScalar A[3][3], const CeedScalar x[3], const CeedTrans… in MatVec3()
85 MatVecNM((const CeedScalar *)A, (const CeedScalar *)x, 3, 3, transpose_A, (CeedScalar *)b); in MatVec3()
88 // @brief Matrix-Matrix product, B = DA + B, where D is diagonal.
89 // @details A is NxM, D is diagonal NxN, represented by a vector of length N, and B is NxM. Optiona…
90 CEED_QFUNCTION_HELPER void MatDiagNM(const CeedScalar *A, const CeedScalar *D, const CeedInt N, con… in MatDiagNM() argument
94 …i < N; i++) { CeedPragmaSIMD for (CeedInt j = 0; j < M; j++) B[i * M + j] += D[i] * A[i * M + j]; } in MatDiagNM()
97 …i < M; i++) { CeedPragmaSIMD for (CeedInt j = 0; j < N; j++) B[i * N + j] += D[i] * A[j * M + i]; } in MatDiagNM()
102 // @brief 3x3 Matrix-Matrix product, B = DA + B, where D is diagonal.
103 // @details Optionally, A may be transposed.
104 CEED_QFUNCTION_HELPER void MatDiag3(const CeedScalar A[3][3], const CeedScalar D[3], const CeedTran… in MatDiag3()
105 MatDiagNM((const CeedScalar *)A, (const CeedScalar *)D, 3, 3, transpose_A, (CeedScalar *)B); in MatDiag3()
107 // @brief NxN Matrix-Matrix product, C = AB + C
108 CEED_QFUNCTION_HELPER void MatMatN(const CeedScalar *A, const CeedScalar *B, const CeedInt N, const… in MatMatN() argument
116 … CeedPragmaSIMD for (CeedInt k = 0; k < N; k++) C[i * N + j] += A[i * N + k] * B[k * N + j]; in MatMatN()
123 … CeedPragmaSIMD for (CeedInt k = 0; k < N; k++) C[i * N + j] += A[i * N + k] * B[j * N + k]; in MatMatN()
134 … CeedPragmaSIMD for (CeedInt k = 0; k < N; k++) C[i * N + j] += A[k * N + i] * B[k * N + j]; in MatMatN()
141 … CeedPragmaSIMD for (CeedInt k = 0; k < N; k++) C[i * N + j] += A[k * N + i] * B[j * N + k]; in MatMatN()
150 // @brief 3x3 Matrix-Matrix product, C = AB + C
151 CEED_QFUNCTION_HELPER void MatMat3(const CeedScalar A[3][3], const CeedScalar B[3][3], const CeedTr… in MatMat3()
153 …MatMatN((const CeedScalar *)A, (const CeedScalar *)B, 3, transpose_A, transpose_B, (CeedScalar *)C… in MatMat3()
156 // @brief Unpack Kelvin-Mandel notation symmetric tensor into full tensor
157 CEED_QFUNCTION_HELPER void KMUnpack(const CeedScalar v[6], CeedScalar A[3][3]) { in KMUnpack()
159 A[0][0] = v[0]; in KMUnpack()
160 A[1][1] = v[1]; in KMUnpack()
161 A[2][2] = v[2]; in KMUnpack()
162 A[2][1] = A[1][2] = weight * v[3]; in KMUnpack()
163 A[2][0] = A[0][2] = weight * v[4]; in KMUnpack()
164 A[1][0] = A[0][1] = weight * v[5]; in KMUnpack()
167 // @brief Pack full tensor into Kelvin-Mandel notation symmetric tensor
168 CEED_QFUNCTION_HELPER void KMPack(const CeedScalar A[3][3], CeedScalar v[6]) { in KMPack()
170 v[0] = A[0][0]; in KMPack()
171 v[1] = A[1][1]; in KMPack()
172 v[2] = A[2][2]; in KMPack()
173 v[3] = A[2][1] * weight; in KMPack()
174 v[4] = A[2][0] * weight; in KMPack()
175 v[5] = A[1][0] * weight; in KMPack()
190 return amplitude * ((x - start) * (-1 / length) + 1); in LinearRampCoefficient()
206 @return An error code: 0 - success, otherwise - failure
225 @return An error code: 0 - success, otherwise - failure
243 @return An error code: 0 - success, otherwise - failure
261 @return An error code: 0 - success, otherwise - failure
280 @return An error code: 0 - success, otherwise - failure
297 @return An error code: 0 - success, otherwise - failure