1 classdef MergedSpaceOpEvals < SnapshotsGenerator.SpaceOpEvals
2 %
this class combines two SnapshotsGenerator.SpaceOpEvals and produces the
3 % combination of both
operator/
function evaluations.
5 % The generated snapshots are a concatenation of both underlying generators.
8 % If you have more than one
operator in your numerical scheme,
for which
9 % you want to create a collateral reduced basis space, you can merge their
10 % space
operator evaluation instances together and then create a collateral
11 % reduced basis space valid
for all the operators.
13 properties (Access =
private);
15 generator1; % first underlying
object of type SnapshotsGenerator.SpaceOpEvals
17 generator2; % second underlying
object of type SnapshotsGenerator.SpaceOpEvals
27 % generator1: first space
operator evaluation
object of type SnapshotsGenerator.
SpaceOpEvals.
28 % generator2: second space
operator evaluation
object of type SnapshotsGenerator.SpaceOpEvals.
30 assert(generator1.rb_detailed_generator == generator2.rb_detailed_generator);
38 model1 = get_underlying_model(generator1);
39 model2 = get_underlying_model(generator2);
41 sumeidg = sumeidg@SnapshotsGenerator.SpaceOpEvals(model1,
id, ...
42 generator1.rb_detailed_generator, ...
43 generator1.ophandle, ...
44 generator1.force_delete & generator2.force_delete, ...
45 generator1.enable_caching & generator2.enable_caching);
46 assert_model_is_consistent(sumeidg, model1, model2);
48 sumeidg.generator1 = generator1;
49 sumeidg.generator2 = generator2;
52 function combination = plus(
this, other)
53 %
function combination = plus(
this, other)
54 % convenience
function allowing to merge several
56 % together with a
'+' operator.
67 methods(Access =
protected);
69 function LU = generate_ei_impl(
this, dmodel, detailed_data, U)
70 LU = [generate_ei_impl(this.generator1, dmodel, detailed_data, U), ...
71 generate_ei_impl(this.generator2, dmodel, detailed_data, U)];