// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. // // SPDX-License-Identifier: BSD-2-Clause // // This file is part of CEED: http://github.com/ceed /// @file /// libCEED QFunctions for mass operator example for a scalar field on the sphere using PETSc #ifndef areacube_h #define areacube_h #include #include // ----------------------------------------------------------------------------- // This QFunction sets up the geometric factor required for integration when // reference coordinates have a different dimension than the one of // physical coordinates // // Reference (parent) 2D coordinates: X \in [-1, 1]^2 // // Global physical coordinates given by the mesh (3D): xx \in [-l, l]^3 // // Local physical coordinates on the manifold (2D): x \in [-l, l]^2 // // Change of coordinates matrix computed by the library: // (physical 3D coords relative to reference 2D coords) // dxx_j/dX_i (indicial notation) [3 * 2] // // Change of coordinates x (physical 2D) relative to xx (phyisical 3D): // dx_i/dxx_j (indicial notation) [2 * 3] // // Change of coordinates x (physical 2D) relative to X (reference 2D): // (by chain rule) // dx_i/dX_j = dx_i/dxx_k * dxx_k/dX_j // // The quadrature data is stored in the array q_data. // // We require the determinant of the Jacobian to properly compute integrals of // the form: int( u v ) // // Qdata: w * det(dx_i/dX_j) // // ----------------------------------------------------------------------------- CEED_QFUNCTION(SetupMassGeoCube)(void *ctx, const CeedInt Q, const CeedScalar *const *in, CeedScalar *const *out) { // Inputs const CeedScalar *J = in[1], *w = in[2]; // Outputs CeedScalar *q_data = out[0]; // Quadrature Point Loop CeedPragmaSIMD for (CeedInt i=0; i