CeedQFunction
-
typedef struct CeedQFunctionField_private *CeedQFunctionField
Handle for object describing CeedQFunction fields.
-
int CeedQFunctionGetVectorLength(CeedQFunction qf, CeedInt *vec_length)
Get the vector length of a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
vec_length – [out] Variable to store vector length
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionGetNumArgs(CeedQFunction qf, CeedInt *num_input, CeedInt *num_output)
Get the number of inputs and outputs to a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
num_input – [out] Variable to store number of input fields
num_output – [out] Variable to store number of output fields
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionGetKernelName(CeedQFunction qf, char **kernel_name)
Get the name of the user function for a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
kernel_name – [out] Variable to store source path string
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionGetSourcePath(CeedQFunction qf, char **source_path)
Get the source path string for a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
source_path – [out] Variable to store source path string
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionLoadSourceToBuffer(CeedQFunction qf, char **source_buffer)
Initialize and load QFunction source file into string buffer, including full text of local files in place of
#include "local.h"
.The
buffer
is set toNULL
if there is no QFunction source file.Note: Caller is responsible for freeing the string buffer with
CeedFree()
.Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
source_buffer – [out] String buffer for source file contents
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionGetUserFunction(CeedQFunction qf, CeedQFunctionUser *f)
Get the User Function for a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
f – [out] Variable to store user function
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionGetContext(CeedQFunction qf, CeedQFunctionContext *ctx)
Get global context for a CeedQFunction.
Note: For QFunctions from the Fortran interface, this function will return the Fortran context CeedQFunctionContext.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
ctx – [out] Variable to store CeedQFunctionContext
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionGetContextData(CeedQFunction qf, CeedMemType mem_type, void *data)
Get context data of a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
mem_type – [in] Memory type on which to access the data. If the backend uses a different memory type, this will perform a copy.
data – [out] Data on memory type mem_type
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionRestoreContextData(CeedQFunction qf, void *data)
Restore context data of a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
data – [inout] Data to restore
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionGetInnerContext(CeedQFunction qf, CeedQFunctionContext *ctx)
Get true user context for a CeedQFunction.
Note: For all QFunctions this function will return the user CeedQFunctionContext and not interface context CeedQFunctionContext, if any such object exists.
- Parameters:
qf – [in] CeedQFunction
ctx – [out] Variable to store CeedQFunctionContext
- Returns:
An error code: 0 - success, otherwise - failure Backend Developer Functions
-
int CeedQFunctionGetInnerContextData(CeedQFunction qf, CeedMemType mem_type, void *data)
Get inner context data of a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
mem_type – [in] Memory type on which to access the data. If the backend uses a different memory type, this will perform a copy.
data – [out] Data on memory type mem_type
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionRestoreInnerContextData(CeedQFunction qf, void *data)
Restore inner context data of a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
data – [inout] Data to restore
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionIsIdentity(CeedQFunction qf, bool *is_identity)
Determine if QFunction is identity.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
is_identity – [out] Variable to store identity status
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionIsContextWritable(CeedQFunction qf, bool *is_writable)
Determine if QFunctionContext is writable.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
is_writable – [out] Variable to store context writeable status
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionGetData(CeedQFunction qf, void *data)
Get backend data of a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [in] CeedQFunction
data – [out] Variable to store data
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionSetData(CeedQFunction qf, void *data)
Set backend data of a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [inout] CeedQFunction
data – [in] Data to set
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionReference(CeedQFunction qf)
Increment the reference counter for a CeedQFunction.
Backend Developer Functions
- Parameters:
qf – [inout] CeedQFunction to increment the reference counter
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionGetFlopsEstimate(CeedQFunction qf, CeedSize *flops)
Estimate number of FLOPs per quadrature required to apply QFunction.
Backend Developer Functions
- Parameters:
qf – [in] QFunction to estimate FLOPs for
flops – [out] Address of variable to hold FLOPs estimate
-
int CeedQFunctionContextGetCeed(CeedQFunctionContext ctx, Ceed *ceed)
Get the Ceed associated with a CeedQFunctionContext.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
ceed – [out] Variable to store Ceed
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextHasValidData(CeedQFunctionContext ctx, bool *has_valid_data)
Check for valid data in a CeedQFunctionContext.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext to check validity
has_valid_data – [out] Variable to store validity
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextHasBorrowedDataOfType(CeedQFunctionContext ctx, CeedMemType mem_type, bool *has_borrowed_data_of_type)
Check for borrowed data of a specific CeedMemType in a CeedQFunctionContext.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext to check
mem_type – [in] Memory type to check
has_borrowed_data_of_type – [out] Variable to store result
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextGetState(CeedQFunctionContext ctx, uint64_t *state)
Get the state of a CeedQFunctionContext.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext to retrieve state
state – [out] Variable to store state
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextGetBackendData(CeedQFunctionContext ctx, void *data)
Get backend data of a CeedQFunctionContext.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
data – [out] Variable to store data
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextSetBackendData(CeedQFunctionContext ctx, void *data)
Set backend data of a CeedQFunctionContext.
Backend Developer Functions
- Parameters:
ctx – [inout] CeedQFunctionContext
data – [in] Data to set
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextGetFieldLabel(CeedQFunctionContext ctx, const char *field_name, CeedContextFieldLabel *field_label)
Get label for a registered QFunctionContext field, or
NULL
if no field has been registered with thisfield_name
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
field_name – [in] Name of field to retrieve label
field_label – [out] Variable to field label
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextSetGeneric(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, CeedContextFieldType field_type, void *values)
Set QFunctionContext field.
Backend Developer Functions
- Parameters:
ctx – [inout] CeedQFunctionContext
field_label – [in] Label of field to set
field_type – [in] Type of field to set
values – [in] Value to set
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextGetGenericRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, CeedContextFieldType field_type, size_t *num_values, void *values)
Get QFunctionContext field data, read-only.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
field_label – [in] Label of field to read
field_type – [in] Type of field to read
num_values – [out] Number of values in the field label
values – [out] Pointer to context values
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextRestoreGenericRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, CeedContextFieldType field_type, void *values)
Restore QFunctionContext field data, read-only.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
field_label – [in] Label of field to restore
field_type – [in] Type of field to restore
values – [out] Pointer to context values
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextSetDouble(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, double *values)
Set QFunctionContext field holding double precision values.
Backend Developer Functions
- Parameters:
ctx – [inout] CeedQFunctionContext
field_label – [in] Label for field to set
values – [in] Values to set
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextGetDoubleRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, size_t *num_values, const double **values)
Get QFunctionContext field holding double precision values, read-only.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
field_label – [in] Label for field to get
num_values – [out] Number of values in the field label
values – [out] Pointer to context values
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextRestoreDoubleRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, const double **values)
Restore QFunctionContext field holding double precision values, read-only.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
field_label – [in] Label for field to restore
values – [out] Pointer to context values
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextSetInt32(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, int32_t *values)
Set QFunctionContext field holding int32 values.
Backend Developer Functions
- Parameters:
ctx – [inout] CeedQFunctionContext
field_label – [in] Label for field to set
values – [in] Values to set
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextGetInt32Read(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, size_t *num_values, const int32_t **values)
Get QFunctionContext field holding int32 values, read-only.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
field_label – [in] Label for field to get
num_values – [out] Number of values in the field label
values – [out] Pointer to context values
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextRestoreInt32Read(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, const int32_t **values)
Restore QFunctionContext field holding int32 values, read-only.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
field_label – [in] Label for field to restore
values – [out] Pointer to context values
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextSetBoolean(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, bool *values)
Set QFunctionContext field holding boolean values.
Backend Developer Functions
- Parameters:
ctx – [inout] CeedQFunctionContext
field_label – [in] Label for field to set
values – [in] Values to set
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextGetBooleanRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, size_t *num_values, const bool **values)
Get QFunctionContext field holding boolean values, read-only.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
field_label – [in] Label for field to get
num_values – [out] Number of values in the field label
values – [out] Pointer to context values
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextRestoreBooleanRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, const bool **values)
Restore QFunctionContext field holding boolean values, read-only.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext
field_label – [in] Label for field to restore
values – [out] Pointer to context values
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextGetDataDestroy(CeedQFunctionContext ctx, CeedMemType *f_mem_type, CeedQFunctionContextDataDestroyUser *f)
Get additional destroy routine for CeedQFunctionContext user data.
Backend Developer Functions
- Parameters:
ctx – [in] CeedQFunctionContext to get user destroy function
f_mem_type – [out] Memory type to use when passing data into
f
f – [out] Additional routine to use to destroy user data
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQFunctionContextReference(CeedQFunctionContext ctx)
Increment the reference counter for a CeedQFunctionContext.
Backend Developer Functions
- Parameters:
ctx – [inout] CeedQFunctionContext to increment the reference counter
- Returns:
An error code: 0 - success, otherwise - failure
Macros
-
CEED_QFUNCTION_ATTR
This macro defines compiler attributes to the CEED_QFUNCTION to force inlining for called functions.
The
inline
declaration does not necessarily enforce a compiler to inline a function. This can be detrimental to performance, so here we force inlining to occur unless inlining has been forced off (like during debugging).