CeedQFunction¶
-
int CeedQFunctionRegister(const char *name, const char *source, CeedInt vec_length, CeedQFunctionUser f, int (*init)(Ceed, const char*, CeedQFunction))¶
Register a gallery QFunction.
Library Developer Functions
- Parameters
name – [in] Name for this backend to respond to
source – [in] Absolute path to source of QFunction, “\path\CEED_DIR\gallery\folder\file.h:function_name”
vec_length – [in] Vector length. Caller must ensure that number of quadrature points is a multiple of vec_length.
f – [in] Function pointer to evaluate action at quadrature points. See Public API for CeedQFunction.
init – [in] Initialization function called by CeedQFunctionInit() when the QFunction is selected.
- Returns
An error code: 0 - success, otherwise - failure
-
static int CeedQFunctionFieldSet(CeedQFunctionField *f, const char *field_name, CeedInt size, CeedEvalMode eval_mode)¶
Set a CeedQFunction field, used by CeedQFunctionAddInput/Output.
Library Developer Functions
- Parameters
f – [out] CeedQFunctionField
field_name – [in] Name of QFunction field
size – [in] Size of QFunction field, (num_comp * 1) for CEED_EVAL_NONE and CEED_EVAL_WEIGHT, (num_comp * 1) for CEED_EVAL_INTERP for an H^1 space or (num_comp * dim) for an H(div) or H(curl) space, (num_comp * dim) for CEED_EVAL_GRAD, or (num_comp * 1) for CEED_EVAL_DIV, and (num_comp * curl_dim) with curl_dim = 1 if dim < 3 else dim for CEED_EVAL_CURL.
eval_mode – [in] CEED_EVAL_NONE to use values directly, CEED_EVAL_WEIGHT to use quadrature weights, CEED_EVAL_INTERP to use interpolated values, CEED_EVAL_GRAD to use gradients, CEED_EVAL_DIV to use divergence, CEED_EVAL_CURL to use curl.
- Returns
An error code: 0 - success, otherwise - failure
-
static int CeedQFunctionFieldView(CeedQFunctionField field, CeedInt field_number, bool in, FILE *stream)¶
View a field of a CeedQFunction.
Utility Functions
- Parameters
field – [in] QFunction field to view
field_number – [in] Number of field being viewed
in – [in] true for input field, false for output
stream – [in] Stream to view to, e.g., stdout
- Returns
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionSetFortranStatus(CeedQFunction qf, bool status)¶
Set flag to determine if Fortran interface is used.
Backend Developer Functions
- Parameters
qf – [inout] CeedQFunction
status – [in] Boolean value to set as Fortran status
- Returns
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextGetFieldIndex(CeedQFunctionContext ctx, const char *field_name, CeedInt *field_index)¶
Get index for QFunctionContext field.
Library Developer Functions
- Parameters
ctx – [in] CeedQFunctionContext
field_name – [in] Name of field
field_index – [out] Index of field, or -1 if field is not registered
- Returns
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextRegisterGeneric(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, const char *field_description, CeedContextFieldType field_type, size_t field_size, size_t num_values)¶
Common function for registering QFunctionContext fields.
Library Developer Functions
- Parameters
ctx – [inout] CeedQFunctionContext
field_name – [in] Name of field to register
field_offset – [in] Offset of field to register
field_description – [in] Description of field, or NULL for none
field_type – [in] Field data type, such as double or int32
field_size – [in] Size of field, in bytes
num_values – [in] Number of values to register, must be contiguous in memory
- Returns
An error code: 0 - success, otherwise - failure
-
static int CeedQFunctionContextDestroyData(CeedQFunctionContext ctx)¶
Destroy user data held by CeedQFunctionContext, using function set by CeedQFunctionContextSetDataDestroy, if applicable.
Library Developer Functions
- Parameters
ctx – [inout] CeedQFunctionContext to destroy user data
- Returns
An error code: 0 - success, otherwise - failure