IDetailedModel implementation for a two phase flow system.
This is a detailed model for a problem of this type
Definition at line 18 of file DetailedModel.m.
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
sim_data = | detailed_simulation_galerkin (IDetailedData detailed_data) |
executes a detailed simulation for a given parameter More... | |
function
sim_data = | detailed_simulation_impes (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... | |
function | plot_error_sequence (errs) |
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 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 = | l2_error_sequence_complete (U, Uapprox,ModelData model_data) |
static function errs = | linfty_error_sequence_complete (U, Uapprox,ModelData model_data) |
Static Public Member Functions inherited from Greedy.User.FVDetailedModelDefault | |
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 | 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... | |
TwoPhaseFlow.DetailedModel.DetailedModel | ( | ModelDescr | descr | ) |
constructor
This checks and stores the model description structure
descr | structure |
newton_solver —
boolean flag indicating whether we are using a Newton scheme for the discretization. Definition at line 89 of file DetailedModel.m.
function sim_data = TwoPhaseFlow.DetailedModel.detailed_simulation | ( | ModelData | model_data | ) |
executes a detailed simulation for a given parameter
model_data | Matlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation(). |
sim_data | structure holding the \(H\)-dimensional simulation data. |
fl | debug output holding the flux evaluations returned by the L_E_local_ptr operator. |
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)
L_E_local_ptr —
function pointer to the local space-discretization operator evaluation with syntax *_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 gn_edges —
gn edgesdata_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.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. S —
S Stemp —
Stemp Utemp —
Utemp P —
P Ptemp —
Ptemp exit_flags —
exit flags outputs —
outputs Definition at line 19 of file detailed_simulation.m.
function sim_data = TwoPhaseFlow.DetailedModel.detailed_simulation_galerkin | ( | IDetailedData | detailed_data | ) |
executes a detailed simulation for a given parameter
detailed_data | object defining the basis generation algorithm and storage for storing high dimensional data, i.e. dependent on dimension \(H\). This data is necessary for detailed simulations, construction of online matrices, reduced_data and reconstruction of reduced simulations. |
sim_data | structure holding the \(H\)-dimensional simulation data. |
fl | debug output holding the flux evaluations returned by the L_E_local_ptr operator. |
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)
L_E_local_ptr —
function pointer to the local space-discretization operator evaluation with syntax *_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 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.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. sat_a —
sat a vel_a —
vel a prs_a —
prs a S —
S P —
P exit_flags —
exit flags outputs —
outputs Definition at line 19 of file detailed_simulation_galerkin.m.
function sim_data = TwoPhaseFlow.DetailedModel.detailed_simulation_impes | ( | ModelData | model_data | ) |
executes a detailed simulation for a given parameter
model_data | Matlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation(). |
sim_data | structure holding the \(H\)-dimensional simulation data. |
fl | debug output holding the flux evaluations returned by the L_E_local_ptr operator. |
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\).gn_edges —
gn edgesdata_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.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. S —
S P —
P exit_flags —
exit flags outputs —
outputs Definition at line 19 of file detailed_simulation_impes.m.
|
virtual |
method which produces all \(H\)-dependent data, that is required for a detailed simulations and is independent of the parameter \(\mu\).
model_data | model data |
W —
inner product weighting matrix grid —
a structure containing geometry information of a mesh used for discretizations gn_edges —
gn edges diamondW —
diamondW diamondWinv —
diamondWinv opdata —
opdata opdata.S_upper —
opdata.S upper opdata.S_lower —
opdata.S lower Implements IDetailedModel.
Definition at line 19 of file gen_model_data.m.
|
staticvirtual |
extracts the \(H\) dimensional Dof vector from the sim_data
structure
sim_data | matlab struct with simulation data generated e.g. by detailed_simulation() or rb_reconstruction() methods. |
U | \(H\) dimensional Dof vector |
Implements Greedy.User.IDetailedModel.
Definition at line 134 of file DetailedModel.m.
|
staticvirtual |
computes the \(L^2(\Omega)\) error for each "snapshot" of a trajectories and returns the sequence of these errors.
U | first sequence of Dof vectors of discrete functions \(\{u_h^k\}_{k=0}^K\) stored in a H x K+1 matrix |
Uapprox | second sequence of Dof vectors of functions \(\{v_h^k\}_{k=0}^K\) stored in a H x K+1 matrix |
model_data | Matlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation(). |
errs | sequence of errors \(\{ \| u_h^k - v_h^k \|_{L^2(\Omega)} \}_{k=0}^{K}\) stored in a K+1 x 1 vector |
This function calls fv_l2_error()
Reimplemented from Greedy.User.FVDetailedModelDefault.
Definition at line 197 of file DetailedModel.m.
function p = TwoPhaseFlow.DetailedModel.plot_sim_data | ( | ModelData | model_data, |
sim_data, | |||
plot_params | |||
) |
plots the simulation data as returned by detailed_simulation()
function plotting simulation results
model_data | Matlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation(). |
sim_data | simulation data structure as returned by detailed_simulation() |
plot_params | structure which controls the plot output |
p | Matlab GUI handle to figure window |
P —
P U —
U S —
S t —
t gEI —
gEIgEI —
gEI grid —
a structure containing geometry information of a mesh used for discretizationsplot —
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.
TwoPhaseFlow.DetailedModel.compute_conditions = false |
boolean flag indicating whether conditions of system matrices shall be computed.
Default: false
Definition at line 78 of file DetailedModel.m.
|
static |
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}}, \ 'newton_epsilon', {{@isscalar}} ")
Definition at line 34 of file DetailedModel.m.
TwoPhaseFlow.DetailedModel.t |
current time instance
Dependent
set to true. Definition at line 54 of file DetailedModel.m.
TwoPhaseFlow.DetailedModel.tstep |
current time step
Dependent
set to true. Definition at line 65 of file DetailedModel.m.