CeedOperator

static int CeedOperatorCheckField(Ceed ceed, CeedQFunctionField qf_field, CeedElemRestriction rstr, CeedBasis basis)

Check if a CeedOperator Field matches the CeedQFunction Field.

Library Developer Functions

Parameters:
  • ceed[in] Ceed object for error handling

  • qf_field[in] CeedQFunction Field matching CeedOperator Field

  • rstr[in] CeedOperator Field CeedElemRestriction

  • basis[in] CeedOperator Field CeedBasis

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorFieldView(CeedOperatorField op_field, CeedQFunctionField qf_field, CeedInt field_number, const char *tabs, bool is_input, FILE *stream)

View a field of a CeedOperator

Utility Functions

Parameters:
  • op_field[in] CeedOperator Field to view

  • qf_field[in] CeedQFunction Field (carries field name)

  • field_number[in] Number of field being viewed

  • tabs[in] Tabs to append before each line

  • is_input[in] true for an input field; false for output field

  • stream[in] Stream to view to, e.g., stdout

Returns:

An error code: 0 - success, otherwise - failure

int CeedOperatorSingleView(CeedOperator op, const char *tabs, FILE *stream)

View a single CeedOperator

Utility Functions

Parameters:
  • op[in] CeedOperator to view

  • tabs[in] Tabs to append before each new line

  • stream[in] Stream to write; typically stdout or a file

Returns:

Error code: 0 - success, otherwise - failure

static int CeedOperatorView_Object(CeedObject op, FILE *stream)

View a CeedOperator passed as a CeedObject

Library Developer Functions

Parameters:
  • op[in] CeedOperator to view

  • stream[in] Filestream to write to

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorDestroy_Object(CeedObject *op)

Destroy a CeedOperator passed as a CeedObject

Library Developer Functions

Parameters:
  • op[inout] Address of CeedOperator to destroy

Returns:

An error code: 0 - success, otherwise - failure

int CeedOperatorGetActiveBasis(CeedOperator op, CeedBasis *active_basis)

Find the active input vector CeedBasis for a non-composite CeedOperator.

Note: Caller is responsible for destroying the active_basis with CeedBasisDestroy().

Library Developer Functions

Parameters:
  • op[in] CeedOperator to find active CeedBasis for

  • active_basis[out] CeedBasis for active input vector or NULL for composite operator

Returns:

An error code: 0 - success, otherwise - failure

int CeedOperatorGetActiveBases(CeedOperator op, CeedBasis *active_input_basis, CeedBasis *active_output_basis)

Find the active input and output vector CeedBasis for a non-composite CeedOperator.

Note: Caller is responsible for destroying the bases with CeedBasisDestroy().

Library Developer Functions

Parameters:
  • op[in] CeedOperator to find active CeedBasis for

  • active_input_basis[out] CeedBasis for active input vector or NULL for composite operator

  • active_output_basis[out] CeedBasis for active output vector or NULL for composite operator

Returns:

An error code: 0 - success, otherwise - failure

int CeedOperatorGetActiveElemRestriction(CeedOperator op, CeedElemRestriction *active_rstr)

Find the active vector CeedElemRestriction for a non-composite CeedOperator.

Note: Caller is responsible for destroying the active_rstr with CeedElemRestrictionDestroy().

Utility Functions

Parameters:
  • op[in] CeedOperator to find active CeedElemRestriction for

  • active_rstr[out] CeedElemRestriction for active input vector or NULL for composite operator

Returns:

An error code: 0 - success, otherwise - failure

int CeedOperatorGetActiveElemRestrictions(CeedOperator op, CeedElemRestriction *active_input_rstr, CeedElemRestriction *active_output_rstr)

Find the active input and output vector CeedElemRestriction for a non-composite CeedOperator.

Note: Caller is responsible for destroying the restrictions with CeedElemRestrictionDestroy().

Utility Functions

