CeedOperator

static int CeedOperatorCheckField(Ceed ceed, CeedQFunctionField qf_field, CeedElemRestriction r, CeedBasis b)

Check if a CeedOperator Field matches the QFunction Field.

Library Developer Functions

Parameters
  • ceed[in] Ceed object for error handling

  • qf_field[in] QFunction Field matching Operator Field

  • r[in] Operator Field ElemRestriction

  • b[in] Operator Field Basis

Returns

An error code: 0 - success, otherwise - failure

static int CeedOperatorFieldView(CeedOperatorField field, CeedQFunctionField qf_field, CeedInt field_number, bool sub, bool input, FILE *stream)

View a field of a CeedOperator.

Utility Functions

Parameters
  • field[in] Operator field to view

  • qf_field[in] QFunction field (carries field name)

  • field_number[in] Number of field being viewed

  • sub[in] true indicates sub-operator, which increases indentation; false for top-level operator

  • 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, bool sub, FILE *stream)

View a single CeedOperator.

Utility Functions

Parameters
  • op[in] CeedOperator to view

  • sub[in] Boolean flag for sub-operator

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

Returns

Error code: 0 - success, otherwise - failure

int CeedOperatorGetActiveBasis(CeedOperator op, CeedBasis *active_basis)

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

Library Developer Functions

Parameters
  • op[in] CeedOperator to find active basis for

  • active_basis[out] Basis for active input 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 ElemRestriction for a non-composite CeedOperator.

Utility Functions

Parameters
  • op[in] CeedOperator to find active basis for

  • active_rstr[out] ElemRestriction for active input 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 QFunctionContext field values of the specified type.

For composite operators, the value is set in all sub-operator QFunctionContexts 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.

User 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 QFunctionContext field values of the specified type, read-only.

For composite operators, the values retrieved are for the first sub-operator QFunctionContext 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.

User 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 QFunctionContext field values of the specified type, read-only.

For composite operators, the values restored are for the first sub-operator QFunctionContext 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.

User 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

int CeedOperatorGetFallback(CeedOperator op, CeedOperator *op_fallback)

Retrieve fallback CeedOperator with a reference Ceed for advanced CeedOperator functionality.

Library Developer Functions

Parameters
  • op[in] CeedOperator to retrieve fallback for

  • op_fallback[out] Fallback CeedOperator

Returns

An error code: 0 - success, otherwise - failure

static inline int CeedOperatorGetBasisPointer(CeedBasis basis, CeedEvalMode eval_mode, const CeedScalar *identity, const CeedScalar **basis_ptr)

Select correct basis matrix pointer based on CeedEvalMode.

Library Developer Functions

Parameters
  • basis[in] CeedBasis from which to get the basis matrix

  • eval_mode[in] Current basis evaluation mode

  • identity[in] Pointer to identity matrix

  • basis_ptr[out] Basis pointer to set

static int CeedOperatorCreateActivePointBlockRestriction(CeedElemRestriction rstr, CeedElemRestriction *pointblock_rstr)

Create point block restriction for active operator field.

Library Developer Functions

Parameters
  • rstr[in] Original CeedElemRestriction for active field

  • pointblock_rstr[out] Address of the variable where the newly created CeedElemRestriction will be stored

Returns

An error code: 0 - success, otherwise - failure

static inline int CeedSingleOperatorAssembleAddDiagonal_Core(CeedOperator op, CeedRequest *request, const bool is_pointblock, CeedVector assembled)

Core logic for assembling operator diagonal or point block 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_pointblock[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 CeedCompositeOperatorLinearAssembleAddDiagonal(CeedOperator op, CeedRequest *request, const bool is_pointblock, 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_pointblock[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 CeedSingleOperatorAssembleSymbolic(CeedOperator op, CeedInt offset, CeedInt *rows, CeedInt *cols)

Build nonzero pattern for non-composite operator.

Users should generally use CeedOperatorLinearAssembleSymbolic()

Note: For operators using oriented element restrictions, entries in rows or cols may be negative indicating the assembled value at this nonzero should be negated

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 CeedSingleOperatorAssemble(CeedOperator op, CeedInt offset, CeedVector values)

Assemble nonzero entries for non-composite operator.

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 CeedSingleOperatorAssemblyCountEntries(CeedOperator op, CeedInt *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 CeedSingleOperatorMultigridLevel(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 operator and level transfer operators for a CeedOperator.

Library Developer Functions

Parameters
  • op_fine[in] Fine grid operator

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

  • rstr_coarse[in] Coarse grid restriction

  • basis_coarse[in] Coarse grid active vector basis

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

  • op_coarse[out] Coarse grid operator

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

  • op_restrict[out] Fine to coarse operator, 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