1*3d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2*3d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 34d537eeaSYohann // 4*3d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause 54d537eeaSYohann // 6*3d8e8822SJeremy L Thompson // This file is part of CEED: http://github.com/ceed 74d537eeaSYohann 84d537eeaSYohann CEED_QFUNCTION(setup)(void *ctx, const CeedInt Q, 94d537eeaSYohann const CeedScalar *const *in, 104d537eeaSYohann CeedScalar *const *out) { 114d537eeaSYohann const CeedScalar *weight = in[0], *dxdX = in[1]; 124d537eeaSYohann CeedScalar *rho = out[0]; 134d537eeaSYohann for (CeedInt i=0; i<Q; i++) { 144d537eeaSYohann rho[i] = weight[i] * dxdX[i]; 154d537eeaSYohann } 164d537eeaSYohann return 0; 174d537eeaSYohann } 184d537eeaSYohann 194d537eeaSYohann CEED_QFUNCTION(mass)(void *ctx, const CeedInt Q, const CeedScalar *const *in, 204d537eeaSYohann CeedScalar *const *out) { 214d537eeaSYohann const CeedScalar *rho = in[0], *u = in[1]; 224d537eeaSYohann CeedScalar *v = out[0]; 234d537eeaSYohann for (CeedInt i=0; i<Q; i++) { 244d537eeaSYohann v[i] = rho[i] * u[i]; 254d537eeaSYohann v[Q+i] = rho[i] * u[Q+i]; 264d537eeaSYohann } 274d537eeaSYohann return 0; 284d537eeaSYohann } 29