Parameters:
  • op[in] CeedOperator to find active CeedElemRestriction for

  • active_input_rstr[out] CeedElemRestriction for active input vector or NULL for composite operator

  • active_output_rstr[out] CeedElemRestriction for active output vector or NULL for composite operator

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorContextSetGeneric(CeedOperator op, CeedContextFieldLabel field_label, CeedContextFieldType field_type, void *values)

Set CeedQFunctionContext field values of the specified type.

For composite operators, the value is set in all sub-operator CeedQFunctionContext that have a matching field_name. A non-zero error code is returned for single operators that do not have a matching field of the same type or composite operators that do not have any field of a matching type.

Library Developer Functions

Parameters:
  • op[inout] CeedOperator

  • field_label[in] Label of field to set

  • field_type[in] Type of field to set

  • values[in] Values to set

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorContextGetGenericRead(CeedOperator op, CeedContextFieldLabel field_label, CeedContextFieldType field_type, size_t *num_values, void *values)

Get CeedQFunctionContext field values of the specified type, read-only.

For composite operators, the values retrieved are for the first sub-operator CeedQFunctionContext that have a matching field_name. A non-zero error code is returned for single operators that do not have a matching field of the same type or composite operators that do not have any field of a matching type.

Library Developer Functions

Parameters:
  • op[inout] CeedOperator

  • field_label[in] Label of field to set

  • field_type[in] Type of field to set

  • num_values[out] Number of values of type field_type in array values

  • values[out] Values in the label

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorContextRestoreGenericRead(CeedOperator op, CeedContextFieldLabel field_label, CeedContextFieldType field_type, void *values)

Restore CeedQFunctionContext field values of the specified type, read-only.

For composite operators, the values restored are for the first sub-operator CeedQFunctionContext that have a matching field_name. A non-zero error code is returned for single operators that do not have a matching field of the same type or composite operators that do not have any field of a matching type.

Library Developer Functions

Parameters:
  • op[inout] CeedOperator

  • field_label[in] Label of field to set

  • field_type[in] Type of field to set

  • values[in] Values array to restore

Returns:

An error code: 0 - success, otherwise - failure

static int CeedQFunctionCreateFallback(Ceed fallback_ceed, CeedQFunction qf, CeedQFunction *qf_fallback)

Duplicate a CeedQFunction with a reference Ceed to fallback for advanced CeedOperator functionality.

Library Developer Functions

Parameters:
  • fallback_ceed[in] Ceed on which to create fallback CeedQFunction

  • qf[in] CeedQFunction to create fallback for

  • qf_fallback[out] Fallback CeedQFunction

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorCreateFallback(CeedOperator op)

Duplicate a CeedOperator with a reference Ceed to fallback for advanced CeedOperator functionality.

Library Developer Functions

Parameters:
  • op[inout] CeedOperator to create fallback for

Returns:

An error code: 0 - success, otherwise - failure

static inline int CeedOperatorLinearAssembleAddDiagonalSingle_Mesh(CeedOperator op, CeedRequest *request, const bool is_point_block, CeedVector assembled)

Core logic for assembling operator diagonal or point block diagonal.

Library Developer Functions

Parameters:
  • op[in] CeedOperator to assemble diagonal or point block diagonal

  • request[in] Address of CeedRequest for non-blocking completion, else CEED_REQUEST_IMMEDIATE

  • is_point_block[in] Boolean flag to assemble diagonal or point block diagonal

  • assembled[out] CeedVector to store assembled diagonal

Returns:

An error code: 0 - success, otherwise - failure

static inline int CeedOperatorLinearAssembleAddDiagonalSingle(CeedOperator op, CeedRequest *request, const bool is_point_block, CeedVector assembled)

Core logic for assembling operator diagonal or point block diagonal.

Library Developer Functions

Parameters:
  • op[in] CeedOperator to assemble diagonal or point block diagonal

  • request[in] Address of CeedRequest for non-blocking completion, else CEED_REQUEST_IMMEDIATE

  • is_point_block[in] Boolean flag to assemble diagonal or point block diagonal

  • assembled[out] CeedVector to store assembled diagonal

