CeedBasis

int CeedBasisGetCollocatedGrad(CeedBasis basis, CeedScalar *collo_grad_1d)

Return collocated grad matrix.

Backend Developer Functions

Parameters
  • basis – CeedBasis

  • collo_grad_1d[out] Row-major (Q_1d * Q_1d) matrix expressing derivatives of basis functions at quadrature points

Returns

An error code: 0 - success, otherwise - failure

int CeedBasisIsTensor(CeedBasis basis, bool *is_tensor)

Get tensor status for given CeedBasis.

Backend Developer Functions

Parameters
  • basis – CeedBasis

  • is_tensor[out] Variable to store tensor status

Returns

An error code: 0 - success, otherwise - failure

int CeedBasisGetData(CeedBasis basis, void *data)

Get backend data of a CeedBasis.

Backend Developer Functions

Parameters
  • basis – CeedBasis

  • data[out] Variable to store data

Returns

An error code: 0 - success, otherwise - failure

int CeedBasisSetData(CeedBasis basis, void *data)

Set backend data of a CeedBasis.

Backend Developer Functions

Parameters
  • basis[out] CeedBasis

  • data – Data to set

Returns

An error code: 0 - success, otherwise - failure

int CeedBasisReference(CeedBasis basis)

Increment the reference counter for a CeedBasis.

Backend Developer Functions

Parameters
  • basis – Basis to increment the reference counter

Returns

An error code: 0 - success, otherwise - failure

int CeedBasisGetTopologyDimension(CeedElemTopology topo, CeedInt *dim)

Get dimension for given CeedElemTopology.

Backend Developer Functions

Parameters
  • topo – CeedElemTopology

  • dim[out] Variable to store dimension of topology

Returns

An error code: 0 - success, otherwise - failure

int CeedBasisGetTensorContract(CeedBasis basis, CeedTensorContract *contract)

Get CeedTensorContract of a CeedBasis.

Backend Developer Functions

Parameters
  • basis – CeedBasis

  • contract[out] Variable to store CeedTensorContract

Returns

An error code: 0 - success, otherwise - failure

int CeedBasisSetTensorContract(CeedBasis basis, CeedTensorContract contract)

Set CeedTensorContract of a CeedBasis.

Backend Developer Functions

Parameters
  • basis[out] CeedBasis

  • contract – CeedTensorContract to set

Returns

An error code: 0 - success, otherwise - failure

int CeedMatrixMultiply(Ceed ceed, const CeedScalar *mat_A, const CeedScalar *mat_B, CeedScalar *mat_C, CeedInt m, CeedInt n, CeedInt kk)

Return a reference implementation of matrix multiplication C = A B.

Note, this is a reference implementation for CPU CeedScalar pointers that is not intended for high performance.

Utility Functions

Parameters
  • ceed – A Ceed context for error handling

  • mat_A[in] Row-major matrix A

  • mat_B[in] Row-major matrix B

  • mat_C[out] Row-major output matrix C

  • m – Number of rows of C

  • n – Number of columns of C

  • kk – Number of columns of A/rows of B

Returns

An error code: 0 - success, otherwise - failure

int CeedTensorContractCreate(Ceed ceed, CeedBasis basis, CeedTensorContract *contract)

Create a CeedTensorContract object for a CeedBasis.

Backend Developer Functions

Parameters
  • ceed – A Ceed object where the CeedTensorContract will be created

  • basis – CeedBasis for which the tensor contraction will be used

  • contract[out] Address of the variable where the newly created CeedTensorContract will be stored.

Returns

An error code: 0 - success, otherwise - failure

int CeedTensorContractApply(CeedTensorContract contract, CeedInt A, CeedInt B, CeedInt C, CeedInt J, const CeedScalar *restrict t, CeedTransposeMode t_mode, const CeedInt add, const CeedScalar *restrict u, CeedScalar *restrict v)

Apply tensor contraction.

Contracts on the middle index NOTRANSPOSE: v_ajc = t_jb u_abc TRANSPOSE: v_ajc = t_bj u_abc If add != 0, “=” is replaced by “+=”

Backend Developer Functions

Parameters
  • contract – CeedTensorContract to use

  • A – First index of u, v

  • B – Middle index of u, one index of t

  • C – Last index of u, v

  • J – Middle index of v, one index of t

  • t[in] Tensor array to contract against

  • t_mode – Transpose mode for t, CEED_NOTRANSPOSE for t_jb CEED_TRANSPOSE for t_bj

  • add – Add mode

  • u[in] Input array

  • v[out] Output array

Returns

An error code: 0 - success, otherwise - failure

int CeedTensorContractGetCeed(CeedTensorContract contract, Ceed *ceed)

Get Ceed associated with a CeedTensorContract.

Backend Developer Functions

Parameters
  • contract – CeedTensorContract

  • ceed[out] Variable to store Ceed

Returns

An error code: 0 - success, otherwise - failure

int CeedTensorContractGetData(CeedTensorContract contract, void *data)

Get backend data of a CeedTensorContract.

Backend Developer Functions

Parameters
  • contract – CeedTensorContract

  • data[out] Variable to store data

Returns

An error code: 0 - success, otherwise - failure

int CeedTensorContractSetData(CeedTensorContract contract, void *data)

Set backend data of a CeedTensorContract.

Backend Developer Functions

Parameters
  • contract[out] CeedTensorContract

  • data – Data to set

Returns

An error code: 0 - success, otherwise - failure

int CeedTensorContractReference(CeedTensorContract contract)

Increment the reference counter for a CeedTensorContract.

Backend Developer Functions

Parameters
  • contract – CeedTensorContract to increment the reference counter

Returns

An error code: 0 - success, otherwise - failure

int CeedTensorContractDestroy(CeedTensorContract *contract)

Destroy a CeedTensorContract.

Backend Developer Functions

Parameters
  • contract – CeedTensorContract to destroy

Returns

An error code: 0 - success, otherwise - failure