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, bool sub, bool 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

  • 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 or a file

Returns:

Error code: 0 - success, otherwise - failure

int CeedOperatorGetActiveBasis(CeedOperator op, CeedBasis *active_basis)

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

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

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

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

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.

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 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.

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 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.

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

static inline int CeedSingleOperatorLinearAssembleAddDiagonal_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 CeedSingleOperatorLinearAssembleAddDiagonal(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 CeedCompositeOperatorLinearAssembleAddDiagonal(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 CeedSingleOperatorAssembleSymbolic(CeedOperator op, CeedInt 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 CeedSingleOperatorAssemble(CeedOperator op, CeedInt 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 CeedSingleOperatorAssemblyCountEntries(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 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 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