Returns:

An error code: 0 - success, otherwise - failure

static inline int CeedOperatorLinearAssembleAddDiagonalComposite(CeedOperator op, CeedRequest *request, const bool is_point_block, CeedVector assembled)

Core logic for assembling composite operator diagonal.

Library Developer Functions

Parameters:
  • op[in] CeedOperator to assemble point block diagonal

  • request[in] Address of CeedRequest for non-blocking completion, else CEED_REQUEST_IMMEDIATE

  • is_point_block[in] Boolean flag to assemble diagonal or point block diagonal

  • assembled[out] CeedVector to store assembled diagonal

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorAssemblyCountEntriesSingleBlock(CeedOperator op, CeedElemRestriction active_rstr_in, CeedElemRestriction active_rstr_out, CeedSize *num_entries)

Count number of entries for assembled CeedOperator

Utility Functions

Parameters:
  • op[in] CeedOperator to assemble

  • active_rstr_in[in] CeedElemRestriction for this block input field

  • active_rstr_out[in] CeedElemRestriction for this block output field

  • num_entries[out] Number of entries in assembled representation

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorAssemblyCountEntriesSingle(CeedOperator op, CeedSize *num_entries)

Count number of entries for assembled CeedOperator

Utility Functions

Parameters:
  • op[in] CeedOperator to assemble

  • num_entries[out] Number of entries in assembled representation

Returns:

An error code: 0 - success, otherwise - failure

int CeedOperatorLinearAssembleGetNumEntries(CeedOperator op, CeedSize *num_entries)

Count number of entries for assembled CeedOperator

Utility Functions

Parameters:
  • op[in] CeedOperator to assemble

  • num_entries[out] Number of entries in assembled representation

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorAssembleSymbolicSingleBlock(CeedOperator op, CeedSize offset, CeedElemRestriction elem_rstr_in, CeedElemRestriction elem_rstr_out, CeedInt *rows, CeedInt *cols)

Build nonzero pattern for non-composite CeedOperator.

Users should generally use CeedOperatorLinearAssembleSymbolic().

Library Developer Functions

Parameters:
  • op[in] CeedOperator to assemble nonzero pattern

  • offset[in] Offset for number of entries

  • rows[out] Row number for each entry

  • cols[out] Column number for each entry

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorAssembleSymbolicSingle(CeedOperator op, CeedSize offset, CeedInt *rows, CeedInt *cols)

