1 // Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3 // 4 // SPDX-License-Identifier: BSD-2-Clause 5 // 6 // This file is part of CEED: http://github.com/ceed 7 #include <ceed.h> 8 9 #include "setupgeo_helpers.h" 10 11 CEED_QFUNCTION(SetupStrongBC)(void *ctx, CeedInt Q, const CeedScalar *const *in, CeedScalar *const *out) { 12 // Inputs 13 const CeedScalar(*coords)[CEED_Q_VLA] = (const CeedScalar(*)[CEED_Q_VLA])in[0]; 14 const CeedScalar(*dxdX_q)[3][CEED_Q_VLA] = (const CeedScalar(*)[3][CEED_Q_VLA])in[1]; 15 const CeedScalar(*multiplicity)[CEED_Q_VLA] = (const CeedScalar(*)[CEED_Q_VLA])in[2]; 16 17 // Outputs 18 CeedScalar(*coords_stored)[CEED_Q_VLA] = (CeedScalar(*)[CEED_Q_VLA])out[0]; 19 CeedScalar(*scale_stored) = out[1]; 20 CeedScalar(*dXdx_q)[CEED_Q_VLA] = (CeedScalar(*)[CEED_Q_VLA])out[2]; 21 22 CeedPragmaSIMD for (CeedInt i = 0; i < Q; i++) { 23 for (int j = 0; j < 3; j++) coords_stored[j][i] = coords[j][i]; 24 scale_stored[i] = 1.0 / multiplicity[0][i]; 25 CeedScalar dXdx[2][3]; 26 InvertBoundaryMappingJacobian_3D(Q, i, dxdX_q, dXdx); 27 dXdx_q[0][i] = dXdx[0][0]; 28 dXdx_q[1][i] = dXdx[0][1]; 29 dXdx_q[2][i] = dXdx[0][2]; 30 dXdx_q[3][i] = dXdx[1][0]; 31 dXdx_q[4][i] = dXdx[1][1]; 32 dXdx_q[5][i] = dXdx[1][2]; 33 } 34 return 0; 35 } 36