CeedBasis
-
int CeedBasisGetCollocatedGrad(CeedBasis basis, CeedScalar *collo_grad_1d)
Return collocated gradient matrix.
Backend Developer Functions
- Parameters:
basis – [in]
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 CeedBasisGetChebyshevInterp1D(CeedBasis basis, CeedScalar *chebyshev_interp_1d)
Return 1D interpolation matrix to Chebyshev polynomial coefficients on quadrature space.
Backend Developer Functions
- Parameters:
basis – [in]
CeedBasis
chebyshev_interp_1d – [out] Row-major (
P_1d * Q_1d
) matrix interpolating from basis nodes to Chebyshev polynomial coefficients
- 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 – [in]
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 – [in]
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 – [inout]
CeedBasis
data – [in] 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 – [inout]
CeedBasis
to increment the reference counter
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedBasisGetNumQuadratureComponents(CeedBasis basis, CeedEvalMode eval_mode, CeedInt *q_comp)
Get number of Q-vector components for given
CeedBasis
Backend Developer Functions
- Parameters:
basis – [in]
CeedBasis
eval_mode – [in] CEED_EVAL_INTERP to use interpolated values, CEED_EVAL_GRAD to use gradients, CEED_EVAL_DIV to use divergence, CEED_EVAL_CURL to use curl
q_comp – [out] Variable to store number of Q-vector components of basis
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedBasisGetFlopsEstimate(CeedBasis basis, CeedTransposeMode t_mode, CeedEvalMode eval_mode, CeedSize *flops)
Estimate number of FLOPs required to apply
CeedBasis
int_mode
andeval_mode
Backend Developer Functions
- Parameters:
basis – [in]
CeedBasis
to estimate FLOPs fort_mode – [in] Apply basis or transpose
eval_mode – [in] CeedEvalMode
flops – [out] Address of variable to hold FLOPs estimate
-
int CeedBasisGetFESpace(CeedBasis basis, CeedFESpace *fe_space)
Get
CeedFESpace
for aCeedBasis
Backend Developer Functions
- Parameters:
basis – [in]
CeedBasis
fe_space – [out] Variable to store
CeedFESpace
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedBasisGetTopologyDimension(CeedElemTopology topo, CeedInt *dim)
Get dimension for given
CeedElemTopology
Backend Developer Functions
- Parameters:
topo – [in]
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 aCeedBasis
Backend Developer Functions
- Parameters:
basis – [in]
CeedBasis
contract – [out] Variable to store
CeedTensorContract
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedBasisSetTensorContract(CeedBasis basis, CeedTensorContract contract)
Set
CeedTensorContract
of aCeedBasis
Backend Developer Functions
- Parameters:
basis – [inout]
CeedBasis
contract – [in]
CeedTensorContract
to set
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedMatrixMatrixMultiply(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 – [in]
Ceed
context for error handlingmat_A – [in] Row-major matrix
A
mat_B – [in] Row-major matrix
B
mat_C – [out] Row-major output matrix
C
m – [in] Number of rows of
C
n – [in] Number of columns of
C
kk – [in] Number of columns of
A
/rows ofB
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedQRFactorization(Ceed ceed, CeedScalar *mat, CeedScalar *tau, CeedInt m, CeedInt n)
Return QR Factorization of a matrix.
Utility Functions
- Parameters:
ceed – [in]
Ceed
context for error handlingmat – [inout] Row-major matrix to be factorized in place
tau – [inout] Vector of length
m
of scaling factorsm – [in] Number of rows
n – [in] Number of columns
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedHouseholderApplyQ(CeedScalar *mat_A, const CeedScalar *mat_Q, const CeedScalar *tau, CeedTransposeMode t_mode, CeedInt m, CeedInt n, CeedInt k, CeedInt row, CeedInt col)
Apply Householder Q matrix.
Compute
mat_A = mat_Q mat_A
, wheremat_Q
is \(m \times m\) andmat_A
is \(m \times n\).Utility Functions
- Parameters:
mat_A – [inout] Matrix to apply Householder Q to, in place
mat_Q – [in] Householder Q matrix
tau – [in] Householder scaling factors
t_mode – [in] Transpose mode for application
m – [in] Number of rows in
A
n – [in] Number of columns in
A
k – [in] Number of elementary reflectors in Q,
k < m
row – [in] Row stride in
A
col – [in] Col stride in
A
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedMatrixPseudoinverse(Ceed ceed, const CeedScalar *mat, CeedInt m, CeedInt n, CeedScalar *mat_pinv)
Return pseudoinverse of a matrix.
Utility Functions
- Parameters:
ceed – [in] Ceed context for error handling
mat – [in] Row-major matrix to compute pseudoinverse of
m – [in] Number of rows
n – [in] Number of columns
mat_pinv – [out] Row-major pseudoinverse matrix
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedSymmetricSchurDecomposition(Ceed ceed, CeedScalar *mat, CeedScalar *lambda, CeedInt n)
Return symmetric Schur decomposition of the symmetric matrix mat via symmetric QR factorization.
Utility Functions
- Parameters:
ceed – [in]
Ceed
context for error handlingmat – [inout] Row-major matrix to be factorized in place
lambda – [out] Vector of length n of eigenvalues
n – [in] Number of rows/columns
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedSimultaneousDiagonalization(Ceed ceed, CeedScalar *mat_A, CeedScalar *mat_B, CeedScalar *mat_X, CeedScalar *lambda, CeedInt n)
Return Simultaneous Diagonalization of two matrices.
This solves the generalized eigenvalue problem
A x = lambda B x
, whereA
andB
are symmetric andB
is positive definite. We generate the matrixX
and vectorLambda
such thatX^T A X = Lambda
andX^T B X = I
. This is equivalent to the LAPACK routine ‘sygv’ withTYPE = 1
.Utility Functions
- Parameters:
ceed – [in]
Ceed
context for error handlingmat_A – [in] Row-major matrix to be factorized with eigenvalues
mat_B – [in] Row-major matrix to be factorized to identity
mat_X – [out] Row-major orthogonal matrix
lambda – [out] Vector of length
n
of generalized eigenvaluesn – [in] Number of rows/columns
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedTensorContractCreate(Ceed ceed, CeedTensorContract *contract)
Create a
CeedTensorContract
object for aCeedBasis
Backend Developer Functions
- Parameters:
ceed – [in]
Ceed
object used to create theCeedTensorContract
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
Ifadd != 0
,=
is replaced by+=
Backend Developer Functions
- Parameters:
contract – [in]
CeedTensorContract
to useA – [in] First index of
u
,v
B – [in] Middle index of
u
, one index oft
C – [in] Last index of
u
,v
J – [in] Middle index of
v
, one index oft
t – [in] Tensor array to contract against
t_mode – [in] Transpose mode for
t
, CEED_NOTRANSPOSE fort_jb
CEED_TRANSPOSE fort_bj
add – [in] Add mode
u – [in] Input array
v – [out] Output array
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedTensorContractStridedApply(CeedTensorContract contract, CeedInt A, CeedInt B, CeedInt C, CeedInt D, 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_dajc = t_djb u_abc
TRANSPOSE:v_ajc = t_dbj u_dabc
Ifadd != 0
,=
is replaced by+=
Backend Developer Functions
- Parameters:
contract – [in]
CeedTensorContract
to useA – [in] First index of
u
, second index ofv
B – [in] Middle index of
u
, one of last two indices oft
C – [in] Last index of
u
,v
D – [in] First index of
v
, first index oft
J – [in] Third index of
v
, one of last two indices oft
t – [in] Tensor array to contract against
t_mode – [in] Transpose mode for
t
, CEED_NOTRANSPOSE fort_djb
CEED_TRANSPOSE fort_dbj
add – [in] 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 the
Ceed
associated with aCeedTensorContract
Backend Developer Functions
- Parameters:
contract – [in]
CeedTensorContract
ceed – [out] Variable to store
Ceed
- Returns:
An error code: 0 - success, otherwise - failure
-
Ceed CeedTensorContractReturnCeed(CeedTensorContract contract)
Return the
Ceed
associated with aCeedTensorContract
Backend Developer Functions
- Parameters:
contract – [in]
CeedTensorContract
- Returns:
Ceed
associated withcontract
-
int CeedTensorContractGetData(CeedTensorContract contract, void *data)
Get backend data of a
CeedTensorContract
Backend Developer Functions
- Parameters:
contract – [in]
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 – [inout]
CeedTensorContract
data – [in] 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 – [inout]
CeedTensorContract
to increment the reference counter
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedTensorContractReferenceCopy(CeedTensorContract tensor, CeedTensorContract *tensor_copy)
Copy the pointer to a
CeedTensorContract
.Both pointers should be destroyed with CeedTensorContractDestroy().
Note: If the value of
*tensor_copy
passed to this function is non-NULL
, then it is assumed that*tensor_copy
is a pointer to aCeedTensorContract
. ThisCeedTensorContract
will be destroyed if*tensor_copy
is the only reference to thisCeedTensorContract
.User Functions
- Parameters:
tensor – [in]
CeedTensorContract
to copy reference totensor_copy – [inout] Variable to store copied reference
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedTensorContractDestroy(CeedTensorContract *contract)
Destroy a
CeedTensorContract
Backend Developer Functions
- Parameters:
contract – [inout]
CeedTensorContract
to destroy
- Returns:
An error code: 0 - success, otherwise - failure