1*6a6224a1SJeremy L Thompson // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC. 2*6a6224a1SJeremy L Thompson // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707. 3*6a6224a1SJeremy L Thompson // All Rights reserved. See files LICENSE and NOTICE for details. 4*6a6224a1SJeremy L Thompson // 5*6a6224a1SJeremy L Thompson // This file is part of CEED, a collection of benchmarks, miniapps, software 6*6a6224a1SJeremy L Thompson // libraries and APIs for efficient high-order finite element and spectral 7*6a6224a1SJeremy L Thompson // element discretizations for exascale applications. For more information and 8*6a6224a1SJeremy L Thompson // source code availability see http://github.com/ceed. 9*6a6224a1SJeremy L Thompson // 10*6a6224a1SJeremy L Thompson // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC, 11*6a6224a1SJeremy L Thompson // a collaborative effort of two U.S. Department of Energy organizations (Office 12*6a6224a1SJeremy L Thompson // of Science and the National Nuclear Security Administration) responsible for 13*6a6224a1SJeremy L Thompson // the planning and preparation of a capable exascale ecosystem, including 14*6a6224a1SJeremy L Thompson // software, applications, hardware, advanced system engineering and early 15*6a6224a1SJeremy L Thompson // testbed platforms, in support of the nation's exascale computing imperative. 16*6a6224a1SJeremy L Thompson 17*6a6224a1SJeremy L Thompson #include <ceed/ceed.h> 18*6a6224a1SJeremy L Thompson #include <ceed/backend.h> 19*6a6224a1SJeremy L Thompson #include <string.h> 20*6a6224a1SJeremy L Thompson #include "ceed-mass2dbuild.h" 21*6a6224a1SJeremy L Thompson 22*6a6224a1SJeremy L Thompson /** 23*6a6224a1SJeremy L Thompson @brief Set fields for Ceed QFunction building the geometric data for the 2D 24*6a6224a1SJeremy L Thompson mass matrix 25*6a6224a1SJeremy L Thompson **/ 26*6a6224a1SJeremy L Thompson static int CeedQFunctionInit_Mass2DBuild(Ceed ceed, const char *requested, 27*6a6224a1SJeremy L Thompson CeedQFunction qf) { 28*6a6224a1SJeremy L Thompson int ierr; 29*6a6224a1SJeremy L Thompson 30*6a6224a1SJeremy L Thompson // Check QFunction name 31*6a6224a1SJeremy L Thompson const char *name = "Mass2DBuild"; 32*6a6224a1SJeremy L Thompson if (strcmp(name, requested)) 33*6a6224a1SJeremy L Thompson // LCOV_EXCL_START 34*6a6224a1SJeremy L Thompson return CeedError(ceed, CEED_ERROR_UNSUPPORTED, 35*6a6224a1SJeremy L Thompson "QFunction '%s' does not match requested name: %s", 36*6a6224a1SJeremy L Thompson name, requested); 37*6a6224a1SJeremy L Thompson // LCOV_EXCL_STOP 38*6a6224a1SJeremy L Thompson 39*6a6224a1SJeremy L Thompson // Add QFunction fields 40*6a6224a1SJeremy L Thompson const CeedInt dim = 2; 41*6a6224a1SJeremy L Thompson ierr = CeedQFunctionAddInput(qf, "dx", dim*dim, CEED_EVAL_GRAD); 42*6a6224a1SJeremy L Thompson CeedChk(ierr); 43*6a6224a1SJeremy L Thompson ierr = CeedQFunctionAddInput(qf, "weights", 1, CEED_EVAL_WEIGHT); 44*6a6224a1SJeremy L Thompson CeedChk(ierr); 45*6a6224a1SJeremy L Thompson ierr = CeedQFunctionAddOutput(qf, "qdata", 1, CEED_EVAL_NONE); CeedChk(ierr); 46*6a6224a1SJeremy L Thompson 47*6a6224a1SJeremy L Thompson return CEED_ERROR_SUCCESS; 48*6a6224a1SJeremy L Thompson } 49*6a6224a1SJeremy L Thompson 50*6a6224a1SJeremy L Thompson /** 51*6a6224a1SJeremy L Thompson @brief Register Ceed QFunction for building the geometric data for the 2D mass 52*6a6224a1SJeremy L Thompson matrix 53*6a6224a1SJeremy L Thompson **/ 54*6a6224a1SJeremy L Thompson CEED_INTERN int CeedQFunctionRegister_Mass2DBuild(void) { 55*6a6224a1SJeremy L Thompson return CeedQFunctionRegister("Mass2DBuild", Mass2DBuild_loc, 1, Mass2DBuild, 56*6a6224a1SJeremy L Thompson CeedQFunctionInit_Mass2DBuild); 57*6a6224a1SJeremy L Thompson } 58