// 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 areasphere_h #define areasphere_h #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 3D physical coordinates given by the mesh: xx \in [-R, R]^3 // with R radius of the sphere // // Local 3D physical coordinates on the 2D manifold: x \in [-l, l]^3 // with l half edge of the cube inscribed in the sphere // // 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 (on the 2D manifold) relative to xx (phyisical 3D): // dx_i/dxx_j (indicial notation) [3 * 3] // // Change of coordinates x (on the 2D manifold) relative to X (reference 2D): // (by chain rule) // dx_i/dX_j = dx_i/dxx_k * dxx_k/dX_j [3 * 2] // // mod_J is given by the magnitude of the cross product of the columns of dx_i/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: mod_J * w // // ----------------------------------------------------------------------------- CEED_QFUNCTION(SetupMassGeoSphere)(void *ctx, const CeedInt Q, const CeedScalar *const *in, CeedScalar *const *out) { // Inputs const CeedScalar *X = in[0], *J = in[1], *w = in[2]; // Outputs CeedScalar *q_data = out[0]; // Quadrature Point Loop CeedPragmaSIMD for (CeedInt i=0; i