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

int CeedOperatorCheckReady(CeedOperator op)

Check if a CeedOperator is ready to be used.

Library Developer Functions

Parameters
  • op[in] CeedOperator to check

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

@ ref Developer

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

  • active_basis[out] Basis for active input vector

Returns

An error code: 0 - success, otherwise - failure

int CeedOperatorGetActiveElemRestriction(CeedOperator op, CeedElemRestriction *active_rstr)

Find the active vector ElemRestriction for a CeedOperator.

Utility Functions

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

  • active_rstr[out] ElemRestriction for active input vector

Returns

An error code: 0 - success, otherwise - failure

int CeedOperatorCreateFallback(CeedOperator op)

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

Library Developer Functions

Parameters
  • op – CeedOperator to create fallback for

Returns

An error code: 0 - success, otherwise - failure

static inline void CeedOperatorGetBasisPointer(CeedEvalMode eval_mode, const CeedScalar *identity, const CeedScalar *interp, const CeedScalar *grad, const CeedScalar **basis_ptr)

Select correct basis matrix pointer based on CeedEvalMode.

Library Developer Functions

Parameters
  • eval_mode[in] Current basis evaluation mode

  • identity[in] Pointer to identity matrix

  • interp[in] Pointer to interpolation matrix

  • grad[in] Pointer to gradient matrix

  • basis_ptr[out] Basis pointer to set

Returns

none

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(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()

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[out] Offest 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

  • 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

  • op_coarse[out] Coarse grid operator

  • op_prolong[out] Coarse to fine operator

  • op_restrict[out] Fine to coarse operator

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