rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
NonlinEvol.DetailedModel Class Reference

Detailed Description

IDetailedModel implementation for a non linear evolution problem.

This is a detailed model for a problem of this type

\begin{align} \partial_t u(x;t,\mu) - {\cal L}(t,\mu)[u(x,t;\mu)] &= 0 \qquad &\text{in }& \Omega \times [0, T], \\\ u(x;0,\mu) &= u_0(x;\mu) \qquad &\text{in }& \Omega \times \{0\} \end{align}

with suitable boundary conditions and (non-linear) operators \({\cal L}(t,\mu) : {\cal W} \to {\cal W}\) parametrized over the Time-parameter domain \([0,T] \times {\cal M}\).

The numerical scheme for the numerical solution of this problem is assumed to be of the

  1. following type:

    \begin{align*} u_h(\cdot;t^0,\mu) &= {\cal M}_h[u_0] \\\ \left(\text{Id} - \Delta t^k {\cal L}_{h, I}(t^{k+1},\mu)\right)[u_h(\cdot;t^{k+1},\mu)] &= \left(\text{Id} + \Delta t^k {\cal L}_{h, E}(t^{k},\mu)\right)[u_h(\cdot;t^{k},\mu)] \end{align*}

  2. or with a Newton solver for non-linearities in the implicit case:

    \[ u_h(\cdot;t^0,\mu) = {\cal M}_h[u_0], \]

    where the equation

    \[ F[u_h(\cdot;t^{k+1},\mu), u_h(\cdot;t^k,\mu)] =0 \]

    is solved subsequently for the operator \(F:V_h\times V_h \to V_h\) defined by

    \[ F[u_h;v_h] := \left(\text{Id} + \Delta t^k {\cal L}_{h, I}(t^{k+1},\mu)\right)[u_h] - \left(\text{Id} + \Delta t^k {\cal L}_{h, E}(t^{k},\mu)\right)[v_h] \]

    with a Newton scheme, minimizing defects \(\| \delta_h^{k+1,\nu+1}\| \leq R_{\text{Newton}}\) by solving

    \[ D_1 F|_{u_h^{k+1,\nu}}[\delta_h^{k+1,\nu+1};u_h^k] = -F[u_h^{k+1,\nu};u_h^k] \]

    with \(u_h^{k+1,\nu+1} := u_h^{k+1,\nu}\), \(u_h^{k,0}:=u_h^k\), \(u_h^{k+1}:=u_h^{k+1, \nu_{\max}(k)}\) and \(\nu_{\max}(k) = \min_{\nu} \| \delta_h^{k+1,\nu} \| \leq R_{\text{Newton}}\)

Furthermore the discretization consists of

Definition at line 18 of file DetailedModel.m.

Inheritance diagram for NonlinEvol.DetailedModel:
Inheritance graph
[legend]
Collaboration diagram for NonlinEvol.DetailedModel:
Collaboration graph
[legend]

Public Member Functions

 DetailedModel (ModelDescr descr)
 constructor More...
 
function
sim_data = 
detailed_simulation (ModelData model_data)
 executes a detailed simulation for a given parameter More...
 
function ModelData
model_data = 
gen_model_data ()
 method which produces all \(H\)-dependent data, that is required for a detailed simulations and is independent of the parameter \(\mu\). More...
 
function p = plot_sim_data (ModelData model_data, sim_data, plot_params)
 plots the simulation data as returned by detailed_simulation() More...
 
- Public Member Functions inherited from Greedy.User.FVDetailedModelDefault
 FVDetailedModelDefault (ModelDescr descr)
 Constructor for this class. More...
 
function UON = orthonormalize (ModelData model_data, U)
 orthonormalizes a set of discrete functions \(\{ v_h^l \}_{l=1}^L\) More...
 
function U0 = init_values_algorithm (ModelData model_data)
 computes the Dof vectors for the initial value function \(u_h^0(\cdot;t\mu) = {\cal P}_h[u_0(\mu)]\) More...
 
function UV = inner_product (ModelData model_data, U, V)
 computes the inner project between the Dof vectors of two discrete functions More...
 
- Public Member Functions inherited from Greedy.User.IDetailedModel
 IDetailedModel (descr)
 constructor More...
 
- Public Member Functions inherited from IDetailedModel
 IDetailedModel (descr)
 constructor More...
 
function
isequal = 
eq (IDetailedModel other)
 overloaded equality (==) operator, by default comparing the descr variables More...
 
function IDetailedModel this = set_mu (mu)
 sets the active parameter vector \(\mu \in {\cal M}\) More...
 
function mu = get_mu ()
 returns the active parameter vector \(\boldsymbol\mu \in {\cal M}\) More...
 
virtual function
sim_data = 
detailed_simulation (model_data)
 executes a detailed simulation for a given parameter More...
 
virtual function p = plot_sim_data (model_data, sim_data, plot_params)
 plots the simulation data as returned by detailed_simulation() More...
 

