ceed-impl.h (5dab8e2af977e36360f79b2790b71cc75431f50b) ceed-impl.h (ff8ca64b40ee3acb9f0bbddb799062848a322550)
1// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3// 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.

--- 4 unchanged lines hidden (view full) ---

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#ifndef _ceed_impl_h
18#define _ceed_impl_h
19
20#include <ceed.h>
1// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3// 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.

--- 4 unchanged lines hidden (view full) ---

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#ifndef _ceed_impl_h
18#define _ceed_impl_h
19
20#include <ceed.h>
21#include <stdbool.h>
21
22#define CEED_INTERN CEED_EXTERN __attribute__((visibility ("hidden")))
23
24#define CEED_MAX_RESOURCE_LEN 1024
25#define CEED_ALIGN 64
26
27struct Ceed_private {
28 int (*Error)(Ceed, const char *, int, const char *, int, const char *, va_list);

--- 34 unchanged lines hidden (view full) ---

63 int (*Destroy)(CeedVector);
64 int refcount;
65 CeedInt length;
66 void *data;
67};
68
69struct CeedElemRestriction_private {
70 Ceed ceed;
22
23#define CEED_INTERN CEED_EXTERN __attribute__((visibility ("hidden")))
24
25#define CEED_MAX_RESOURCE_LEN 1024
26#define CEED_ALIGN 64
27
28struct Ceed_private {
29 int (*Error)(Ceed, const char *, int, const char *, int, const char *, va_list);

--- 34 unchanged lines hidden (view full) ---

64 int (*Destroy)(CeedVector);
65 int refcount;
66 CeedInt length;
67 void *data;
68};
69
70struct CeedElemRestriction_private {
71 Ceed ceed;
71 int (*Apply)(CeedElemRestriction, CeedTransposeMode, CeedInt, CeedTransposeMode,
72 int (*Apply)(CeedElemRestriction, CeedTransposeMode, CeedTransposeMode,
72 CeedVector, CeedVector, CeedRequest *);
73 int (*Destroy)(CeedElemRestriction);
74 int refcount;
75 CeedInt nelem; /* number of elements */
76 CeedInt elemsize; /* number of dofs per element */
77 CeedInt ndof; /* size of the L-vector, can be used for checking for
78 correct vector sizes */
73 CeedVector, CeedVector, CeedRequest *);
74 int (*Destroy)(CeedElemRestriction);
75 int refcount;
76 CeedInt nelem; /* number of elements */
77 CeedInt elemsize; /* number of dofs per element */
78 CeedInt ndof; /* size of the L-vector, can be used for checking for
79 correct vector sizes */
80 CeedInt ncomp; /* number of components */
79 void *data; /* place for the backend to store any data */
80};
81
82struct CeedBasis_private {
83 Ceed ceed;
84 int (*Apply)(CeedBasis, CeedTransposeMode, CeedEvalMode, const CeedScalar *,
85 CeedScalar *);
86 int (*Destroy)(CeedBasis);

--- 4 unchanged lines hidden (view full) ---

91 CeedInt Q1d;
92 CeedScalar *qref1d;
93 CeedScalar *qweight1d;
94 CeedScalar *interp1d;
95 CeedScalar *grad1d;
96 void *data; /* place for the backend to store any data */
97};
98
81 void *data; /* place for the backend to store any data */
82};
83
84struct CeedBasis_private {
85 Ceed ceed;
86 int (*Apply)(CeedBasis, CeedTransposeMode, CeedEvalMode, const CeedScalar *,
87 CeedScalar *);
88 int (*Destroy)(CeedBasis);

--- 4 unchanged lines hidden (view full) ---

93 CeedInt Q1d;
94 CeedScalar *qref1d;
95 CeedScalar *qweight1d;
96 CeedScalar *interp1d;
97 CeedScalar *grad1d;
98 void *data; /* place for the backend to store any data */
99};
100
99/* FIXME: The number of in-fields and out-fields may be different? */
100/* FIXME: Shouldn't inmode and outmode be per-in-field and per-out-field,
101 respectively? */
101struct CeedQFunctionField {
102 const char *fieldname;
103 CeedInt ncomp;
104 CeedEvalMode emode;
105};
106
102struct CeedQFunction_private {
103 Ceed ceed;
107struct CeedQFunction_private {
108 Ceed ceed;
104 int (*Apply)(CeedQFunction, void *, CeedInt, const CeedScalar *const *,
109 int (*Apply)(CeedQFunction, CeedInt, const CeedScalar *const *,
105 CeedScalar *const *);
106 int (*Destroy)(CeedQFunction);
107 int refcount;
108 CeedInt vlength; // Number of quadrature points must be padded to a multiple of vlength
110 CeedScalar *const *);
111 int (*Destroy)(CeedQFunction);
112 int refcount;
113 CeedInt vlength; // Number of quadrature points must be padded to a multiple of vlength
109 CeedInt nfields;
110 size_t qdatasize; // Number of bytes of qdata per quadrature point
111 CeedEvalMode inmode, outmode;
112 int (*function)(void *, void *, CeedInt, const CeedScalar *const *,
113 CeedScalar *const *);
114 struct CeedQFunctionField inputfields[16];
115 struct CeedQFunctionField outputfields[16];
116 CeedInt numinputfields, numoutputfields;
117 int (*function)(void*, CeedInt, const CeedScalar *const*, CeedScalar *const*);
114 const char *focca;
115 void *ctx; /* user context for function */
116 size_t ctxsize; /* size of user context; may be used to copy to a device */
117 void *data; /* backend data */
118};
119
118 const char *focca;
119 void *ctx; /* user context for function */
120 size_t ctxsize; /* size of user context; may be used to copy to a device */
121 void *data; /* backend data */
122};
123
124struct CeedOperatorField {
125 CeedElemRestriction Erestrict; /// Restriction from L-vector or NULL if identity
126 CeedBasis basis; /// Basis or NULL for collocated fields
127 CeedVector vec; /// State vector for passive fields, NULL for active fields
128};
129
120struct CeedOperator_private {
121 Ceed ceed;
122 int refcount;
130struct CeedOperator_private {
131 Ceed ceed;
132 int refcount;
123 int (*Apply)(CeedOperator, CeedVector, CeedVector, CeedVector, CeedRequest *);
133 int (*Apply)(CeedOperator, CeedVector, CeedVector, CeedRequest *);
124 int (*ApplyJacobian)(CeedOperator, CeedVector, CeedVector, CeedVector,
125 CeedVector, CeedRequest *);
126 int (*GetQData)(CeedOperator, CeedVector *);
127 int (*Destroy)(CeedOperator);
134 int (*ApplyJacobian)(CeedOperator, CeedVector, CeedVector, CeedVector,
135 CeedVector, CeedRequest *);
136 int (*GetQData)(CeedOperator, CeedVector *);
137 int (*Destroy)(CeedOperator);
128 CeedElemRestriction Erestrict;
129 CeedBasis basis;
138 struct CeedOperatorField inputfields[16];
139 struct CeedOperatorField outputfields[16];
140 CeedInt numelements; /// Number of elements
141 CeedInt numqpoints; /// Number of quadrature points over all elements
130 CeedQFunction qf;
131 CeedQFunction dqf;
132 CeedQFunction dqfT;
142 CeedQFunction qf;
143 CeedQFunction dqf;
144 CeedQFunction dqfT;
145 bool setupdone;
133 void *data;
134};
135
136#endif
146 void *data;
147};
148
149#endif