libMesh
rb_data_serialization.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_SERIALIZATION_H
21 #define RB_DATA_SERIALIZATION_H
22 
23 #include "libmesh/libmesh_config.h"
24 #if defined(LIBMESH_HAVE_CAPNPROTO)
25 
26 // C++ includes
27 #include <string>
28 
29 // libMesh/reduced_basis includes
30 #include "libmesh/rb_data.capnp.h"
31 
32 // Cap'n'Proto includes
33 #include "capnp/message.h"
34 
35 namespace libMesh
36 {
37 
38 // Forward declarations
39 class RBEvaluation;
40 class TransientRBEvaluation;
41 class RBEIMEvaluation;
42 class RBSCMEvaluation;
43 class RBParametrized;
44 class Point;
45 class Elem;
46 
47 namespace RBDataSerialization
48 {
49 
59 {
60 public:
61 
67 
79 
85  void write_to_file(const std::string & path, bool use_packing = false);
86 
87 private:
88 
93 };
94 
95 
96 
102 {
103 public:
104 
110 
122 
128  void write_to_file(const std::string & path, bool use_packing = false);
129 
130 private:
131 
136 };
137 
138 
139 
145 {
146 public:
147 
153 
165 
171  void write_to_file(const std::string & path, bool use_packing = false);
172 
173 private:
174 
179 };
180 
181 
182 
183 // RBSCMEvaluation should only be available
184 // if SLEPc and GLPK support is enabled.
185 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
186 
192 {
193 public:
194 
200 
212 
218  void write_to_file(const std::string & path, bool use_packing = false);
219 
220 private:
221 
226 };
227 
228 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
229 
230 
231 
232 
236 void add_parameter_ranges_to_builder(const RBParametrized & rb_evaluation,
237  RBData::ParameterRanges::Builder & parameter_ranges,
238  RBData::DiscreteParameterList::Builder & discrete_parameters_list);
239 
243 template <typename RBEvaluationBuilderNumber>
245  RBEvaluationBuilderNumber & rb_eval_builder);
246 
251 template <typename RBEvaluationBuilderNumber, typename TransRBEvaluationBuilderNumber>
253  RBEvaluationBuilderNumber & rb_eval_builder,
254  TransRBEvaluationBuilderNumber & trans_rb_eval_builder);
255 
260 template <typename RBEIMEvaluationBuilderNumber>
262  RBEIMEvaluationBuilderNumber & rb_eim_eval_builder);
263 
264 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
265 
273  RBData::RBSCMEvaluation::Builder & rb_scm_eval_builder);
274 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
275 
279 void add_point_to_builder(const Point & point,
280  RBData::Point3D::Builder point_builder);
281 
282 } // namespace RBDataSerialization
283 
284 } // namespace libMesh
285 
286 #endif // #if defined(LIBMESH_HAVE_CAPNPROTO)
287 
288 #endif // RB_DATA_SERIALIZATION_H
void write_to_file(const std::string &path, bool use_packing=false)
Write the Cap&#39;n&#39;Proto buffer to disk.
RBSCMEvaluationSerialization(RBSCMEvaluation &rb_eval)
Initialize a new buffer using the structure from the Cap&#39;n&#39;Proto schema described in rb_data...
void add_rb_eim_evaluation_data_to_builder(RBEIMEvaluation &rb_eim_eval, RBEIMEvaluationBuilderNumber &rb_eim_eval_builder)
Add data for an RBEIMEvaluation to the builder.
This class serializes an RBEvaluation object using the Cap&#39;n Proto library.
void add_transient_rb_evaluation_data_to_builder(TransientRBEvaluation &trans_rb_eval, RBEvaluationBuilderNumber &rb_eval_builder, TransRBEvaluationBuilderNumber &trans_rb_eval_builder)
Add data for a TransientRBEvaluation to the builder.
This class serializes a TransientRBEvaluation object using the Cap&#39;n Proto library.
This class is part of the rbOOmit framework.
void add_parameter_ranges_to_builder(const RBParametrized &rb_evaluation, RBData::ParameterRanges::Builder &parameter_ranges, RBData::DiscreteParameterList::Builder &discrete_parameters_list)
Add parameter ranges for continuous and discrete parameters.
void add_rb_evaluation_data_to_builder(RBEvaluation &rb_eval, RBEvaluationBuilderNumber &rb_eval_builder)
Add data for an RBEvaluation to the builder.
RBEIMEvaluation & _rb_eim_eval
The RBEvaluation object that will be written to disk.
The libMesh namespace provides an interface to certain functionality in the library.
RBEvaluationSerialization(RBEvaluation &rb_eval)
Initialize a new buffer using the structure from the Cap&#39;n&#39;Proto schema described in rb_data...
This class serializes an RBEIMEvaluation object using the Cap&#39;n Proto library.
RBEvaluationSerialization & operator=(const RBEvaluationSerialization &)=delete
void write_to_file(const std::string &path, bool use_packing=false)
Write the Cap&#39;n&#39;Proto buffer to disk.
TransientRBEvaluationSerialization(TransientRBEvaluation &rb_eval)
Initialize a new buffer using the structure from the Cap&#39;n&#39;Proto schema described in rb_data...
TransientRBEvaluationSerialization & operator=(const TransientRBEvaluationSerialization &)=delete
void write_to_file(const std::string &path, bool use_packing=false)
Write the Cap&#39;n&#39;Proto buffer to disk.
RBEIMEvaluationSerialization(RBEIMEvaluation &rb_eval)
Initialize a new buffer using the structure from the Cap&#39;n&#39;Proto schema described in rb_data...
void add_point_to_builder(const Point &point, RBData::Point3D::Builder point_builder)
Helper function that adds point data.
RBSCMEvaluation & _rb_scm_eval
The RBEvaluation object that will be written to disk.
This class is part of the rbOOmit framework.
Definition: rb_evaluation.h:50
void add_rb_scm_evaluation_data_to_builder(RBSCMEvaluation &rb_scm_eval, RBData::RBSCMEvaluation::Builder &rb_scm_eval_builder)
Add data for an RBSCMEvaluation to the builder.
void write_to_file(const std::string &path, bool use_packing=false)
Write the Cap&#39;n&#39;Proto buffer to disk.
This class is part of the rbOOmit framework.
TransientRBEvaluation & _trans_rb_eval
The RBEvaluation object that will be written to disk.
This class serializes an RBSCMEvaluation object using the Cap&#39;n Proto library.
RBSCMEvaluationSerialization & operator=(const RBSCMEvaluationSerialization &)=delete
RBEvaluation & _rb_eval
The RBEvaluation object that will be written to disk.
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
RBEIMEvaluationSerialization & operator=(const RBEIMEvaluationSerialization &)=delete
This class is part of the rbOOmit framework.