// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at // the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights // reserved. See files LICENSE and NOTICE for details. // // This file is part of CEED, a collection of benchmarks, miniapps, software // libraries and APIs for efficient high-order finite element and spectral // element discretizations for exascale applications. For more information and // source code availability see http://github.com/ceed. // // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC, // a collaborative effort of two U.S. Department of Energy organizations (Office // of Science and the National Nuclear Security Administration) responsible for // the planning and preparation of a capable exascale ecosystem, including // software, applications, hardware, advanced system engineering and early // testbed platforms, in support of the nation's exascale computing imperative. /// @file /// Geometric factors for solid mechanics example using PETSc #ifndef COMMON_H #define COMMON_H // ----------------------------------------------------------------------------- // 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 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 // [A11 A12 A13] // (detJ^-1) * [A21 A22 A23] // [A31 A32 A33] // // ----------------------------------------------------------------------------- CEED_QFUNCTION(SetupGeo)(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