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 
85  void read_from_file(const std::string & path, bool read_error_bound_data);
86 
87 private:
88 
93 };
94 
95 
96 
102 {
103 public:
104 
110 
122 
126  void read_from_file(const std::string & path, bool read_error_bound_data);
127 
128 private:
129 
134 };
135 
136 
137 
143 {
144 public:
145 
151 
163 
167  void read_from_file(const std::string & path);
168 
169 private:
170 
175 };
176 
177 
178 
179 // RBSCMEvaluation should only be available
180 // if SLEPc and GLPK support is enabled.
181 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
182 
188 {
189 public:
190 
196 
208 
212  void read_from_file(const std::string & path);
213 
214 private:
215 
220 };
221 
222 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
223 
228 void load_parameter_ranges(RBParametrized & rb_evaluation,
229  RBData::ParameterRanges::Reader & parameter_ranges,
230  RBData::DiscreteParameterList::Reader & discrete_parameters_list);
231 
235 template <typename RBEvaluationReaderNumber>
236 void load_rb_evaluation_data(RBEvaluation & rb_evaluation,
237  RBEvaluationReaderNumber & rb_evaluation_reader,
238  bool read_error_bound_data);
239 
244 template <typename RBEvaluationReaderNumber, typename TransRBEvaluationReaderNumber>
246  RBEvaluationReaderNumber & rb_evaluation_reader,
247  TransRBEvaluationReaderNumber & trans_rb_eval_reader,
248  bool read_error_bound_data);
249 
254 template <typename RBEIMEvaluationReaderNumber>
256  RBEIMEvaluationReaderNumber & rb_eim_eval_reader);
257 
258 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
259 
267  RBData::RBSCMEvaluation::Reader & rb_scm_eval_reader);
268 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
269 
273 void load_point(RBData::Point3D::Reader point_reader, Point & point);
274 
275 } // namespace RBDataDeserialization
276 
277 } // namespace libMesh
278 
279 #endif // #if defined(LIBMESH_HAVE_CAPNPROTO)
280 
281 #endif // RB_COMPONENT_DATA_DESERIALIZATION_H
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 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 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.
void read_from_file(const std::string &path, bool read_error_bound_data)
Write the Cap&#39;n&#39;Proto buffer to disk.
RBEIMEvaluation & _rb_eim_eval
The RBEIMEvaluation object we will read into.
void read_from_file(const std::string &path)
Write the Cap&#39;n&#39;Proto buffer to disk.
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.
This class is part of the rbOOmit framework.
void read_from_file(const std::string &path, bool read_error_bound_data)
Write the Cap&#39;n&#39;Proto buffer to disk.
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.
void read_from_file(const std::string &path)
Write the Cap&#39;n&#39;Proto buffer to disk.
This class is part of the rbOOmit framework.