Build nonzero pattern for non-composite CeedOperator`.

Users should generally use CeedOperatorLinearAssembleSymbolic().

Library Developer Functions

Parameters:
  • op[in] CeedOperator to assemble nonzero pattern

  • offset[in] Offset for number of entries

  • rows[out] Row number for each entry

  • cols[out] Column number for each entry

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorLinearAssembleQFunctionBuildOrUpdate_Core(CeedOperator op, bool use_parent, CeedVector *assembled, CeedElemRestriction *rstr, CeedRequest *request)

Core logic to assemble CeedQFunction and store result internally.

Return copied references of stored data to the caller. Caller is responsible for ownership and destruction of the copied references. See also CeedOperatorLinearAssembleQFunction().

Note: If the value of assembled or rstr passed to this function are non-NULL , then it is assumed that they hold valid pointers. These objects will be destroyed if *assembled or *rstr is the only reference to the object.

User Functions

Parameters:
  • op[in] CeedOperator to assemble CeedQFunction

  • use_parent[in] Boolean flag to check for fallback parent implementation

  • assembled[out] CeedVector to store assembled CeedQFunction at quadrature points

  • rstr[out] CeedElemRestriction for CeedVector containing assembled CeedQFunction

  • request[in] Address of CeedRequest for non-blocking completion, else CEED_REQUEST_IMMEDIATE

Returns:

An error code: 0 - success, otherwise - failure

int CeedOperatorLinearAssembleQFunctionBuildOrUpdateFallback(CeedOperator op, CeedVector *assembled, CeedElemRestriction *rstr, CeedRequest *request)

Assemble CeedQFunction and store result internally, but do not use fallback parent.

Return copied references of stored data to the caller. Caller is responsible for ownership and destruction of the copied references. See also CeedOperatorLinearAssembleQFunction().

Note: If the value of assembled or rstr passed to this function are non-NULL , then it is assumed that they hold valid pointers. These objects will be destroyed if *assembled or *rstr is the only reference to the object.

Library Developer Functions

Parameters:
  • op[in] CeedOperator to assemble CeedQFunction

  • assembled[out] CeedVector to store assembled CeedQFunction at quadrature points

  • rstr[out] CeedElemRestriction for CeedVector containing assembled CeedQFunction

  • request[in] Address of CeedRequest for non-blocking completion, else CEED_REQUEST_IMMEDIATE

Returns:

An error code: 0 - success, otherwise - failure

int CeedOperatorAssembleSingleBlock(CeedOperator op, CeedInt offset, CeedInt active_input, CeedInt active_output, CeedVector values)

Assemble nonzero entries for non-composite CeedOperator.

Users should generally use CeedOperatorLinearAssemble().

Library Developer Functions

Parameters:
  • op[in] CeedOperator to assemble

  • offset[in] Offset for number of entries

  • values[out] Values to assemble into matrix

Returns:

An error code: 0 - success, otherwise - failure

int CeedOperatorAssembleSingle(CeedOperator op, CeedSize offset, CeedVector values)

Assemble nonzero entries for non-composite CeedOperator.

Users should generally use CeedOperatorLinearAssemble().

Library Developer Functions

Parameters:
  • op[in] CeedOperator to assemble

  • offset[in] Offset for number of entries

  • values[out] Values to assemble into matrix

Returns:

An error code: 0 - success, otherwise - failure

static int CeedOperatorMultigridLevelCreateSingle_Core(CeedOperator op_fine, CeedVector p_mult_fine, CeedElemRestriction rstr_coarse, CeedBasis basis_coarse, CeedBasis basis_c_to_f, CeedOperator *op_coarse, CeedOperator *op_prolong, CeedOperator *op_restrict)

Common code for creating a multigrid coarse CeedOperator and level transfer CeedOperator for a CeedOperator

Library Developer Functions

Parameters:
  • op_fine[in] Fine grid CeedOperator

  • p_mult_fine[in] L-vector multiplicity in parallel gather/scatter, or NULL if not creating prolongation/restriction CeedOperator

  • rstr_coarse[in] Coarse grid CeedElemRestriction

  • basis_coarse[in] Coarse grid active vector CeedBasis

  • basis_c_to_f[in] CeedBasis for coarse to fine interpolation, or NULL if not creating prolongation/restriction operators

  • op_coarse[out] Coarse grid CeedOperator

  • op_prolong[out] Coarse to fine CeedOperator, or NULL

  • op_restrict[out] Fine to coarse CeedOperator, or NULL

Returns:

An error code: 0 - success, otherwise - failure

static int CeedBuildMassLaplace(const CeedScalar *interp_1d, const CeedScalar *grad_1d, const CeedScalar *q_weight_1d, CeedInt P_1d, CeedInt Q_1d, CeedInt dim, CeedScalar *mass, CeedScalar *laplace)

Build 1D mass matrix and Laplacian with perturbation.

Library Developer Functions

Parameters:
  • interp_1d[in] Interpolation matrix in one dimension

  • grad_1d[in] Gradient matrix in one dimension

  • q_weight_1d[in] Quadrature weights in one dimension

  • P_1d[in] Number of basis nodes in one dimension

  • Q_1d[in] Number of quadrature points in one dimension

  • dim[in] Dimension of basis

  • mass[out] Assembled mass matrix in one dimension

  • laplace[out] Assembled perturbed Laplacian in one dimension

Returns:

An error code: 0 - success, otherwise - failure