Static Public Member Functions

static function U = get_dofs_from_sim_data (sim_data)
 extracts the \(H\) dimensional Dof vector from the sim_data structure More...
 
static function
snapshot = 
get_dofs_at_time (sim_data, time_index)
 
- Static Public Member Functions inherited from Greedy.User.FVDetailedModelDefault
static function errs = l2_error_sequence_algorithm (U, Uapprox,ModelData model_data)
 computes the \(L^2(\Omega)\) error for each "snapshot" of a trajectories and returns the sequence of these errors. More...
 
static function errs = linfty_error_sequence_algorithm (U, Uapprox,ModelData model_data)
 computes the \(L^{\infty}(\Omega)\) error for each "snapshot" of a trajectories and returns the sequence of these errors. More...
 
static function W = get_inner_product_matrix (ModelData model_data)
 returns the inner product matrix for efficient computation of inner products on \({\cal W}_h\) More...
 
- Static Public Member Functions inherited from IModel
static function ok = struct_check (descr, checks)
 executes checks on the fields of a structure object More...
 

Public Attributes

 t
 current time instance More...
 
 tstep
 current time step More...
 
 compute_conditions = false
 boolean flag indicating whether conditions of system matrices shall be computed. More...
 
- Public Attributes inherited from IDetailedModel
 descr
 The description structure holding information about the analytical parametrized problem and its discretization. More...
 
 decomp_mode
 
 mu_names
 cell array of strings describing the parameters of the model More...
 
 mu_ranges
 cell array of vectors of size two defining the allowed interval range for the parameter components More...
 
 verbose
 an integer defining the verbosity level of information output during basis generation More...
 
 debug
 an integer defining the debugging level controlling error output and extra tests during basis generation More...
 
- Public Attributes inherited from IModel
 num_cpus = 4
 The number of CPUs used for parallel sessions. More...
 
 decomp_mode
 Decomposition operation mode. More...
 
 mu_names
 cell array of strings describing the parameters of the model More...
 
 mu_ranges
 cell array of vectors of size two defining the allowed interval range for the parameter components More...
 
 verbose
 an integer defining the verbosity level of information output during basis generation More...
 
 debug
 an integer defining the debugging level controlling error output and extra tests during basis generation More...
 

Static Public Attributes

static const  model_checks
 This constant is used for a consistency check of the model descr with help of DetailedModelBaseIf.struct_check() More...
 
static const  newton_checks
 This constant is used for a consistency check of the model descr with help of DetailedModelBaseIf.struct_check() More...
 
- Static Public Attributes inherited from IDetailedModel
static const  base_checks
 this structure holds variable names that need to be defined by the descr structure. More...
 
- Static Public Attributes inherited from IModel
static const  time_checks
 This constant can be used for a consistency check of time evolution members in the ModelDescr with help of IModel.struct_check() More...
 

Constructor & Destructor Documentation

NonlinEvol.DetailedModel.DetailedModel ( ModelDescr  descr)

constructor

This checks and stores the model description structure

Parameters
descrstructure
Required fields of descr:
  • newton_solver —  boolean flag indicating whether we are using a Newton scheme for the discretization.

Definition at line 171 of file DetailedModel.m.

Here is the call graph for this function:

Member Function Documentation

function [ sim_data , fl ] = NonlinEvol.DetailedModel.detailed_simulation ( ModelData  model_data)

executes a detailed simulation for a given parameter

Parameters
model_dataMatlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation().
Return values
sim_datastructure holding the \(H\)-dimensional simulation data.
fldebug output holding the flux evaluations returned by the L_E_local_ptr operator.
Required fields of model:
  • T —  final time
  • nt —  number of time-steps \(0 = t_0 \leq t_1 \leq \cdots \leq t^K+1 = T\), i.e. \(K+1\).
  • init_values_algorithm —  function pointer for computing the initvalues-DOF with arguments (model, model_data)
    • example: fv_init_values()
  • L_E_local_ptr —  function pointer to the local space-discretization operator evaluation with syntax
    INC_local = L_local(U_local_ext, ind_local, grid_local_ext)
    where *_local indicates results on a set of elements, *_local_ext includes information including their neighbours, i.e. the grid must be known also for the neighbours, the values of the previous timstep must be known on the neighbours. The subset of elements, which are to be computed are given in ind_local and the values produced are INC_local. A time-step can then be realized by
    NU_local = U_local_ext(ind_local) - dt * INC_local
Optional fields of model:
  • data_const_in_time —  if this optional field is 1, the time evolution is performed with constant operators, i.e. only the initial-time-operators are computed and used throughout the time simulation.
Generated fields of sim_data:
  • U —  matrix of size \(H \times K+1\) holding for each time step the solution dof vector.
  • Unewton —  matrix of size \(H \times K+1+\sum_{k=0}^K n_{\text{Newton}}(k)\) holding for each time step and each Newton iteration the intermediate solution dof vectors.
  • conds.LI —  conds.LI
  • conds.gradLI —  conds.gradLI

