// 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 /// Geometric factors (3D) for Navier-Stokes example using PETSc #ifndef setup_geo_h #define setup_geo_h #include #include // ***************************************************************************** // This QFunction sets up the geometric factors required for integration and // coordinate transformations // // Reference (parent) coordinates: X // Physical (current) coordinates: x // Change of coordinate matrix: dxdX_{i,j} = x_{i,j} (indicial notation) // Inverse of change of coordinate matrix: dXdx_{i,j} = (detJ^-1) * X_{i,j} // // All quadrature data is stored in 10 field vector of quadrature data. // // We require the determinant of the Jacobian to properly compute integrals of // the form: int( v u ) // // Determinant of Jacobian: // detJ = J11*A11 + J21*A12 + J31*A13 // Jij = Jacobian entry ij // Aij = Adjoint ij // // Stored: w detJ // in q_data[0] // // We require the transpose of the inverse of the Jacobian to properly compute // integrals of the form: int( gradv u ) // // Inverse of Jacobian: // dXdx_i,j = Aij / detJ // // Stored: Aij / detJ // in q_data[1:9] as // (detJ^-1) * [A11 A12 A13] // [A21 A22 A23] // [A31 A32 A33] // // ***************************************************************************** CEED_QFUNCTION(Setup)(void *ctx, CeedInt Q, const CeedScalar *const *in, CeedScalar *const *out) { // *INDENT-OFF* // Inputs const CeedScalar (*J)[3][CEED_Q_VLA] = (const CeedScalar(*)[3][CEED_Q_VLA])in[0], (*w) = in[1]; // Outputs CeedScalar (*q_data)[CEED_Q_VLA] = (CeedScalar(*)[CEED_Q_VLA])out[0]; // *INDENT-ON* CeedPragmaSIMD // Quadrature Point Loop for (CeedInt i=0; i