xref: /libCEED/rust/libceed-sys/c-src/backends/ref/ceed-ref.c (revision 9ddbf1571329bf1462e055d18e4864f718ab42a1)
10c784865Scamierjs // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC.
20c784865Scamierjs // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707.
30c784865Scamierjs // All Rights reserved. See files LICENSE and NOTICE for details.
4ae3cba82Scamierjs //
5ae3cba82Scamierjs // This file is part of CEED, a collection of benchmarks, miniapps, software
6ae3cba82Scamierjs // libraries and APIs for efficient high-order finite element and spectral
7ae3cba82Scamierjs // element discretizations for exascale applications. For more information and
8ae3cba82Scamierjs // source code availability see http://github.com/ceed.
9ae3cba82Scamierjs //
10ae3cba82Scamierjs // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
11ae3cba82Scamierjs // a collaborative effort of two U.S. Department of Energy organizations (Office
12ae3cba82Scamierjs // of Science and the National Nuclear Security Administration) responsible for
13ae3cba82Scamierjs // the planning and preparation of a capable exascale ecosystem, including
14ae3cba82Scamierjs // software, applications, hardware, advanced system engineering and early
15ae3cba82Scamierjs // testbed platforms, in support of the nation's exascale computing imperative.
16ae3cba82Scamierjs 
17ae3cba82Scamierjs #include <ceed-impl.h>
18ae3cba82Scamierjs #include <string.h>
1921617c04Sjeremylt #include "ceed-ref.h"
20ae3cba82Scamierjs 
21ae3cba82Scamierjs static int CeedInit_Ref(const char *resource, Ceed ceed) {
22ae3cba82Scamierjs   if (strcmp(resource, "/cpu/self")
23ae3cba82Scamierjs       && strcmp(resource, "/cpu/self/ref"))
24ae3cba82Scamierjs     return CeedError(ceed, 1, "Ref backend cannot use resource: %s", resource);
25ae3cba82Scamierjs   ceed->VecCreate = CeedVectorCreate_Ref;
26ae3cba82Scamierjs   ceed->BasisCreateTensorH1 = CeedBasisCreateTensorH1_Ref;
27ae3cba82Scamierjs   ceed->ElemRestrictionCreate = CeedElemRestrictionCreate_Ref;
284e35ef05Sjeremylt   ceed->ElemRestrictionCreateBlocked = CeedElemRestrictionCreate_Ref;
29ae3cba82Scamierjs   ceed->QFunctionCreate = CeedQFunctionCreate_Ref;
30ae3cba82Scamierjs   ceed->OperatorCreate = CeedOperatorCreate_Ref;
31ae3cba82Scamierjs   return 0;
32ae3cba82Scamierjs }
33ae3cba82Scamierjs 
34ae3cba82Scamierjs __attribute__((constructor))
35ae3cba82Scamierjs static void Register(void) {
36*9ddbf157Sjeremylt //! [Register]
3744951fc6Sjeremylt   CeedRegister("/cpu/self/ref", CeedInit_Ref, 20);
38*9ddbf157Sjeremylt //! [Register]
39ae3cba82Scamierjs }
40