Definition at line 19 of file detailed_simulation.m.

Here is the call graph for this function:

function ModelData model_data = NonlinEvol.DetailedModel.gen_model_data ( )
virtual

method which produces all \(H\)-dependent data, that is required for a detailed simulations and is independent of the parameter \(\mu\).

Return values
model_datamodel data
Generated fields of model_data:
  • W —  inner product weighting matrix
  • grid —  a structure containing geometry information of a mesh used for discretizations

Implements IDetailedModel.

Definition at line 19 of file gen_model_data.m.

static function U = NonlinEvol.DetailedModel.get_dofs_from_sim_data (   sim_data)
staticvirtual

extracts the \(H\) dimensional Dof vector from the sim_data structure

Parameters
sim_datamatlab struct with simulation data generated e.g. by detailed_simulation() or rb_reconstruction() methods.
Return values
U\(H\) dimensional Dof vector

Implements Greedy.User.IDetailedModel.

Definition at line 204 of file DetailedModel.m.

function p = NonlinEvol.DetailedModel.plot_sim_data ( ModelData  model_data,
  sim_data,
  plot_params 
)

plots the simulation data as returned by detailed_simulation()

function plotting simulation results

Parameters
model_dataMatlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation().
sim_datasimulation data structure as returned by detailed_simulation()
plot_paramsstructure which controls the plot output
Return values
pMatlab GUI handle to figure window
Required fields of sim_data:
  • U —  DOF vector of solution snapshots
Required fields of model_data:
  • grid —  a structure containing geometry information of a mesh used for discretizations
Optional fields of plot_params:
  • bind_to_model —  Sometimes the plot can adapted according to the parameters. For example if the domain of the simulation changes with the parameter. In this case this boolean flag can be set, and the copy_model_descr_to_plot_params() function is called to copy important parameters to the plot_params (default = false)
  • plot —  function pointer to a function plotting a single snapshot for a specific time instant. (default = descr.plot)

Definition at line 19 of file plot_sim_data.m.

Here is the call graph for this function:

Member Data Documentation

NonlinEvol.DetailedModel.compute_conditions = false

boolean flag indicating whether conditions of system matrices shall be computed.


Default: false

Definition at line 160 of file DetailedModel.m.

NonlinEvol.DetailedModel.model_checks
static
Initial value:
= struct(" \
'fv_impl_diff_weight', {{\@isscalar}}, \
'fv_expl_diff_weight', {{\@isscalar}}, \
'fv_impl_conv_weight', {{\@isscalar}}, \
'fv_expl_conv_weight', {{\@isscalar}}, \
'newton_solver', {{\@isscalar}}, \
'implicit_nonlinear', {{\@isscalar}}, \
'L_E_local_ptr', {{\@(x) isequal(class(x), 'function_handler')}}, \
'L_I_local_ptr', {{\@(x) isequal(class(x), 'function_handler')}}...
")

This constant is used for a consistency check of the model descr with help of DetailedModelBaseIf.struct_check()


Default: struct(" \ 'fv_impl_diff_weight', {{@isscalar}}, \ 'fv_expl_diff_weight', {{@isscalar}}, \ 'fv_impl_conv_weight', {{@isscalar}}, \ 'fv_expl_conv_weight', {{@isscalar}}, \ 'newton_solver', {{@isscalar}}, \ 'implicit_nonlinear', {{@isscalar}}, \ 'L_E_local_ptr', {{@(x) isequal(class(x), 'function_handler')}}, \ 'L_I_local_ptr', {{@(x) isequal(class(x), 'function_handler')}}... ")

Definition at line 82 of file DetailedModel.m.

NonlinEvol.DetailedModel.newton_checks
static
Initial value:
= struct(" \
'newton_steps', {{\@isscalar}}, \
'implicit_operators_algorithm', {{\@(x) isequal(class(x), 'function_handler')}}, \
'implicit_gradient_operators_algorithm', \
{{\@(x) isequal(class(x), 'function_handler')}}, \
'newton_epsilon', {{\@isscalar}}...
")

This constant is used for a consistency check of the model descr with help of DetailedModelBaseIf.struct_check()

This check is only executed if we use a Newton scheme


Default: struct(" \ 'newton_steps', {{@isscalar}}, \ 'implicit_operators_algorithm', {{@(x) isequal(class(x), 'function_handler')}}, \ 'implicit_gradient_operators_algorithm', \ {{@(x) isequal(class(x), 'function_handler')}}, \ 'newton_epsilon', {{@isscalar}}... ")

Definition at line 110 of file DetailedModel.m.

NonlinEvol.DetailedModel.t

current time instance

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.

Definition at line 136 of file DetailedModel.m.

NonlinEvol.DetailedModel.tstep

current time step

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.

Definition at line 147 of file DetailedModel.m.


The documentation for this class was generated from the following files: