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 
72 
76  void write_to_file(const std::string & path);
77 
78 private:
79 
84 
85 };
86 
92 {
93 public:
94 
100 
105 
109  void write_to_file(const std::string & path);
110 
111 private:
112 
117 
118 };
119 
125 {
126 public:
127 
133 
138 
142  void write_to_file(const std::string & path);
143 
144 private:
145 
150 
151 };
152 
153 // RBSCMEvaluation should only be available
154 // if SLEPc and GLPK support is enabled.
155 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
156 
162 {
163 public:
164 
170 
175 
179  void write_to_file(const std::string & path);
180 
181 private:
182 
187 
188 };
189 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
190 
194 void add_parameter_ranges_to_builder(const RBParametrized & rb_evaluation,
195  RBData::ParameterRanges::Builder & parameter_ranges,
196  RBData::DiscreteParameterList::Builder & discrete_parameters_list);
197 
201 template <typename RBEvaluationBuilderNumber>
203  RBEvaluationBuilderNumber & rb_eval_builder);
204 
209 template <typename RBEvaluationBuilderNumber, typename TransRBEvaluationBuilderNumber>
211  RBEvaluationBuilderNumber & rb_eval_builder,
212  TransRBEvaluationBuilderNumber & trans_rb_eval_builder);
213 
218 template <typename RBEvaluationBuilderNumber, typename RBEIMEvaluationBuilderNumber>
220  RBEvaluationBuilderNumber & rb_eval_builder,
221  RBEIMEvaluationBuilderNumber & rb_eim_eval_builder);
222 
223 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
224 
232  RBData::RBSCMEvaluation::Builder & rb_scm_eval_builder);
233 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
234 
238 void add_point_to_builder(const Point & point,
239  RBData::Point3D::Builder point_builder);
240 
244 void add_elem_to_builder(const Elem & elem,
245  RBData::MeshElem::Builder mesh_elem_builder);
246 
247 } // namespace RBDataSerialization
248 
249 } // namespace libMesh
250 
251 #endif // #if defined(LIBMESH_HAVE_CAPNPROTO)
252 
253 #endif // RB_DATA_SERIALIZATION_H
Serializes RBEvaluation objects using Cap&#39;n Proto.
void add_transient_rb_evaluation_data_to_builder(TransientRBEvaluation &trans_rb_eval, RBEvaluationBuilderNumber &rb_eval_builder, TransRBEvaluationBuilderNumber &trans_rb_eval_builder)
The base class for all geometric element types.
Definition: elem.h:100
void add_parameter_ranges_to_builder(const RBParametrized &rb_evaluation, RBData::ParameterRanges::Builder &parameter_ranges, RBData::DiscreteParameterList::Builder &discrete_parameters_list)
void add_rb_evaluation_data_to_builder(RBEvaluation &rb_eval, RBEvaluationBuilderNumber &rb_eval_builder)
void add_rb_eim_evaluation_data_to_builder(RBEIMEvaluation &rb_eim_eval, RBEvaluationBuilderNumber &rb_eval_builder, RBEIMEvaluationBuilderNumber &rb_eim_eval_builder)
void add_point_to_builder(const Point &point, RBData::Point3D::Builder point_builder)
void add_rb_scm_evaluation_data_to_builder(RBSCMEvaluation &rb_scm_eval, RBData::RBSCMEvaluation::Builder &rb_scm_eval_builder)
void add_elem_to_builder(const Elem &elem, RBData::MeshElem::Builder mesh_elem_builder)
A geometric point in (x,y,z) space.
Definition: point.h:38