CeedBasis
-
static int CeedChebyshevPolynomialsAtPoint(CeedScalar x, CeedInt n, CeedScalar *chebyshev_x)
Compute Chebyshev polynomial values at a point.
Library Developer Functions
- Parameters:
x – [in] Coordinate to evaluate Chebyshev polynomials at
n – [in] Number of Chebyshev polynomials to evaluate,
n >= 2chebyshev_x – [out] Array of Chebyshev polynomial values
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedChebyshevDerivativeAtPoint(CeedScalar x, CeedInt n, CeedScalar *chebyshev_dx)
Compute values of the derivative of Chebyshev polynomials at a point.
Library Developer Functions
- Parameters:
x – [in] Coordinate to evaluate derivative of Chebyshev polynomials at
n – [in] Number of Chebyshev polynomials to evaluate,
n >= 2chebyshev_dx – [out] Array of Chebyshev polynomial derivative values
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedHouseholderReflect(CeedScalar *A, const CeedScalar *v, CeedScalar b, CeedInt m, CeedInt n, CeedInt row, CeedInt col)
Compute Householder reflection.
Computes \(A = (I - b v v^T) A\), where \(A\) is an \(m \times n\) matrix indexed as
A[i*row + j*col].Library Developer Functions
- Parameters:
A – [inout] Matrix to apply Householder reflection to, in place
v – [in] Householder vector
b – [in] Scaling factor
m – [in] Number of rows in
An – [in] Number of columns in
Arow – [in] Row stride
col – [in] Col stride
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedGivensRotation(CeedScalar *A, CeedScalar c, CeedScalar s, CeedTransposeMode t_mode, CeedInt i, CeedInt k, CeedInt m, CeedInt n)
Compute Givens rotation.
Computes \(A = G A\) (or \(G^T A\) in transpose mode), where \(A\) is an \(m \times n\) matrix indexed as
A[i*n + j*m].Library Developer Functions
- Parameters:
A – [inout] Row major matrix to apply Givens rotation to, in place
c – [in] Cosine factor
s – [in] Sine factor
t_mode – [in] CEED_NOTRANSPOSE to rotate the basis counter-clockwise, which has the effect of rotating columns of
Aclockwise; CEED_TRANSPOSE for the opposite rotationi – [in] First row/column to apply rotation
k – [in] Second row/column to apply rotation
m – [in] Number of rows in
An – [in] Number of columns in
A
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedScalarView(const char *name, const char *fp_fmt, CeedInt m, CeedInt n, const CeedScalar *a, const char *tabs, FILE *stream)
View an array stored in a
CeedBasisLibrary Developer Functions
- Parameters:
name – [in] Name of array
fp_fmt – [in] Printing format
m – [in] Number of rows in array
n – [in] Number of columns in array
a – [in] Array to be viewed
tabs – [in] Tabs to append before each new line
stream – [in] Stream to view to, e.g.,
stdout
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedBasisView_Object(CeedObject basis, FILE *stream)
View a
CeedBasispassed as aCeedObjectLibrary Developer Functions
- Parameters:
basis – [in]
CeedBasisto viewstream – [in] Filestream to write to
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedBasisDestroy_Object(CeedObject *basis)
Destroy a
CeedBasispassed as aCeedObjectLibrary Developer Functions
- Parameters:
basis – [inout] Address of
CeedBasisto destroy
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedBasisCreateProjectionMatrices(CeedBasis basis_from, CeedBasis basis_to, CeedScalar **interp_project, CeedScalar **grad_project)
Create the interpolation and gradient matrices for projection from the nodes of
basis_fromto the nodes ofbasis_to.The interpolation is given by
interp_project = interp_to^+ * interp_from, where the pseudoinverseinterp_to^+is given by QR factorization. The gradient is given bygrad_project = interp_to^+ * grad_from, and is only computed for \(H^1\) spaces otherwise it should not be used.Note:
basis_fromandbasis_tomust have compatible quadrature spaces.Library Developer Functions
- Parameters:
basis_from – [in]
CeedBasisto project frombasis_to – [in]
CeedBasisto project tointerp_project – [out] Address of the variable where the newly created interpolation matrix will be stored
grad_project – [out] Address of the variable where the newly created gradient matrix will be stored
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedBasisApplyCheckDims(CeedBasis basis, CeedInt num_elem, CeedTransposeMode t_mode, CeedEvalMode eval_mode, CeedVector u, CeedVector v)
Check input vector dimensions for CeedBasisApply[Add].
Library Developer Functions
- Parameters:
basis – [in]
CeedBasisto evaluatenum_elem – [in] The number of elements to apply the basis evaluation to; the backend will specify the ordering in CeedElemRestrictionCreate()
t_mode – [in] CEED_NOTRANSPOSE to evaluate from nodes to quadrature points; CEED_TRANSPOSE to apply the transpose, mapping from quadrature points to nodes
eval_mode – [in] CEED_EVAL_NONE to use values directly, 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, CEED_EVAL_WEIGHT to use quadrature weights
u – [in] Input
CeedVectorv – [out] Output
CeedVector
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedBasisApplyAtPointsCheckDims(CeedBasis basis, CeedInt num_elem, const CeedInt *num_points, CeedTransposeMode t_mode, CeedEvalMode eval_mode, CeedVector x_ref, CeedVector u, CeedVector v)
Check input vector dimensions for CeedBasisApply[Add]AtPoints.
Library Developer Functions
- Parameters:
basis – [in]
CeedBasisto evaluatenum_elem – [in] The number of elements to apply the basis evaluation to; the backend will specify the ordering in CeedElemRestrictionCreate()
num_points – [in] Array of the number of points to apply the basis evaluation to in each element, size
num_elemt_mode – [in] CEED_NOTRANSPOSE to evaluate from nodes to points; CEED_TRANSPOSE to apply the transpose, mapping from points to nodes
eval_mode – [in] CEED_EVAL_INTERP to use interpolated values, CEED_EVAL_GRAD to use gradients, CEED_EVAL_WEIGHT to use quadrature weights
x_ref – [in]
CeedVectorholding reference coordinates of each pointu – [in] Input
CeedVector, of lengthnum_nodes * num_compfor CEED_NOTRANSPOSEv – [out] Output
CeedVector, of lengthnum_points * num_q_compfor CEED_NOTRANSPOSE with CEED_EVAL_INTERP
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedBasisApplyAtPoints_Core(CeedBasis basis, bool apply_add, CeedInt num_elem, const CeedInt *num_points, CeedTransposeMode t_mode, CeedEvalMode eval_mode, CeedVector x_ref, CeedVector u, CeedVector v)
Default implimentation to apply basis evaluation from nodes to arbitrary points.
Library Developer Functions
- Parameters:
basis – [in]
CeedBasisto evaluateapply_add – [in] Sum result into target vector or overwrite
num_elem – [in] The number of elements to apply the basis evaluation to; the backend will specify the ordering in CeedElemRestrictionCreate()
num_points – [in] Array of the number of points to apply the basis evaluation to in each element, size
num_elemt_mode – [in] CEED_NOTRANSPOSE to evaluate from nodes to points; CEED_TRANSPOSE to apply the transpose, mapping from points to nodes
eval_mode – [in] CEED_EVAL_INTERP to use interpolated values, CEED_EVAL_GRAD to use gradients, CEED_EVAL_WEIGHT to use quadrature weights
x_ref – [in]
CeedVectorholding reference coordinates of each pointu – [in] Input
CeedVector, of lengthnum_nodes * num_compfor CEED_NOTRANSPOSEv – [out] Output
CeedVector, of lengthnum_points * num_q_compfor CEED_NOTRANSPOSE with CEED_EVAL_INTERP
- Returns:
An error code: 0 - success, otherwise - failure