rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
Trajectories.m
1 classdef Trajectories < SnapshotsGenerator.Cached
2 % Implementation of a SnapshotsGenerator.Cached for reduced basis generation. The
3 % generate() method returns a detailed simulation.
4 
5  methods
6  function rbdg = Trajectories(dmodel, id, force_delete, enable_caching)
7  % function rbdg = Trajectories(dmodel, id [, force_delete, enable_caching])
8  % constructor for a snapshot generator creating trajectories of DOF
9  % vectors by a IDetailedModel.detailed_simulation() call.
10  %
11  % Parameters:
12  % id: a unique string identifier for this object.
13  % force_delete: boolean value indicating whether the cached data shall
14  % be automatically deleted if its inconsistent with the given
15  % 'dmodel'. (Default = 'true')
16  % enable_caching: boolean value indicating whether the generated data
17  % shall be stored in a cache. (Default = 'true')
18  if nargin < 2 || isempty(id)
19  id = 'rb';
20  end
21  if nargin < 3
22  force_delete = [];
23  end
24  if nargin < 4
25  enable_caching = [];
26  end
27  rbdg = rbdg@SnapshotsGenerator.Cached(dmodel, id, force_delete, enable_caching);
28  end
29 
30  end
31 
32  methods (Access = protected)
33  function [U, opt_fields] = generate_impl(this, dmodel, detailed_data, fields)
34  if nargin <= 3
35  fields = [];
36  end
37  opt_fields = [];
38  sim_data = detailed_simulation(dmodel, detailed_data);
39  U = dmodel.get_dofs_from_sim_data(sim_data);
40  for i=1:length(fields)
41  opt_fields.(fields{i}) = sim_data.(fields{i});
42  end
43  end
44  end
45 end
Interface for the storage and generation of detailed data that can be used to build reduced basis fun...
Definition: Cached.m:18
Cacheable generators of detailed data snapshots.
Definition: Cached.m:1
This is the interface for a detailed model providing methods to compute high dimensional simulation s...