xref: /libCEED/rust/libceed-sys/c-src/backends/ref/ceed-ref.h (revision aedaa0e5fd3a3e03ad33ad8a6308ac527f4f900e)
121617c04Sjeremylt // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC.
221617c04Sjeremylt // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707.
321617c04Sjeremylt // All Rights reserved. See files LICENSE and NOTICE for details.
421617c04Sjeremylt //
521617c04Sjeremylt // This file is part of CEED, a collection of benchmarks, miniapps, software
621617c04Sjeremylt // libraries and APIs for efficient high-order finite element and spectral
721617c04Sjeremylt // element discretizations for exascale applications. For more information and
821617c04Sjeremylt // source code availability see http://github.com/ceed.
921617c04Sjeremylt //
1021617c04Sjeremylt // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
1121617c04Sjeremylt // a collaborative effort of two U.S. Department of Energy organizations (Office
1221617c04Sjeremylt // of Science and the National Nuclear Security Administration) responsible for
1321617c04Sjeremylt // the planning and preparation of a capable exascale ecosystem, including
1421617c04Sjeremylt // software, applications, hardware, advanced system engineering and early
1521617c04Sjeremylt // testbed platforms, in support of the nation's exascale computing imperative.
1621617c04Sjeremylt 
17d863ab9bSjeremylt #include <ceed-backend.h>
1821617c04Sjeremylt #include <string.h>
1921617c04Sjeremylt 
2021617c04Sjeremylt typedef struct {
2121617c04Sjeremylt   CeedScalar *array;
2221617c04Sjeremylt   CeedScalar *array_allocated;
2321617c04Sjeremylt } CeedVector_Ref;
2421617c04Sjeremylt 
2521617c04Sjeremylt typedef struct {
2621617c04Sjeremylt   const CeedInt *indices;
2721617c04Sjeremylt   CeedInt *indices_allocated;
2821617c04Sjeremylt } CeedElemRestriction_Ref;
2921617c04Sjeremylt 
3021617c04Sjeremylt typedef struct {
31*aedaa0e5Sjeremylt   const CeedScalar **inputs;
32*aedaa0e5Sjeremylt   CeedScalar **outputs;
33*aedaa0e5Sjeremylt   bool setupdone;
34*aedaa0e5Sjeremylt } CeedQFunction_Ref;
35*aedaa0e5Sjeremylt 
36*aedaa0e5Sjeremylt typedef struct {
3742877f77Sjeremylt   CeedVector
3842877f77Sjeremylt   *evecs;   /// E-vectors needed to apply operator (input followed by outputs)
3942877f77Sjeremylt   CeedScalar ** edata;
40*aedaa0e5Sjeremylt   CeedVector *qvecsin;   /// Input Q-vectors needed to apply operator
41*aedaa0e5Sjeremylt   CeedVector *qvecsout;   /// Output Q-vectors needed to apply operator
4242877f77Sjeremylt   CeedInt    numein;
4342877f77Sjeremylt   CeedInt    numeout;
44*aedaa0e5Sjeremylt   CeedVector tempvec;
4521617c04Sjeremylt } CeedOperator_Ref;
4621617c04Sjeremylt 
47667bc5fcSjeremylt CEED_INTERN int CeedVectorCreate_Ref(CeedInt n, CeedVector vec);
4821617c04Sjeremylt 
49667bc5fcSjeremylt CEED_INTERN int CeedElemRestrictionCreate_Ref(CeedMemType mtype,
50667bc5fcSjeremylt     CeedCopyMode cmode, const CeedInt *indices, CeedElemRestriction r);
5121617c04Sjeremylt 
52667bc5fcSjeremylt CEED_INTERN int CeedBasisCreateTensorH1_Ref(CeedInt dim, CeedInt P1d,
5321617c04Sjeremylt     CeedInt Q1d, const CeedScalar *interp1d,
5421617c04Sjeremylt     const CeedScalar *grad1d,
5521617c04Sjeremylt     const CeedScalar *qref1d,
5621617c04Sjeremylt     const CeedScalar *qweight1d,
5721617c04Sjeremylt     CeedBasis basis);
5821617c04Sjeremylt 
59667bc5fcSjeremylt CEED_INTERN int CeedBasisCreateH1_Ref(CeedElemTopology topo,
60667bc5fcSjeremylt                                       CeedInt dim, CeedInt ndof, CeedInt nqpts,
61a8de75f0Sjeremylt                                       const CeedScalar *interp,
62a8de75f0Sjeremylt                                       const CeedScalar *grad,
63a8de75f0Sjeremylt                                       const CeedScalar *qref,
64a8de75f0Sjeremylt                                       const CeedScalar *qweight,
65a8de75f0Sjeremylt                                       CeedBasis basis);
66a8de75f0Sjeremylt 
6721617c04Sjeremylt CEED_INTERN int CeedQFunctionCreate_Ref(CeedQFunction qf);
6821617c04Sjeremylt 
6921617c04Sjeremylt CEED_INTERN int CeedOperatorCreate_Ref(CeedOperator op);
70