ceed-impl.h (9e1c8ed3e375f1dbcb31c7e047c1f7152ae5a2a7) ceed-impl.h (d863ab9ba6a0d47c58445a35d35b36efba07fc93)
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.

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

40 const CeedScalar *,
41 const CeedScalar *, const CeedScalar *, const CeedScalar *, CeedBasis);
42 int (*QFunctionCreate)(CeedQFunction);
43 int (*OperatorCreate)(CeedOperator);
44 int refcount;
45 void *data;
46};
47
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.

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

40 const CeedScalar *,
41 const CeedScalar *, const CeedScalar *, const CeedScalar *, CeedBasis);
42 int (*QFunctionCreate)(CeedQFunction);
43 int (*OperatorCreate)(CeedOperator);
44 int refcount;
45 void *data;
46};
47
48/* In the next 3 functions, p has to be the address of a pointer type, i.e. p
49 has to be a pointer to a pointer. */
50CEED_INTERN int CeedMallocArray(size_t n, size_t unit, void *p);
51CEED_INTERN int CeedCallocArray(size_t n, size_t unit, void *p);
52CEED_INTERN int CeedReallocArray(size_t n, size_t unit, void *p);
53CEED_INTERN int CeedFree(void *p);
54
55#define CeedChk(ierr) do { if (ierr) return ierr; } while (0)
56/* Note that CeedMalloc and CeedCalloc will, generally, return pointers with
57 different memory alignments: CeedMalloc returns pointers aligned at
58 CEED_ALIGN bytes, while CeedCalloc uses the alignment of calloc. */
59#define CeedMalloc(n, p) CeedMallocArray((n), sizeof(**(p)), p)
60#define CeedCalloc(n, p) CeedCallocArray((n), sizeof(**(p)), p)
61#define CeedRealloc(n, p) CeedReallocArray((n), sizeof(**(p)), p)
62
63struct CeedVector_private {
64 Ceed ceed;
65 int (*SetArray)(CeedVector, CeedMemType, CeedCopyMode, CeedScalar *);
66 int (*SetValue)(CeedVector, CeedScalar);
67 int (*GetArray)(CeedVector, CeedMemType, CeedScalar **);
68 int (*GetArrayRead)(CeedVector, CeedMemType, const CeedScalar **);
69 int (*RestoreArray)(CeedVector, CeedScalar **);
70 int (*RestoreArrayRead)(CeedVector, const CeedScalar **);

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

163 CeedInt nfields; /// Number of fields that have been set
164 CeedQFunction qf;
165 CeedQFunction dqf;
166 CeedQFunction dqfT;
167 bool setupdone;
168 void *data;
169};
170
48struct CeedVector_private {
49 Ceed ceed;
50 int (*SetArray)(CeedVector, CeedMemType, CeedCopyMode, CeedScalar *);
51 int (*SetValue)(CeedVector, CeedScalar);
52 int (*GetArray)(CeedVector, CeedMemType, CeedScalar **);
53 int (*GetArrayRead)(CeedVector, CeedMemType, const CeedScalar **);
54 int (*RestoreArray)(CeedVector, CeedScalar **);
55 int (*RestoreArrayRead)(CeedVector, const CeedScalar **);

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

148 CeedInt nfields; /// Number of fields that have been set
149 CeedQFunction qf;
150 CeedQFunction dqf;
151 CeedQFunction dqfT;
152 bool setupdone;
153 void *data;
154};
155
156CEED_INTERN int CeedErrorReturn(Ceed, const char *, int, const char *, int,
157 const char *, va_list);
158CEED_INTERN int CeedErrorAbort(Ceed, const char *, int, const char *, int,
159 const char *, va_list);
160CEED_INTERN int CeedErrorExit(Ceed, const char *, int, const char *, int,
161 const char *, va_list);
162CEED_INTERN int CeedSetErrorHandler(Ceed ceed,
163 int (eh)(Ceed, const char *, int, const char *,
164 int, const char *, va_list));
165
171#endif
166#endif