xref: /libCEED/rust/libceed-sys/c-src/include/ceed-impl.h (revision 8cb0412a4de7d19e1e3bfe18d2f7ab742a4a5a31)
16ea7c6c1SJed Brown // Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
26ea7c6c1SJed Brown // the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
36ea7c6c1SJed Brown // reserved. See files LICENSE and NOTICE for details.
46ea7c6c1SJed Brown //
56ea7c6c1SJed Brown // This file is part of CEED, a collection of benchmarks, miniapps, software
66ea7c6c1SJed Brown // libraries and APIs for efficient high-order finite element and spectral
76ea7c6c1SJed Brown // element discretizations for exascale applications. For more information and
86ea7c6c1SJed Brown // source code availability see http://github.com/ceed.
96ea7c6c1SJed Brown //
106ea7c6c1SJed Brown // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
116ea7c6c1SJed Brown // a collaborative effort of two U.S. Department of Energy organizations (Office
126ea7c6c1SJed Brown // of Science and the National Nuclear Security Administration) responsible for
136ea7c6c1SJed Brown // the planning and preparation of a capable exascale ecosystem, including
146ea7c6c1SJed Brown // software, applications, hardware, advanced system engineering and early
156ea7c6c1SJed Brown // testbed platforms, in support of the nation's exascale computing imperative.
166ea7c6c1SJed Brown 
175d6bafb2Sjeremylt /// @file
185d6bafb2Sjeremylt /// Private header for frontend components of libCEED
196ea7c6c1SJed Brown #ifndef _ceed_impl_h
206ea7c6c1SJed Brown #define _ceed_impl_h
216ea7c6c1SJed Brown 
22ec3da8bcSJed Brown #include <ceed/ceed.h>
23ec3da8bcSJed Brown #include <ceed/backend.h>
24ff8ca64bSJed Brown #include <stdbool.h>
256ea7c6c1SJed Brown 
267a982d89SJeremy L. Thompson /** @defgroup CeedUser Public API for Ceed
277a982d89SJeremy L. Thompson     @ingroup Ceed
287a982d89SJeremy L. Thompson */
297a982d89SJeremy L. Thompson /** @defgroup CeedBackend Backend API for Ceed
307a982d89SJeremy L. Thompson     @ingroup Ceed
317a982d89SJeremy L. Thompson */
327a982d89SJeremy L. Thompson /** @defgroup CeedDeveloper Internal library functions for Ceed
337a982d89SJeremy L. Thompson     @ingroup Ceed
347a982d89SJeremy L. Thompson */
357a982d89SJeremy L. Thompson /** @defgroup CeedVectorUser Public API for CeedVector
367a982d89SJeremy L. Thompson     @ingroup CeedVector
377a982d89SJeremy L. Thompson */
387a982d89SJeremy L. Thompson /** @defgroup CeedVectorBackend Backend API for CeedVector
397a982d89SJeremy L. Thompson     @ingroup CeedVector
407a982d89SJeremy L. Thompson */
417a982d89SJeremy L. Thompson /** @defgroup CeedVectorDeveloper Internal library functions for CeedVector
427a982d89SJeremy L. Thompson     @ingroup CeedVector
437a982d89SJeremy L. Thompson */
447a982d89SJeremy L. Thompson /** @defgroup CeedElemRestrictionUser Public API for CeedElemRestriction
457a982d89SJeremy L. Thompson     @ingroup CeedElemRestriction
467a982d89SJeremy L. Thompson */
477a982d89SJeremy L. Thompson /** @defgroup CeedElemRestrictionBackend Backend API for CeedElemRestriction
487a982d89SJeremy L. Thompson     @ingroup CeedElemRestriction
497a982d89SJeremy L. Thompson */
507a982d89SJeremy L. Thompson /** @defgroup CeedElemRestrictionDeveloper Internal library functions for CeedElemRestriction
517a982d89SJeremy L. Thompson     @ingroup CeedElemRestriction
527a982d89SJeremy L. Thompson */
537a982d89SJeremy L. Thompson /** @defgroup CeedBasisUser Public API for CeedBasis
547a982d89SJeremy L. Thompson     @ingroup CeedBasis
557a982d89SJeremy L. Thompson */
567a982d89SJeremy L. Thompson /** @defgroup CeedBasisBackend Backend API for CeedBasis
577a982d89SJeremy L. Thompson     @ingroup CeedBasis
587a982d89SJeremy L. Thompson */
597a982d89SJeremy L. Thompson /** @defgroup CeedBasisDeveloper Internal library functions for CeedBasis
607a982d89SJeremy L. Thompson     @ingroup CeedBasis
617a982d89SJeremy L. Thompson */
627a982d89SJeremy L. Thompson /** @defgroup CeedQFunctionUser Public API for CeedQFunction
637a982d89SJeremy L. Thompson     @ingroup CeedQFunction
647a982d89SJeremy L. Thompson */
657a982d89SJeremy L. Thompson /** @defgroup CeedQFunctionBackend Backend API for CeedQFunction
667a982d89SJeremy L. Thompson     @ingroup CeedQFunction
677a982d89SJeremy L. Thompson */
687a982d89SJeremy L. Thompson /** @defgroup CeedQFunctionDeveloper Internal library functions for CeedQFunction
697a982d89SJeremy L. Thompson     @ingroup CeedQFunction
707a982d89SJeremy L. Thompson */
717a982d89SJeremy L. Thompson /** @defgroup CeedOperatorUser Public API for CeedOperator
727a982d89SJeremy L. Thompson     @ingroup CeedOperator
737a982d89SJeremy L. Thompson */
747a982d89SJeremy L. Thompson /** @defgroup CeedOperatorBackend Backend API for CeedOperator
757a982d89SJeremy L. Thompson     @ingroup CeedOperator
767a982d89SJeremy L. Thompson */
777a982d89SJeremy L. Thompson /** @defgroup CeedOperatorDeveloper Internal library functions for CeedOperator
787a982d89SJeremy L. Thompson     @ingroup CeedOperator
797a982d89SJeremy L. Thompson */
807a982d89SJeremy L. Thompson 
81fe2413ffSjeremylt // Lookup table field for backend functions
82fe2413ffSjeremylt typedef struct {
83d1d35e2fSjeremylt   const char *func_name;
84fe2413ffSjeremylt   size_t offset;
85d1d35e2fSjeremylt } FOffset;
86fe2413ffSjeremylt 
87aefd8378Sjeremylt // Lookup table field for object delegates
88aefd8378Sjeremylt typedef struct {
89d1d35e2fSjeremylt   char *obj_name;
90aefd8378Sjeremylt   Ceed delegate;
91d1d35e2fSjeremylt } ObjDelegate;
92aefd8378Sjeremylt 
936ea7c6c1SJed Brown struct Ceed_private {
94e07206deSjeremylt   const char *resource;
955fe0d4faSjeremylt   Ceed delegate;
962f86a920SJeremy L Thompson   Ceed parent;
97d1d35e2fSjeremylt   ObjDelegate *obj_delegates;
98d1d35e2fSjeremylt   int obj_delegate_count;
99d1d35e2fSjeremylt   Ceed op_fallback_ceed, op_fallback_parent;
100d1d35e2fSjeremylt   const char *op_fallback_resource;
1012f86a920SJeremy L Thompson   int (*Error)(Ceed, const char *, int, const char *, int, const char *,
102f9982c62SWill Pazner                va_list *);
103c907536fSjeremylt   int (*GetPreferredMemType)(CeedMemType *);
1046ea7c6c1SJed Brown   int (*Destroy)(Ceed);
105f8902d9eSjeremylt   int (*VectorCreate)(CeedInt, CeedVector);
106667bc5fcSjeremylt   int (*ElemRestrictionCreate)(CeedMemType, CeedCopyMode,
107667bc5fcSjeremylt                                const CeedInt *, CeedElemRestriction);
108667bc5fcSjeremylt   int (*ElemRestrictionCreateBlocked)(CeedMemType, CeedCopyMode,
109667bc5fcSjeremylt                                       const CeedInt *, CeedElemRestriction);
110667bc5fcSjeremylt   int (*BasisCreateTensorH1)(CeedInt, CeedInt, CeedInt, const CeedScalar *,
1112f86a920SJeremy L Thompson                              const CeedScalar *, const CeedScalar *,
1122f86a920SJeremy L Thompson                              const CeedScalar *, CeedBasis);
113667bc5fcSjeremylt   int (*BasisCreateH1)(CeedElemTopology, CeedInt, CeedInt, CeedInt,
114a8de75f0Sjeremylt                        const CeedScalar *,
1152f86a920SJeremy L Thompson                        const CeedScalar *, const CeedScalar *,
1162f86a920SJeremy L Thompson                        const CeedScalar *, CeedBasis);
117c71e1dcdSjeremylt   int (*TensorContractCreate)(CeedBasis, CeedTensorContract);
1186ea7c6c1SJed Brown   int (*QFunctionCreate)(CeedQFunction);
119777ff853SJeremy L Thompson   int (*QFunctionContextCreate)(CeedQFunctionContext);
1206ea7c6c1SJed Brown   int (*OperatorCreate)(CeedOperator);
12152d6035fSJeremy L Thompson   int (*CompositeOperatorCreate)(CeedOperator);
122d1d35e2fSjeremylt   int ref_count;
1236ea7c6c1SJed Brown   void *data;
1243f21f6b1SJeremy L Thompson   bool is_debug;
1253f21f6b1SJeremy L Thompson   bool is_deterministic;
126d1d35e2fSjeremylt   char err_msg[CEED_MAX_RESOURCE_LEN];
127d1d35e2fSjeremylt   FOffset *f_offsets;
1286ea7c6c1SJed Brown };
1296ea7c6c1SJed Brown 
1306ea7c6c1SJed Brown struct CeedVector_private {
1316ea7c6c1SJed Brown   Ceed ceed;
1329c774eddSJeremy L Thompson   int (*HasValidArray)(CeedVector, bool *);
1339c774eddSJeremy L Thompson   int (*HasBorrowedArrayOfType)(CeedVector, CeedMemType, bool *);
1346ea7c6c1SJed Brown   int (*SetArray)(CeedVector, CeedMemType, CeedCopyMode, CeedScalar *);
1352a1ab385Sjeremylt   int (*SetValue)(CeedVector, CeedScalar);
13654540941SJeremy L Thompson   int (*SyncArray)(CeedVector, CeedMemType);
1376a6c615bSJeremy L Thompson   int (*TakeArray)(CeedVector, CeedMemType, CeedScalar **);
1386ea7c6c1SJed Brown   int (*GetArray)(CeedVector, CeedMemType, CeedScalar **);
1396ea7c6c1SJed Brown   int (*GetArrayRead)(CeedVector, CeedMemType, const CeedScalar **);
1409c774eddSJeremy L Thompson   int (*GetArrayWrite)(CeedVector, CeedMemType, CeedScalar **);
141f05116b9SJeremy L Thompson   int (*RestoreArray)(CeedVector);
142f05116b9SJeremy L Thompson   int (*RestoreArrayRead)(CeedVector);
143547d9b97Sjeremylt   int (*Norm)(CeedVector, CeedNormType, CeedScalar *);
144e0dd3b27Sjeremylt   int (*Scale)(CeedVector, CeedScalar);
1450f7fd0f8Sjeremylt   int (*AXPY)(CeedVector, CeedScalar, CeedVector);
1460f7fd0f8Sjeremylt   int (*PointwiseMult)(CeedVector, CeedVector, CeedVector);
147d99fa3c5SJeremy L Thompson   int (*Reciprocal)(CeedVector);
1486ea7c6c1SJed Brown   int (*Destroy)(CeedVector);
149d1d35e2fSjeremylt   int ref_count;
1506ea7c6c1SJed Brown   CeedInt length;
15136ac90ebSjeremylt   uint64_t state;
152d1d35e2fSjeremylt   uint64_t num_readers;
1536ea7c6c1SJed Brown   void *data;
1546ea7c6c1SJed Brown };
1556ea7c6c1SJed Brown 
1566ea7c6c1SJed Brown struct CeedElemRestriction_private {
1576ea7c6c1SJed Brown   Ceed ceed;
158074cb416Sjeremylt   int (*Apply)(CeedElemRestriction, CeedTransposeMode, CeedVector, CeedVector,
159074cb416Sjeremylt                CeedRequest *);
160074cb416Sjeremylt   int (*ApplyBlock)(CeedElemRestriction, CeedInt, CeedTransposeMode, CeedVector,
161074cb416Sjeremylt                     CeedVector, CeedRequest *);
162bd33150aSjeremylt   int (*GetOffsets)(CeedElemRestriction, CeedMemType, const CeedInt **);
1636ea7c6c1SJed Brown   int (*Destroy)(CeedElemRestriction);
164d1d35e2fSjeremylt   int ref_count;
165d1d35e2fSjeremylt   CeedInt num_elem;      /* number of elements */
166d1d35e2fSjeremylt   CeedInt elem_size;     /* number of nodes per element */
167d1d35e2fSjeremylt   CeedInt num_comp;      /* number of components */
168d1d35e2fSjeremylt   CeedInt comp_stride;   /* Component stride for L-vector ordering */
169d1d35e2fSjeremylt   CeedInt l_size;        /* size of the L-vector, can be used for checking
170d979a051Sjeremylt                               for correct vector sizes */
171d1d35e2fSjeremylt   CeedInt blk_size;      /* number of elements in a batch */
172d1d35e2fSjeremylt   CeedInt num_blk;       /* number of blocks of elements */
1737509a596Sjeremylt   CeedInt *strides;      /* strides between [nodes, components, elements] */
17449fd234cSJeremy L Thompson   CeedInt layout[3];     /* E-vector layout [nodes, components, elements] */
175d1d35e2fSjeremylt   uint64_t num_readers;  /* number of instances of offset read only access */
1766ea7c6c1SJed Brown   void *data;            /* place for the backend to store any data */
1776ea7c6c1SJed Brown };
1786ea7c6c1SJed Brown 
1796ea7c6c1SJed Brown struct CeedBasis_private {
1806ea7c6c1SJed Brown   Ceed ceed;
1814b8bea3bSJed Brown   int (*Apply)(CeedBasis, CeedInt, CeedTransposeMode, CeedEvalMode,
182aedaa0e5Sjeremylt                CeedVector, CeedVector);
1836ea7c6c1SJed Brown   int (*Destroy)(CeedBasis);
184d1d35e2fSjeremylt   int ref_count;
185d1d35e2fSjeremylt   bool tensor_basis;       /* flag for tensor basis */
1860f5de9e9Sjeremylt   CeedInt dim;             /* topological dimension */
187d99fa3c5SJeremy L Thompson   CeedElemTopology topo;   /* element topology */
188d1d35e2fSjeremylt   CeedInt num_comp;        /* number of field components (1 for scalar fields) */
189d1d35e2fSjeremylt   CeedInt P_1d;            /* number of nodes in one dimension */
190d1d35e2fSjeremylt   CeedInt Q_1d;            /* number of quadrature points in one dimension */
191a8de75f0Sjeremylt   CeedInt P;               /* total number of nodes */
192a8de75f0Sjeremylt   CeedInt Q;               /* total number of quadrature points */
193d1d35e2fSjeremylt   CeedScalar *q_ref_1d;    /* Array of length Q1d holding the locations of
194a8d32208Sjeremylt                                 quadrature points on the 1D reference
195a8d32208Sjeremylt                                 element [-1, 1] */
196d1d35e2fSjeremylt   CeedScalar
197d1d35e2fSjeremylt   *q_weight_1d; /* array of length Q1d holding the quadrature weights on
1980f5de9e9Sjeremylt                                the reference element */
1994b8bea3bSJed Brown   CeedScalar
20000f91b2bSjeremylt   *interp;    /* row-major matrix of shape [Q, P] expressing the values of
20100f91b2bSjeremylt                    nodal basis functions at quadrature points */
20200f91b2bSjeremylt   CeedScalar
203d1d35e2fSjeremylt   *interp_1d; /* row-major matrix of shape [Q1d, P1d] expressing the values of
2040f5de9e9Sjeremylt                    nodal basis functions at quadrature points */
2054b8bea3bSJed Brown   CeedScalar
206a8d32208Sjeremylt   *grad;      /* row-major matrix of shape [dim*Q, P] matrix expressing
207a8d32208Sjeremylt                    derivatives of nodal basis functions at quadrature points */
20800f91b2bSjeremylt   CeedScalar
209d1d35e2fSjeremylt   *grad_1d;   /* row-major matrix of shape [Q1d, P1d] matrix expressing
210a8d32208Sjeremylt                    derivatives of nodal basis functions at quadrature points */
2112f86a920SJeremy L Thompson   CeedTensorContract contract; /* tensor contraction object */
212c01dd730Scamierjs   void *data;                  /* place for the backend to store any data */
2136ea7c6c1SJed Brown };
2146ea7c6c1SJed Brown 
2152f86a920SJeremy L Thompson struct CeedTensorContract_private {
2162f86a920SJeremy L Thompson   Ceed ceed;
2172f86a920SJeremy L Thompson   int (*Apply)(CeedTensorContract, CeedInt, CeedInt, CeedInt, CeedInt,
2182f86a920SJeremy L Thompson                const CeedScalar *restrict, CeedTransposeMode, const CeedInt,
2192f86a920SJeremy L Thompson                const CeedScalar *restrict, CeedScalar *restrict);
2202f86a920SJeremy L Thompson   int (*Destroy)(CeedTensorContract);
221d1d35e2fSjeremylt   int ref_count;
2222f86a920SJeremy L Thompson   void *data;
2232f86a920SJeremy L Thompson };
2242f86a920SJeremy L Thompson 
225d1bcdac9Sjeremylt struct CeedQFunctionField_private {
226d1d35e2fSjeremylt   const char *field_name;
2274d537eeaSYohann   CeedInt size;
228d1d35e2fSjeremylt   CeedEvalMode eval_mode;
229ff8ca64bSJed Brown };
230ff8ca64bSJed Brown 
2316ea7c6c1SJed Brown struct CeedQFunction_private {
2326ea7c6c1SJed Brown   Ceed ceed;
2332f86a920SJeremy L Thompson   int (*Apply)(CeedQFunction, CeedInt, CeedVector *, CeedVector *);
2348c84ac63Sjeremylt   int (*SetCUDAUserFunction)(CeedQFunction, void *);
2358c84ac63Sjeremylt   int (*SetHIPUserFunction)(CeedQFunction, void *);
2366ea7c6c1SJed Brown   int (*Destroy)(CeedQFunction);
237d1d35e2fSjeremylt   int ref_count;
238d1d35e2fSjeremylt   CeedInt vec_length; /* Number of quadrature points must be padded to a
239d1d35e2fSjeremylt                            multiple of vec_length */
240d1d35e2fSjeremylt   CeedQFunctionField *input_fields;
241d1d35e2fSjeremylt   CeedQFunctionField *output_fields;
242d1d35e2fSjeremylt   CeedInt num_input_fields, num_output_fields;
2439f0427d9SYohann   CeedQFunctionUser function;
244d1d35e2fSjeremylt   const char *source_path;
24543e1b16fSJeremy L Thompson   const char *kernel_name;
24643e1b16fSJeremy L Thompson   const char *gallery_name;
24743e1b16fSJeremy L Thompson   bool is_gallery;
248f04ea552SJeremy L Thompson   bool is_identity;
249f04ea552SJeremy L Thompson   bool is_fortran;
250f04ea552SJeremy L Thompson   bool is_immutable;
251777ff853SJeremy L Thompson   CeedQFunctionContext ctx; /* user context for function */
252a8d32208Sjeremylt   void *data;          /* place for the backend to store any data */
2536ea7c6c1SJed Brown };
2546ea7c6c1SJed Brown 
255777ff853SJeremy L Thompson struct CeedQFunctionContext_private {
256777ff853SJeremy L Thompson   Ceed ceed;
257d1d35e2fSjeremylt   int ref_count;
2589c774eddSJeremy L Thompson   int (*HasValidData)(CeedQFunctionContext, bool *);
2599c774eddSJeremy L Thompson   int (*HasBorrowedDataOfType)(CeedQFunctionContext, CeedMemType, bool *);
260777ff853SJeremy L Thompson   int (*SetData)(CeedQFunctionContext, CeedMemType, CeedCopyMode, void *);
261891038deSjeremylt   int (*TakeData)(CeedQFunctionContext, CeedMemType, void *);
262777ff853SJeremy L Thompson   int (*GetData)(CeedQFunctionContext, CeedMemType, void *);
263777ff853SJeremy L Thompson   int (*RestoreData)(CeedQFunctionContext);
264777ff853SJeremy L Thompson   int (*Destroy)(CeedQFunctionContext);
265cdf32b93SJeremy L Thompson   CeedInt num_fields;
266cdf32b93SJeremy L Thompson   CeedInt max_fields;
267cdf32b93SJeremy L Thompson   CeedQFunctionContextFieldDescription *field_descriptions;
268777ff853SJeremy L Thompson   uint64_t state;
269d1d35e2fSjeremylt   size_t ctx_size;
270777ff853SJeremy L Thompson   void *data;
271777ff853SJeremy L Thompson };
272777ff853SJeremy L Thompson 
2731e35832bSjeremylt /// Struct to handle the context data to use the Fortran QFunction stub
2741e35832bSjeremylt /// @ingroup CeedQFunction
275777ff853SJeremy L Thompson struct CeedFortranContext_private {
276*8cb0412aSJeremy L Thompson   CeedQFunctionContext inner_ctx;
277069aeabaSjeremylt   void (*f)(void *ctx, int *nq,
278069aeabaSjeremylt             const CeedScalar *u,const CeedScalar *u1,
279069aeabaSjeremylt             const CeedScalar *u2,const CeedScalar *u3,
280069aeabaSjeremylt             const CeedScalar *u4,const CeedScalar *u5,
281069aeabaSjeremylt             const CeedScalar *u6,const CeedScalar *u7,
282069aeabaSjeremylt             const CeedScalar *u8,const CeedScalar *u9,
283069aeabaSjeremylt             const CeedScalar *u10,const CeedScalar *u11,
284069aeabaSjeremylt             const CeedScalar *u12,const CeedScalar *u13,
285069aeabaSjeremylt             const CeedScalar *u14,const CeedScalar *u15,
286069aeabaSjeremylt             CeedScalar *v,CeedScalar *v1,CeedScalar *v2,
287069aeabaSjeremylt             CeedScalar *v3,CeedScalar *v4,CeedScalar *v5,
288069aeabaSjeremylt             CeedScalar *v6,CeedScalar *v7,CeedScalar *v8,
289069aeabaSjeremylt             CeedScalar *v9, CeedScalar *v10,CeedScalar *v11,
290069aeabaSjeremylt             CeedScalar *v12,CeedScalar *v13,CeedScalar *v14,
291069aeabaSjeremylt             CeedScalar *v15, int *err);
292777ff853SJeremy L Thompson };
293777ff853SJeremy L Thompson typedef struct CeedFortranContext_private *CeedFortranContext;
294069aeabaSjeremylt 
295d1bcdac9Sjeremylt struct CeedOperatorField_private {
296d1d35e2fSjeremylt   CeedElemRestriction elem_restr; /* Restriction from L-vector */
297a8d32208Sjeremylt   CeedBasis basis;                /* Basis or CEED_BASIS_COLLOCATED for
298a8d32208Sjeremylt                                        collocated fields */
299a8d32208Sjeremylt   CeedVector vec;                 /* State vector for passive fields or
300a8d32208Sjeremylt                                        CEED_VECTOR_NONE for no vector */
301d1d35e2fSjeremylt   const char *field_name;          /* matching QFunction field name */
302ff8ca64bSJed Brown };
303ff8ca64bSJed Brown 
3046ea7c6c1SJed Brown struct CeedOperator_private {
3056ea7c6c1SJed Brown   Ceed ceed;
306d1d35e2fSjeremylt   CeedOperator op_fallback;
307d1d35e2fSjeremylt   CeedQFunction qf_fallback;
308d1d35e2fSjeremylt   int ref_count;
30980ac2e43SJeremy L Thompson   int (*LinearAssembleQFunction)(CeedOperator, CeedVector *,
3101d102b48SJeremy L Thompson                                  CeedElemRestriction *, CeedRequest *);
31170a7ffb3SJeremy L Thompson   int (*LinearAssembleQFunctionUpdate)(CeedOperator, CeedVector,
31270a7ffb3SJeremy L Thompson                                        CeedElemRestriction, CeedRequest *);
3132bba3ffaSJeremy L Thompson   int (*LinearAssembleDiagonal)(CeedOperator, CeedVector, CeedRequest *);
3149e9210b8SJeremy L Thompson   int (*LinearAssembleAddDiagonal)(CeedOperator, CeedVector, CeedRequest *);
3152bba3ffaSJeremy L Thompson   int (*LinearAssemblePointBlockDiagonal)(CeedOperator, CeedVector,
316d965c7a7SJeremy L Thompson                                           CeedRequest *);
3179e9210b8SJeremy L Thompson   int (*LinearAssembleAddPointBlockDiagonal)(CeedOperator, CeedVector,
3189e9210b8SJeremy L Thompson       CeedRequest *);
319e2f04181SAndrew T. Barker   int (*LinearAssembleSymbolic)(CeedOperator, CeedInt *, CeedInt **, CeedInt **);
320e2f04181SAndrew T. Barker   int (*LinearAssemble)(CeedOperator, CeedVector);
321713f43c3Sjeremylt   int (*CreateFDMElementInverse)(CeedOperator, CeedOperator *, CeedRequest *);
322ff8ca64bSJed Brown   int (*Apply)(CeedOperator, CeedVector, CeedVector, CeedRequest *);
323250756a7Sjeremylt   int (*ApplyComposite)(CeedOperator, CeedVector, CeedVector, CeedRequest *);
324cae8b89aSjeremylt   int (*ApplyAdd)(CeedOperator, CeedVector, CeedVector, CeedRequest *);
325250756a7Sjeremylt   int (*ApplyAddComposite)(CeedOperator, CeedVector, CeedVector, CeedRequest *);
3266ea7c6c1SJed Brown   int (*ApplyJacobian)(CeedOperator, CeedVector, CeedVector, CeedVector,
3276ea7c6c1SJed Brown                        CeedVector, CeedRequest *);
3286ea7c6c1SJed Brown   int (*Destroy)(CeedOperator);
329d1d35e2fSjeremylt   CeedOperatorField *input_fields;
330d1d35e2fSjeremylt   CeedOperatorField *output_fields;
331d1d35e2fSjeremylt   CeedInt num_elem;   /* Number of elements */
332d1d35e2fSjeremylt   CeedInt num_qpts;   /* Number of quadrature points over all elements */
333d1d35e2fSjeremylt   CeedInt num_fields; /* Number of fields that have been set */
3346ea7c6c1SJed Brown   CeedQFunction qf;
3356ea7c6c1SJed Brown   CeedQFunction dqf;
3366ea7c6c1SJed Brown   CeedQFunction dqfT;
337f04ea552SJeremy L Thompson   bool is_immutable;
338f04ea552SJeremy L Thompson   bool is_interface_setup;
339f04ea552SJeremy L Thompson   bool is_backend_setup;
340f04ea552SJeremy L Thompson   bool is_composite;
341d1d35e2fSjeremylt   bool has_restriction;
34270a7ffb3SJeremy L Thompson   bool has_qf_assembled;
34370a7ffb3SJeremy L Thompson   CeedVector qf_assembled;
34470a7ffb3SJeremy L Thompson   CeedElemRestriction qf_assembled_rstr;
345d1d35e2fSjeremylt   CeedOperator *sub_operators;
346d1d35e2fSjeremylt   CeedInt num_suboperators;
3476ea7c6c1SJed Brown   void *data;
3486ea7c6c1SJed Brown };
3496ea7c6c1SJed Brown 
3506ea7c6c1SJed Brown #endif
351