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