GridapROMs.ParamODEs
This module provides the parametric ODE infrastructure, including time-stepping schemes (θ-method, Generalized-α) and the TimeCombination framework that encodes how each scheme combines contributions from different time levels.
Time combinations
A TimeCombination stores the parameters of an ODE time-marching scheme and provides the coefficients needed to combine snapshots from successive time levels in the reduced-basis context. Each operator in the semi-discrete ODE (stiffness, damping, mass) is assigned a CombinationOrder, which selects the appropriate set of coefficients.
Full API
GridapROMs.ParamODEs — Module
module ParamODEsParametric FE operators and solutions for transient parametric PDEs.
Extends ParamSteady to the time-dependent setting, building on Gridap's ODEs machinery. Key components:
- Time derivatives —
∂ₚtand∂ₚtt, parameter-aware analogues of Gridap's∂t/∂tt, for use inside weak forms. - Transient trial spaces —
TransientTrialParamFESpaceandTransientMultiFieldParamFESpaceadd time-varying Dirichlet conditions to parametric FE spaces. - ODE operators —
ODEParamOperatorhierarchy (JointODEParamOperator,SplitODEParamOperator,LinearNonlinearODEParamOperator, …) translate a transient parametric weak form into the residual/Jacobian signature expected by Gridap's time-marching schemes. - Stage operators —
ParamStageOperatorwraps a single ODE stage solve, keeping track of the current time, stage coefficients, and parameter realisation. - Transient FE operators —
TransientParamFEOperatorand specialisations (SplitTransientParamFEOperator,TransientLinearParamFEOperator, …) combine the spatial FE machinery with time-derivative information. - ODE solutions —
ODEParamSolutioniterates over time steps, yielding(realisation, FEFunction)pairs;TransientParamFESolutionwraps this iterator into aParamFEFunctionper time step.
Modules RBTransient and Extensions depend on the abstractions defined here.
GridapROMs.ParamODEs.CombinationOrder — Type
struct CombinationOrder{A<:TimeCombination, N} <: TimeCombination
combination::A
endWraps a TimeCombination and selects the N-th derivative order for coefficient retrieval. In a $p$-th order ODE, the time-marching scheme produces $p+1$ operators (e.g. stiffness, damping, mass for $p=2$); CombinationOrder{A,N} isolates the coefficients for the $N$-th one.
The type parameter N is a positive integer:
N = 1— zeroth-derivative operator (stiffness $A$).N = 2— first-derivative operator (mass $M$ for first-order; damping for second-order).N = 3— second-derivative operator (mass $M$ for second-order).
Convenience aliases:
ThetaMethodStrategy{N}=CombinationOrder{ThetaMethodCombination, N}GenAlpha1Strategy{N}=CombinationOrder{GenAlpha1Combination, N}GenAlpha2Strategy{N}=CombinationOrder{GenAlpha2Combination, N}
GridapROMs.ParamODEs.GenAlpha1Combination — Type
struct GenAlpha1Combination <: TimeCombination
dt::Real
αf::Real
αm::Real
γ::Real
endTimeCombination for the Generalized-α method for first-order ODEs. Stores dt, αf, αm, and γ.
Two CombinationOrder levels are defined (stiffness and mass/damping).
GridapROMs.ParamODEs.GenAlpha1Strategy — Type
const GenAlpha1Strategy{N} = CombinationOrder{GenAlpha1Combination, N}Specialised alias for CombinationOrder with a GenAlpha1Combination. Orders 1 and 2 correspond to the stiffness and mass/damping operators of a first-order Generalized-α scheme.
GridapROMs.ParamODEs.GenAlpha2Combination — Type
struct GenAlpha2Combination <: TimeCombination
dt::Real
αf::Real
αm::Real
γ::Real
β::Real
endTimeCombination for the Generalized-α method for second-order ODEs (Newmark family). Stores dt, αf, αm, γ, and β.
Three CombinationOrder levels are defined (stiffness, damping, mass).
GridapROMs.ParamODEs.GenAlpha2Strategy — Type
const GenAlpha2Strategy{N} = CombinationOrder{GenAlpha2Combination, N}Specialised alias for CombinationOrder with a GenAlpha2Combination. Orders 1, 2, and 3 correspond to the stiffness, damping, and mass operators of a second-order Generalized-α (Newmark) scheme.
GridapROMs.ParamODEs.JointODEParamOperator — Type
const JointODEParamOperator{O<:ODEParamOperatorType} = ODEParamOperator{O,JointDomains}GridapROMs.ParamODEs.JointTransientParamFEOperator — Type
const JointTransientParamFEOperator{O<:ODEParamOperatorType} = TransientParamFEOperator{O,JointDomains}GridapROMs.ParamODEs.LinearNonlinearParamODE — Type
struct LinearNonlinearParamODE <: ODEParamOperatorType endGridapROMs.ParamODEs.LinearParamODE — Type
struct LinearParamODE <: ODEParamOperatorType endGridapROMs.ParamODEs.NonlinearParamODE — Type
struct NonlinearParamODE <: ODEParamOperatorType endGridapROMs.ParamODEs.ODEParamOperator — Type
const ODEParamOperator{T<:ODEParamOperatorType,T<:TriangulationStyle} = ParamOperator{O,T}Transient extension of the type ParamOperator.
GridapROMs.ParamODEs.ODEParamOperatorType — Type
abstract type ODEParamOperatorType <: UnEvalOperatorType endParametric extension of the type ODEOperatorType in Gridap.
Subtypes:
GridapROMs.ParamODEs.ODEParamSolution — Type
struct ODEParamSolution{V} <: ODESolution
solver::ODESolver
odeop::ODEParamOperator
r::TransientRealisation
us0::Tuple{Vararg{V}}
endGridapROMs.ParamODEs.ParamStageOperator — Type
struct ParamStageOperator <: NonlinearParamOperator
op::ODEParamOperator
r::TransientRealisation
state_update::Function
ws::Tuple{Vararg{Real}}
paramcache::AbstractParamCache
endStage operator to solve a parametric ODE with a time marching scheme
GridapROMs.ParamODEs.SplitODEParamOperator — Type
const SplitODEParamOperator{O<:ODEParamOperatorType} = ODEParamOperator{O,SplitDomains}GridapROMs.ParamODEs.SplitTransientParamFEOperator — Type
const SplitTransientParamFEOperator{O<:ODEParamOperatorType} = TransientParamFEOperator{O,SplitDomains}GridapROMs.ParamODEs.ThetaMethodCombination — Type
struct ThetaMethodCombination <: TimeCombination
dt::Real
θ::Real
endTimeCombination for the θ-method applied to a first-order ODE. Stores the time step dt and the implicitness parameter θ.
Two CombinationOrder levels are defined:
- Order 1 (stiffness $A$): coefficients $(\theta,\, 1-\theta)$.
- Order 2 (mass $M$): coefficients $(1/\Delta t,\, -1/\Delta t)$.
GridapROMs.ParamODEs.ThetaMethodStrategy — Type
const ThetaMethodStrategy{N} = CombinationOrder{ThetaMethodCombination, N}Specialised alias for CombinationOrder with a ThetaMethodCombination. N = 1 yields stiffness coefficients $(\theta,\, 1-\theta)$; N = 2 yields mass coefficients $(1/\Delta t,\, -1/\Delta t)$.
GridapROMs.ParamODEs.TimeCombination — Type
abstract type TimeCombination endEncodes how an ODE time-marching scheme combines contributions from different time levels when building a reduced space-time system.
For every ODE solver there is exactly one TimeCombination that stores the scheme parameters (time step, weights, …). Use the constructor
TimeCombination(odesolver::ODESolver)to obtain the appropriate concrete subtype:
| Solver | TimeCombination subtype |
|---|---|
ThetaMethod | ThetaMethodCombination |
GeneralizedAlpha1 | GenAlpha1Combination |
GeneralizedAlpha2 | GenAlpha2Combination |
The per-order time-level weights are accessed through get_coefficients, while time_combination applies the full combination to a parametric solution vector.
See also: CombinationOrder, HighDimHyperReduction.
GridapROMs.ParamODEs.TransientLinearParamFEOpFromWeakForm — Type
struct TransientLinearParamFEOpFromWeakForm{T} <: TransientParamFEOperator{LinearParamODE,T}
res::Function
jacs::Tuple{Vararg{Function}}
constant_forms::Tuple{Vararg{Bool}}
tpspace::TransientParamSpace
assem::Assembler
trial::FESpace
test::FESpace
domains::FEDomains
order::Integer
endInstance of TransientParamFEOperator, to be used when the transient problem is linear
GridapROMs.ParamODEs.TransientMultiFieldParamFESpace — Type
const TransientMultiFieldParamFESpace = MultiFieldFESpaceGridapROMs.ParamODEs.TransientParamFEOpFromWeakForm — Type
struct TransientParamFEOpFromWeakForm{T} <: TransientParamFEOperator{NonlinearParamODE,T}
res::Function
jacs::Tuple{Vararg{Function}}
tpspace::TransientParamSpace
assem::Assembler
trial::FESpace
test::FESpace
domains::FEDomains
order::Integer
endInstance of TransientParamFEOperator, to be used when the transient problem is nonlinear
GridapROMs.ParamODEs.TransientParamFEOperator — Type
const TransientParamFEOperator{O<:ODEParamOperatorType,T<:TriangulationStyle} = ParamFEOperator{O,T}Parametric extension of a TransientFEOperator in Gridap. Compared to a standard TransientFEOperator, there are the following novelties:
- a
TransientParamSpaceis provided, so that parametric realisations can be extracted directly from theTransientParamFEOperator - a function representing a norm matrix is provided, so that errors in the desired norm can be automatically computed
Subtypes:
GridapROMs.ParamODEs.TransientParamFESolution — Type
struct TransientParamFESolution{V} <: TransientFESolution
odesol::ODEParamSolution{V}
trial
endWrapper around a TransientParamFEOperator and ODESolver that represents the parametric solution at a set of time steps. It is an iterator that computes the solution at each time step in a lazy fashion when accessing the solution.
GridapROMs.ParamODEs.TransientTrialParamFESpace — Type
const TransientTrialParamFESpace = UnEvalTrialFESpaceGridapROMs.ParamODEs.TransientLinearParamFEOperator — Method
TransientLinearParamFEOperator(res::Function,forms::Tuple{Vararg{Function}}, tpspace,trial,test;kwargs...) -> TransientLinearParamFEOpFromWeakForm{TriangulationStyle}
Returns a linear parametric FE operator
GridapROMs.ParamODEs.get_coefficients — Method
get_coefficients(c::TimeCombination, args...) -> NTuple{N,Real}Return the tuple of coefficients that the combination c uses to weight snapshots at successive time levels. The length of the tuple equals the number of time levels involved (the stencil width of the scheme for the corresponding CombinationOrder).
GridapROMs.ParamODEs.time_combination — Method
time_combination(c::TimeCombination, u, us0) -> NTuple{N,AbstractParamVector}Apply the time combination c to the parametric solution vector u and the N initial-condition vectors us0. Returns an N-tuple of combined vectors, one per derivative order of the ODE (e.g. $u_{\theta}$ and $\dot{u}_{\theta}$ for a first-order scheme).