1*0b6847a6SJeremy L Thompson // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
2*0b6847a6SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3*0b6847a6SJeremy L Thompson //
4*0b6847a6SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
5*0b6847a6SJeremy L Thompson //
6*0b6847a6SJeremy L Thompson // This file is part of CEED: http://github.com/ceed
7*0b6847a6SJeremy L Thompson
8*0b6847a6SJeremy L Thompson /**
9*0b6847a6SJeremy L Thompson @brief Identity QFunction that copies first input component directly into output
10*0b6847a6SJeremy L Thompson **/
11*0b6847a6SJeremy L Thompson #include <ceed/types.h>
12*0b6847a6SJeremy L Thompson
IdentityScalar(void * ctx,const CeedInt Q,const CeedScalar * const * in,CeedScalar * const * out)13*0b6847a6SJeremy L Thompson CEED_QFUNCTION(IdentityScalar)(void *ctx, const CeedInt Q, const CeedScalar *const *in, CeedScalar *const *out) {
14*0b6847a6SJeremy L Thompson // in[0] is input, size (Q*size)
15*0b6847a6SJeremy L Thompson const CeedScalar *input = in[0];
16*0b6847a6SJeremy L Thompson // out[0] is output, size (Q)
17*0b6847a6SJeremy L Thompson CeedScalar *output = out[0];
18*0b6847a6SJeremy L Thompson
19*0b6847a6SJeremy L Thompson // Quadrature point loop
20*0b6847a6SJeremy L Thompson CeedPragmaSIMD for (CeedInt i = 0; i < Q; i++) { output[i] = input[i]; } // End of Quadrature Point Loop
21*0b6847a6SJeremy L Thompson return CEED_ERROR_SUCCESS;
22*0b6847a6SJeremy L Thompson }
23