fenics_model¶
FenicsModel.
Classes
|
Model using the FEniCS FE library. |
|
Class of FEniCS finite element objects. |
- class nopec.models.fenics_model.FenicsModel(*, input_array, pars)¶
Model using the FEniCS FE library.
- Parameters:
input_array (ndarray)
pars (ModelParameters)
- property FE: FiniteElementObjects¶
Finite element objects.
This property is cached, so that it is not evaluated every time it is called.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- pars: ModelParameters¶
Model parameters.
- state(mu)¶
Evaluate state variables \(y\) and \(q\).
The state variables are returned in the following \(N \times (K-1)\) matrices:
\[\mathrm{Y} = \left[ \begin{array}{c|c|c} \mathrm{y}^1 & \dots & \mathrm{y}^K \end{array} \right],\]where \(N\) is the number of spacial degrees of freedom of the FE, \(K\) is the number of time steps, and the array \(\mathrm{y}^k\) is the coordinate array (in the FE basis) of \(y^k\), the approximate solution time \(t_k\).
The approximate solution at \(t_0 = 0\) is not stored.
For the state \(q\) we similarly have
\[\mathrm{Q} = \left[ \begin{array}{c|c|c} \mathrm{q}^1 & \dots & \mathrm{q}^K \end{array} \right].\]
- class nopec.models.fenics_model.FiniteElementObjects(pars)¶
Class of FEniCS finite element objects.
- Parameters:
pars (ModelParameters)
- Omega: dolfinx.mesh.Mesh¶
Domain mesh.
- V: dolfinx.fem.function.FunctionSpace¶
Function space of state variable \((y(t),q(t))\).
- Vq: dolfinx.fem.function.FunctionSpace¶
Function space of state variable \(q(t)\)
- Vy: dolfinx.fem.function.FunctionSpace¶
Function space of state variable \(y(t)\)
- k1: dolfinx.fem.function.Function¶
Density function \(\kappa_1\) interpolated on the space
Vy.
- k2: dolfinx.fem.function.Function¶
Density function \(\kappa_2\) interpolated on the space
Vq.