MultilinearMaps
Multilinear maps for representing polynomial nonlinear terms in full-order models. Each map stores an in-place function, a multiindex encoding which derivative-order slots it consumes, and an external forcing multiplicity.
MORFE.MultilinearMaps.AbstractMultilinearMap — Type
AbstractMultilinearMap{ORD}Abstract supertype for all multilinear terms accepted by NDOrderModel.
Every concrete subtype must expose the fields multiindex, multiplicity_external, and deg with the same semantics as MultilinearMap.
MORFE.MultilinearMaps.FEMMultilinearMap — Type
FEMMultilinearMap{ORD} <: AbstractMultilinearMap{ORD}Abstract type for FEM-backed multilinear terms that expose element-level primitives.
Implementing the interface below enables the RHS-C batched accumulation path in MultilinearTerms.jl: the mesh is traversed exactly once per (monomial, term, split) rather than once per factorisation entry.
Required methods (extend MORFE.*):
fem_elements(t)→ element iteratorfem_n_qp(t)→ quadrature points per elementfem_ndofs_per_cell(t)→ DOFs per elementscatter_qp!(∇W_col, W_global, element, t)→ fill qp field values for one unique W columnaccumulate_qp!(Fe, ∇W_args::NTuple, mult, element, q, dΩ, t)→ add integrand at one qpassemble_element!(accum, Fe, element, t)→ scatter element residual to globalfem_getdetJdV(element, q, t)→ integration weight at qp q
MORFE.MultilinearMaps.MultilinearMap — Type
MultilinearMap{ORD, F}Represents a single monomial term of order deg in the nonlinear function of an NDOrderModel.
A term is represented using a multiindex stored in the NTuple multiindex = (i0, ..., i{ORD-1}) where ik is the multiplicity of the derivative x^(k). So the ik specifies how many times the derivative x^(k) appears as an argument. In addition the function accepts multiplicity_external external variables r1, r2, ... which satisfy the first order dynamic system r' = dynamicsexternal(r), where dynamicsexternal is a DensePolynomial defined in NDOrderModel. The influence in f! is described by multiplicity_external
During evaluation the multilinear map is called as
f!(res,
x^(0), ... repeated i_0 times,
x^(1), ... repeated i_1 times,
...
x^(ORD-1), ...repeated i_{ORD-1} times,
r, ... repeated `multiplicity_external` times)Important Notes
- Each
MultilinearMapmust implement a multilinear map, i.e., it should be linear in each of its arguments independently. - The function
f!accumulates (adds) intoresand must be callable with the appropriate number of arguments. - If one i_k is larger than 1 we assume the input arguments are symmetric by permutation. For example:
multiindex = (0, 2,...)
f!(res, x^(1)_1, x^(1)_2, ...) = f!(res, x^(1)_2, x^(1)_1, ...)MORFE.MultilinearMaps.MultilinearMap — Method
MultilinearMap(f, multiindex)Create a multilinear term for a system of order ORD without external dynamics.
Arguments
f!: in-place evaluation functionmultiindex: tuple specifying which derivatives are used
MORFE.MultilinearMaps.evaluate_term! — Method
evaluate_term!(res, term, xs, r)Evaluate a single MultilinearMap and accumulate (adds) the result into res.
Arguments
res: output vector (modified in-place)term: multilinear termxs: tuple(x, x^(1), …, x^(ORD-1))of state derivativesr: external state vector (ornothingif not used). Ifrisnothingbut the term expects external arguments, an error is thrown.