xref: /honee/qfunctions/strong_boundary_conditions.h (revision 21ba7ba458ca7fbd5416be1f0b0586f2885778ca)
1dc936754SJeremy L Thompson // Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and other CEED contributors.
22eb7bf1fSJames Wright // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
32eb7bf1fSJames Wright //
42eb7bf1fSJames Wright // SPDX-License-Identifier: BSD-2-Clause
52eb7bf1fSJames Wright //
62eb7bf1fSJames Wright // This file is part of CEED:  http://github.com/ceed
72eb7bf1fSJames Wright #include <ceed.h>
82eb7bf1fSJames Wright 
96f188493SJames Wright #include "setupgeo_helpers.h"
106f188493SJames Wright 
112eb7bf1fSJames Wright CEED_QFUNCTION(SetupStrongBC)(void *ctx, CeedInt Q, const CeedScalar *const *in, CeedScalar *const *out) {
122eb7bf1fSJames Wright   const CeedScalar(*coords)[CEED_Q_VLA]       = (const CeedScalar(*)[CEED_Q_VLA])in[0];
136f188493SJames Wright   const CeedScalar(*dxdX_q)[3][CEED_Q_VLA]    = (const CeedScalar(*)[3][CEED_Q_VLA])in[1];
146f188493SJames Wright   const CeedScalar(*multiplicity)[CEED_Q_VLA] = (const CeedScalar(*)[CEED_Q_VLA])in[2];
152eb7bf1fSJames Wright   CeedScalar(*coords_stored)[CEED_Q_VLA]      = (CeedScalar(*)[CEED_Q_VLA])out[0];
166f188493SJames Wright   CeedScalar(*scale_stored)                   = out[1];
17*21ba7ba4SJames Wright   CeedScalar *dXdx_q                          = out[2];
182eb7bf1fSJames Wright 
192eb7bf1fSJames Wright   CeedPragmaSIMD for (CeedInt i = 0; i < Q; i++) {
202eb7bf1fSJames Wright     for (int j = 0; j < 3; j++) coords_stored[j][i] = coords[j][i];
212eb7bf1fSJames Wright     scale_stored[i] = 1.0 / multiplicity[0][i];
22*21ba7ba4SJames Wright     CeedScalar dXdx[3][3];
23*21ba7ba4SJames Wright     InvertMappingJacobian_3D(Q, i, dxdX_q, dXdx, NULL);
24*21ba7ba4SJames Wright 
25*21ba7ba4SJames Wright     StoredValuesPack(Q, i, 0, 9, (CeedScalar *)dXdx, dXdx_q);
262eb7bf1fSJames Wright   }
272eb7bf1fSJames Wright   return 0;
282eb7bf1fSJames Wright }
29