xref: /honee/qfunctions/strong_boundary_conditions.h (revision dc936754fc0ae21fa21dd641901ba00fc24c3769)
1*dc936754SJeremy 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 
82eb7bf1fSJames Wright #ifndef strong_boundary_conditions_h
92eb7bf1fSJames Wright #define strong_boundary_conditions_h
102eb7bf1fSJames Wright 
112eb7bf1fSJames Wright #include <ceed.h>
122eb7bf1fSJames Wright 
136f188493SJames Wright #include "setupgeo_helpers.h"
146f188493SJames Wright 
152eb7bf1fSJames Wright CEED_QFUNCTION(SetupStrongBC)(void *ctx, CeedInt Q, const CeedScalar *const *in, CeedScalar *const *out) {
162eb7bf1fSJames Wright   // Inputs
172eb7bf1fSJames Wright   const CeedScalar(*coords)[CEED_Q_VLA]       = (const CeedScalar(*)[CEED_Q_VLA])in[0];
186f188493SJames Wright   const CeedScalar(*dxdX_q)[3][CEED_Q_VLA]    = (const CeedScalar(*)[3][CEED_Q_VLA])in[1];
196f188493SJames Wright   const CeedScalar(*multiplicity)[CEED_Q_VLA] = (const CeedScalar(*)[CEED_Q_VLA])in[2];
202eb7bf1fSJames Wright 
212eb7bf1fSJames Wright   // Outputs
222eb7bf1fSJames Wright   CeedScalar(*coords_stored)[CEED_Q_VLA] = (CeedScalar(*)[CEED_Q_VLA])out[0];
236f188493SJames Wright   CeedScalar(*scale_stored)              = out[1];
246f188493SJames Wright   CeedScalar(*dXdx_q)[CEED_Q_VLA]        = (CeedScalar(*)[CEED_Q_VLA])out[2];
252eb7bf1fSJames Wright 
262eb7bf1fSJames Wright   CeedPragmaSIMD for (CeedInt i = 0; i < Q; i++) {
272eb7bf1fSJames Wright     for (int j = 0; j < 3; j++) coords_stored[j][i] = coords[j][i];
282eb7bf1fSJames Wright     scale_stored[i] = 1.0 / multiplicity[0][i];
296f188493SJames Wright     CeedScalar dXdx[2][3];
306f188493SJames Wright     InvertBoundaryMappingJacobian_3D(Q, i, dxdX_q, dXdx);
316f188493SJames Wright     dXdx_q[0][i] = dXdx[0][0];
326f188493SJames Wright     dXdx_q[1][i] = dXdx[0][1];
336f188493SJames Wright     dXdx_q[2][i] = dXdx[0][2];
346f188493SJames Wright     dXdx_q[3][i] = dXdx[1][0];
356f188493SJames Wright     dXdx_q[4][i] = dXdx[1][1];
366f188493SJames Wright     dXdx_q[5][i] = dXdx[1][2];
372eb7bf1fSJames Wright   }
382eb7bf1fSJames Wright   return 0;
392eb7bf1fSJames Wright }
402eb7bf1fSJames Wright 
412eb7bf1fSJames Wright #endif  // strong_boundary_conditions_h
42