libMesh
rb_data_deserialization.h
Go to the documentation of this file.
1 // rbOOmit: An implementation of the Certified Reduced Basis method.
2 // Copyright (C) 2009, 2010, 2015 David J. Knezevic
3 
4 // This file is part of rbOOmit.
5 
6 // rbOOmit is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 
11 // rbOOmit is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20 #ifndef RB_DATA_DESERIALIZATION_H
21 #define RB_DATA_DESERIALIZATION_H
22 
23 // This class is only available if we have Cap'n Proto
24 #include "libmesh/libmesh_config.h"
25 #if defined(LIBMESH_HAVE_CAPNPROTO)
26 
27 // libMesh/reduced_basis includes
28 #include "libmesh/rb_data.capnp.h"
29 
30 // Cap'n'Proto includes
31 #include "capnp/message.h"
32 
33 // C++ includes
34 #include <string>
35 
36 namespace libMesh
37 {
38 
39 // Forward declarations
40 class RBEvaluation;
41 class TransientRBEvaluation;
42 class RBEIMEvaluation;
43 class RBSCMEvaluation;
44 class RBParametrized;
45 class ReplicatedMesh;
46 class Elem;
47 class Point;
48 
49 namespace RBDataDeserialization
50 {
51 
61 {
62 public:
63 
69 
81 
87  void read_from_file(const std::string & path,
88  bool read_error_bound_data,
89  bool use_packing = false);
90 
91 private:
92 
97 };
98 
99 
100 
106 {
107 public:
108 
114 
126 
132  void read_from_file(const std::string &path,
133  bool read_error_bound_data,
134  bool use_packing = false);
135 
136 private:
137 
142 };
143 
144 
145 
151 {
152 public:
153 
159 
171 
177  void read_from_file(const std::string & path,
178  bool use_packing = false);
179 
180 private:
181 
186 };
187 
188 
189 
190 // RBSCMEvaluation should only be available
191 // if SLEPc and GLPK support is enabled.
192 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
193 
199 {
200 public:
201 
207 
219 
225  void read_from_file(const std::string & path,
226  bool use_packing = false);
227 
228 private:
229 
234 };
235 
236 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
237 
242 void load_parameter_ranges(RBParametrized & rb_evaluation,
243  RBData::ParameterRanges::Reader & parameter_ranges,
244  RBData::DiscreteParameterList::Reader & discrete_parameters_list);
245 
249 template <typename RBEvaluationReaderNumber>
250 void load_rb_evaluation_data(RBEvaluation & rb_evaluation,
251  RBEvaluationReaderNumber & rb_evaluation_reader,
252  bool read_error_bound_data);
253 
258 template <typename RBEvaluationReaderNumber, typename TransRBEvaluationReaderNumber>
260  RBEvaluationReaderNumber & rb_evaluation_reader,
261  TransRBEvaluationReaderNumber & trans_rb_eval_reader,
262  bool read_error_bound_data);
263 
268 template <typename RBEIMEvaluationReaderNumber>
270  RBEIMEvaluationReaderNumber & rb_eim_eval_reader);
271 
272 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
273 
281  RBData::RBSCMEvaluation::Reader & rb_scm_eval_reader);
282 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
283 
287 void load_point(RBData::Point3D::Reader point_reader, Point & point);
288 
289 } // namespace RBDataDeserialization
290 
291 } // namespace libMesh
292 
293 #endif // #if defined(LIBMESH_HAVE_CAPNPROTO)
294 
295 #endif // RB_COMPONENT_DATA_DESERIALIZATION_H
void read_from_file(const std::string &path, bool read_error_bound_data, bool use_packing=false)
Read the Cap&#39;n&#39;Proto buffer from disk.
RBSCMEvaluation & _rb_scm_eval
The RBSCMEvaluation object we will read into.
This class de-serializes a TransientRBEvaluation object using the Cap&#39;n Proto library.
void read_from_file(const std::string &path, bool use_packing=false)
Read the Cap&#39;n&#39;Proto buffer from disk.
void load_rb_evaluation_data(RBEvaluation &rb_evaluation, RBEvaluationReaderNumber &rb_evaluation_reader, bool read_error_bound_data)
Load an RB evaluation from a corresponding reader structure in the buffer.
RBSCMEvaluationDeserialization & operator=(const RBSCMEvaluationDeserialization &)=delete
TransientRBEvaluationDeserialization & operator=(const TransientRBEvaluationDeserialization &)=delete
void load_rb_scm_evaluation_data(RBSCMEvaluation &rb_scm_eval, RBData::RBSCMEvaluation::Reader &rb_scm_eval_reader)
Load an SCM RB evaluation from a corresponding reader structure in the buffer.
This class is part of the rbOOmit framework.
void load_transient_rb_evaluation_data(TransientRBEvaluation &trans_rb_eval, RBEvaluationReaderNumber &rb_evaluation_reader, TransRBEvaluationReaderNumber &trans_rb_eval_reader, bool read_error_bound_data)
Load an RB evaluation from a corresponding reader structure in the buffer.
The libMesh namespace provides an interface to certain functionality in the library.
RBSCMEvaluationDeserialization(RBSCMEvaluation &trans_rb_eval)
Initialize a new buffer using the structure from the Cap&#39;n&#39;Proto schema described in rb_data...
RBEvaluationDeserialization(RBEvaluation &rb_eval)
Initialize a new buffer using the structure from the Cap&#39;n&#39;Proto schema described in rb_data...
RBEvaluationDeserialization & operator=(const RBEvaluationDeserialization &)=delete
void load_parameter_ranges(RBParametrized &rb_evaluation, RBData::ParameterRanges::Reader &parameter_ranges, RBData::DiscreteParameterList::Reader &discrete_parameters_list)
Load parameter ranges and discrete parameter values into an RBEvaluation from the corresponding struc...
void read_from_file(const std::string &path, bool read_error_bound_data, bool use_packing=false)
Read the Cap&#39;n&#39;Proto buffer from disk.
void load_rb_eim_evaluation_data(RBEIMEvaluation &rb_eim_eval, RBEIMEvaluationReaderNumber &rb_eim_eval_reader)
Load an EIM RB evaluation from a corresponding reader structure in the buffer.
RBEIMEvaluation & _rb_eim_eval
The RBEIMEvaluation object we will read into.
This class de-serializes a RBSCMEvaluation object using the Cap&#39;n Proto library.
RBEIMEvaluationDeserialization(RBEIMEvaluation &trans_rb_eval)
Initialize a new buffer using the structure from the Cap&#39;n&#39;Proto schema described in rb_data...
This class is part of the rbOOmit framework.
Definition: rb_evaluation.h:50
RBEIMEvaluationDeserialization & operator=(const RBEIMEvaluationDeserialization &)=delete
void load_point(RBData::Point3D::Reader point_reader, Point &point)
Helper function that loads point data.
void read_from_file(const std::string &path, bool use_packing=false)
Read the Cap&#39;n&#39;Proto buffer from disk.
This class is part of the rbOOmit framework.
TransientRBEvaluation & _trans_rb_eval
The TransientRBEvaluation object that we will read into.
RBEvaluation & _rb_eval
The RBEvaluation object that we will read into.
This class de-serializes an RBEvaluation object using the Cap&#39;n Proto library.
TransientRBEvaluationDeserialization(TransientRBEvaluation &trans_rb_eval)
Initialize a new buffer using the structure from the Cap&#39;n&#39;Proto schema described in rb_data...
This class enables evaluation of an Empirical Interpolation Method (EIM) approximation.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
This class de-serializes a RBEIMEvaluation object using the Cap&#39;n Proto library.
This class is part of the rbOOmit framework.