| ceed-qfunction.c (b9960174db40cd7adc52635f1259ce294429dbd5) | ceed-qfunction.c (9f0427d99e9674f1e08f64878fc1ceefe3e53022) |
|---|---|
| 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. --- 17 unchanged lines hidden (view full) --- 26 27/** 28 @brief Create a CeedQFunction for evaluating interior (volumetric) terms. 29 30 @param ceed A Ceed object where the CeedQFunction will be created 31 @param vlength Vector length. Caller must ensure that number of quadrature 32 points is a multiple of vlength. 33 @param f Function pointer to evaluate action at quadrature points. | 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. --- 17 unchanged lines hidden (view full) --- 26 27/** 28 @brief Create a CeedQFunction for evaluating interior (volumetric) terms. 29 30 @param ceed A Ceed object where the CeedQFunction will be created 31 @param vlength Vector length. Caller must ensure that number of quadrature 32 points is a multiple of vlength. 33 @param f Function pointer to evaluate action at quadrature points. |
| 34 See below. | 34 See \ref CeedQFunctionUser. |
| 35 @param focca OCCA identifier "file.c:function_name" for definition of `f` 36 @param[out] qf Address of the variable where the newly created 37 CeedQFunction will be stored 38 39 @return An error code: 0 - success, otherwise - failure 40 | 35 @param focca OCCA identifier "file.c:function_name" for definition of `f` 36 @param[out] qf Address of the variable where the newly created 37 CeedQFunction will be stored 38 39 @return An error code: 0 - success, otherwise - failure 40 |
| 41 The arguments of the call-back 'function' are: | 41 See \ref CeedQFunctionUser for details on the call-back function @a f's arguments. |
| 42 | 42 |
| 43 1. [void *ctx][in/out] - user data, this is the 'ctx' pointer stored in 44 the CeedQFunction, set by calling CeedQFunctionSetContext 45 46 2. [CeedInt nq][in] - number of quadrature points to process 47 48 3. [const CeedScalar *const *u][in] - input fields data at quadrature pts, listed in the order given by the user 49 50 4. [CeedScalar *const *v][out] - output fields data at quadrature points, again listed in order given by the user 51 | |
| 52 @ref Basic 53**/ 54int CeedQFunctionCreateInterior(Ceed ceed, CeedInt vlength, | 43 @ref Basic 44**/ 45int CeedQFunctionCreateInterior(Ceed ceed, CeedInt vlength, |
| 55 int (*f)(void*, CeedInt, const CeedScalar *const*, CeedScalar *const*), | 46 CeedQFunctionUser f, |
| 56 const char *focca, CeedQFunction *qf) { 57 int ierr; 58 char *focca_copy; 59 60 if (!ceed->QFunctionCreate) { 61 Ceed delegate; 62 ierr = CeedGetDelegate(ceed, &delegate); CeedChk(ierr); 63 --- 248 unchanged lines hidden (view full) --- 312int CeedQFunctionGetInnerContext(CeedQFunction qf, void* *ctx) { 313 if (qf->fortranstatus) { 314 fContext *fctx = qf->ctx; 315 *ctx = fctx->innerctx; 316 } else { 317 *ctx = qf->ctx; 318 } 319 | 47 const char *focca, CeedQFunction *qf) { 48 int ierr; 49 char *focca_copy; 50 51 if (!ceed->QFunctionCreate) { 52 Ceed delegate; 53 ierr = CeedGetDelegate(ceed, &delegate); CeedChk(ierr); 54 --- 248 unchanged lines hidden (view full) --- 303int CeedQFunctionGetInnerContext(CeedQFunction qf, void* *ctx) { 304 if (qf->fortranstatus) { 305 fContext *fctx = qf->ctx; 306 *ctx = fctx->innerctx; 307 } else { 308 *ctx = qf->ctx; 309 } 310 |
| 311 |
|
| 320 return 0; 321} 322 323/** 324 @brief Get backend data of a CeedQFunction 325 326 @param qf CeedQFunction 327 @param[out] data Variable to store data --- 176 unchanged lines hidden --- | 312 return 0; 313} 314 315/** 316 @brief Get backend data of a CeedQFunction 317 318 @param qf CeedQFunction 319 @param[out] data Variable to store data --- 176 unchanged lines hidden --- |