CeedOperator
-
static int CeedOperatorCheckField(Ceed ceed, CeedQFunctionField qf_field, CeedElemRestriction rstr, CeedBasis basis)
Check if a
CeedOperatorField matches theCeedQFunctionField.Library Developer Functions
- Parameters:
ceed – [in]
Ceedobject for error handlingqf_field – [in]
CeedQFunctionField matchingCeedOperatorFieldrstr – [in]
CeedOperatorFieldCeedElemRestrictionbasis – [in]
CeedOperatorFieldCeedBasis
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedOperatorFieldView(CeedOperatorField op_field, CeedQFunctionField qf_field, CeedInt field_number, const char *tabs, bool is_input, FILE *stream)
View a field of a
CeedOperatorUtility Functions
- Parameters:
op_field – [in]
CeedOperatorField to viewqf_field – [in]
CeedQFunctionField (carries field name)field_number – [in] Number of field being viewed
tabs – [in] Tabs to append before each line
is_input – [in]
truefor an input field;falsefor output fieldstream – [in] Stream to view to, e.g.,
stdout
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedOperatorSingleView(CeedOperator op, const char *tabs, FILE *stream)
View a single
CeedOperatorUtility Functions
- Parameters:
op – [in]
CeedOperatorto viewtabs – [in] Tabs to append before each new line
stream – [in] Stream to write; typically
stdoutor a file
- Returns:
Error code: 0 - success, otherwise - failure
-
static int CeedOperatorView_Object(CeedObject op, FILE *stream)
View a
CeedOperatorpassed as aCeedObjectLibrary Developer Functions
- Parameters:
op – [in]
CeedOperatorto viewstream – [in] Filestream to write to
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedOperatorDestroy_Object(CeedObject *op)
Destroy a
CeedOperatorpassed as aCeedObjectLibrary Developer Functions
- Parameters:
op – [inout] Address of
CeedOperatorto destroy
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedOperatorGetActiveBasis(CeedOperator op, CeedBasis *active_basis)
Find the active input vector
CeedBasisfor a non-compositeCeedOperator.Note: Caller is responsible for destroying the
active_basiswith CeedBasisDestroy().Library Developer Functions
- Parameters:
op – [in]
CeedOperatorto find activeCeedBasisforactive_basis – [out]
CeedBasisfor active input vector orNULLfor 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
CeedBasisfor a non-compositeCeedOperator.Note: Caller is responsible for destroying the bases with CeedBasisDestroy().
Library Developer Functions
- Parameters:
op – [in]
CeedOperatorto find activeCeedBasisforactive_input_basis – [out]
CeedBasisfor active input vector orNULLfor composite operatoractive_output_basis – [out]
CeedBasisfor active output vector orNULLfor composite operator
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedOperatorGetActiveElemRestriction(CeedOperator op, CeedElemRestriction *active_rstr)
Find the active vector
CeedElemRestrictionfor a non-compositeCeedOperator.Note: Caller is responsible for destroying the
active_rstrwith CeedElemRestrictionDestroy().Utility Functions
- Parameters:
op – [in]
CeedOperatorto find activeCeedElemRestrictionforactive_rstr – [out]
CeedElemRestrictionfor 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
CeedElemRestrictionfor a non-compositeCeedOperator.Note: Caller is responsible for destroying the restrictions with CeedElemRestrictionDestroy().
Utility Functions
- Parameters:
op – [in]
CeedOperatorto find activeCeedElemRestrictionforactive_input_rstr – [out]
CeedElemRestrictionfor active input vector or NULL for composite operatoractive_output_rstr – [out]
CeedElemRestrictionfor 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
CeedQFunctionContextfield values of the specified type.For composite operators, the value is set in all sub-operator
CeedQFunctionContextthat have a matchingfield_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.Library Developer Functions
- Parameters:
op – [inout]
CeedOperatorfield_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
CeedQFunctionContextfield values of the specified type, read-only.For composite operators, the values retrieved are for the first sub-operator
CeedQFunctionContextthat have a matchingfield_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.Library Developer Functions
- Parameters:
op – [inout]
CeedOperatorfield_label – [in] Label of field to set
field_type – [in] Type of field to set
num_values – [out] Number of values of type
field_typein arrayvaluesvalues – [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
CeedQFunctionContextfield values of the specified type, read-only.For composite operators, the values restored are for the first sub-operator
CeedQFunctionContextthat have a matchingfield_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.Library Developer Functions
- Parameters:
op – [inout]
CeedOperatorfield_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
CeedQFunctionwith a referenceCeedto fallback for advancedCeedOperatorfunctionality.Library Developer Functions
- Parameters:
fallback_ceed – [in]
Ceedon which to create fallbackCeedQFunctionqf – [in]
CeedQFunctionto create fallback forqf_fallback – [out] Fallback
CeedQFunction
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedOperatorCreateFallback(CeedOperator op)
Duplicate a
CeedOperatorwith a referenceCeedto fallback for advancedCeedOperatorfunctionality.Library Developer Functions
- Parameters:
op – [inout]
CeedOperatorto create fallback for
- Returns:
An error code: 0 - success, otherwise - failure
-
static inline int CeedOperatorLinearAssembleAddDiagonalSingle_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]
CeedOperatorto assemble diagonal or point block diagonalrequest – [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]
CeedVectorto store assembled diagonal
- Returns:
An error code: 0 - success, otherwise - failure
-
static inline int CeedOperatorLinearAssembleAddDiagonalSingle(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]
CeedOperatorto assemble diagonal or point block diagonalrequest – [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]
CeedVectorto store assembled diagonal
- Returns:
An error code: 0 - success, otherwise - failure
-
static inline int CeedOperatorLinearAssembleAddDiagonalComposite(CeedOperator op, CeedRequest *request, const bool is_point_block, CeedVector assembled)
Core logic for assembling composite operator diagonal.
Library Developer Functions
- Parameters:
op – [in]
CeedOperatorto assemble point block diagonalrequest – [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]
CeedVectorto store assembled diagonal
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedOperatorAssemblyCountEntriesSingleBlock(CeedOperator op, CeedElemRestriction active_rstr_in, CeedElemRestriction active_rstr_out, CeedSize *num_entries)
Count number of entries for assembled
CeedOperatorUtility Functions
- Parameters:
op – [in]
CeedOperatorto assembleactive_rstr_in – [in]
CeedElemRestrictionfor this block input fieldactive_rstr_out – [in]
CeedElemRestrictionfor this block output fieldnum_entries – [out] Number of entries in assembled representation
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedOperatorAssemblyCountEntriesSingle(CeedOperator op, CeedSize *num_entries)
Count number of entries for assembled
CeedOperatorUtility Functions
- Parameters:
op – [in]
CeedOperatorto assemblenum_entries – [out] Number of entries in assembled representation
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedOperatorLinearAssembleGetNumEntries(CeedOperator op, CeedSize *num_entries)
Count number of entries for assembled
CeedOperatorUtility Functions
- Parameters:
op – [in]
CeedOperatorto assemblenum_entries – [out] Number of entries in assembled representation
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedOperatorAssembleSymbolicSingleBlock(CeedOperator op, CeedSize offset, CeedElemRestriction elem_rstr_in, CeedElemRestriction elem_rstr_out, CeedInt *rows, CeedInt *cols)
Build nonzero pattern for non-composite
CeedOperator.Users should generally use CeedOperatorLinearAssembleSymbolic().
Library Developer Functions
- Parameters:
op – [in]
CeedOperatorto assemble nonzero patternoffset – [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 CeedOperatorAssembleSymbolicSingle(CeedOperator op, CeedSize offset, CeedInt *rows, CeedInt *cols)
Build nonzero pattern for non-composite CeedOperator`.
Users should generally use CeedOperatorLinearAssembleSymbolic().
Library Developer Functions
- Parameters:
op – [in]
CeedOperatorto assemble nonzero patternoffset – [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 CeedOperatorLinearAssembleQFunctionBuildOrUpdate_Core(CeedOperator op, bool use_parent, CeedVector *assembled, CeedElemRestriction *rstr, CeedRequest *request)
Core logic to assemble
CeedQFunctionand store result internally.Return copied references of stored data to the caller. Caller is responsible for ownership and destruction of the copied references. See also CeedOperatorLinearAssembleQFunction().
Note: If the value of
assembledorrstrpassed to this function are non-NULL, then it is assumed that they hold valid pointers. These objects will be destroyed if*assembledor*rstris the only reference to the object.User Functions
- Parameters:
op – [in]
CeedOperatorto assembleCeedQFunctionuse_parent – [in] Boolean flag to check for fallback parent implementation
assembled – [out]
CeedVectorto store assembledCeedQFunctionat quadrature pointsrstr – [out]
CeedElemRestrictionforCeedVectorcontaining assembledCeedQFunctionrequest – [in] Address of CeedRequest for non-blocking completion, else CEED_REQUEST_IMMEDIATE
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedOperatorLinearAssembleQFunctionBuildOrUpdateFallback(CeedOperator op, CeedVector *assembled, CeedElemRestriction *rstr, CeedRequest *request)
Assemble
CeedQFunctionand store result internally, but do not use fallback parent.Return copied references of stored data to the caller. Caller is responsible for ownership and destruction of the copied references. See also CeedOperatorLinearAssembleQFunction().
Note: If the value of
assembledorrstrpassed to this function are non-NULL, then it is assumed that they hold valid pointers. These objects will be destroyed if*assembledor*rstris the only reference to the object.Library Developer Functions
- Parameters:
op – [in]
CeedOperatorto assembleCeedQFunctionassembled – [out]
CeedVectorto store assembledCeedQFunctionat quadrature pointsrstr – [out]
CeedElemRestrictionforCeedVectorcontaining assembledCeedQFunctionrequest – [in] Address of CeedRequest for non-blocking completion, else CEED_REQUEST_IMMEDIATE
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedOperatorAssembleSingleBlock(CeedOperator op, CeedInt offset, CeedInt active_input, CeedInt active_output, CeedVector values)
Assemble nonzero entries for non-composite
CeedOperator.Users should generally use CeedOperatorLinearAssemble().
Library Developer Functions
- Parameters:
op – [in]
CeedOperatorto assembleoffset – [in] Offset for number of entries
values – [out] Values to assemble into matrix
- Returns:
An error code: 0 - success, otherwise - failure
-
int CeedOperatorAssembleSingle(CeedOperator op, CeedSize offset, CeedVector values)
Assemble nonzero entries for non-composite
CeedOperator.Users should generally use CeedOperatorLinearAssemble().
Library Developer Functions
- Parameters:
op – [in]
CeedOperatorto assembleoffset – [in] Offset for number of entries
values – [out] Values to assemble into matrix
- Returns:
An error code: 0 - success, otherwise - failure
-
static int CeedOperatorMultigridLevelCreateSingle_Core(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
CeedOperatorand level transferCeedOperatorfor aCeedOperatorLibrary Developer Functions
- Parameters:
op_fine – [in] Fine grid
CeedOperatorp_mult_fine – [in] L-vector multiplicity in parallel gather/scatter, or
NULLif not creating prolongation/restrictionCeedOperatorrstr_coarse – [in] Coarse grid
CeedElemRestrictionbasis_coarse – [in] Coarse grid active vector
CeedBasisbasis_c_to_f – [in]
CeedBasisfor coarse to fine interpolation, orNULLif not creating prolongation/restriction operatorsop_coarse – [out] Coarse grid
CeedOperatorop_prolong – [out] Coarse to fine
CeedOperator, orNULLop_restrict – [out] Fine to coarse
CeedOperator, orNULL
- 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