1*a0154adeSJed Brown // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2*a0154adeSJed Brown // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3*a0154adeSJed Brown // 4*a0154adeSJed Brown // SPDX-License-Identifier: BSD-2-Clause 5*a0154adeSJed Brown // 6*a0154adeSJed Brown // This file is part of CEED: http://github.com/ceed 7*a0154adeSJed Brown 8*a0154adeSJed Brown /** 9*a0154adeSJed Brown @brief Ceed QFunction for applying the mass matrix 10*a0154adeSJed Brown **/ 11*a0154adeSJed Brown 12*a0154adeSJed Brown #ifndef massapply_h 13*a0154adeSJed Brown #define massapply_h 14*a0154adeSJed Brown 15*a0154adeSJed Brown CEED_QFUNCTION(MassApply)(void *ctx, const CeedInt Q, 16*a0154adeSJed Brown const CeedScalar *const *in, CeedScalar *const *out) { 17*a0154adeSJed Brown // in[0] is u, size (Q) 18*a0154adeSJed Brown // in[1] is quadrature data, size (Q) 19*a0154adeSJed Brown const CeedScalar *u = in[0], *q_data = in[1]; 20*a0154adeSJed Brown // out[0] is v, size (Q) 21*a0154adeSJed Brown CeedScalar *v = out[0]; 22*a0154adeSJed Brown 23*a0154adeSJed Brown // Quadrature point loop 24*a0154adeSJed Brown CeedPragmaSIMD 25*a0154adeSJed Brown for (CeedInt i=0; i<Q; i++) { 26*a0154adeSJed Brown v[i] = u[i] * q_data[i]; 27*a0154adeSJed Brown } // End of Quadrature Point Loop 28*a0154adeSJed Brown 29*a0154adeSJed Brown return CEED_ERROR_SUCCESS; 30*a0154adeSJed Brown } 31*a0154adeSJed Brown 32*a0154adeSJed Brown #endif // massapply_h 33