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 
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 
137  virtual ~RBEIMEvaluationSerialization();
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 
174  virtual ~RBSCMEvaluationSerialization();
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
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 is the base class from which all geometric element types are derived.
Definition: elem.h:89
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.
void add_rb_eim_evaluation_data_to_builder(RBEIMEvaluation &rb_eim_eval, RBEvaluationBuilderNumber &rb_eval_builder, RBEIMEvaluationBuilderNumber &rb_eim_eval_builder)
Add data for an RBEIMEvaluation to the builder.
void write_to_file(const std::string &path)
Write the Cap&#39;n&#39;Proto buffer to disk.
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 add_elem_to_builder(const Elem &elem, RBData::MeshElem::Builder mesh_elem_builder)
Helper function that adds element data.
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.
RBEvaluation & _rb_eval
The RBEvaluation object that will be written to disk.
This class is part of the rbOOmit framework.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
This class is part of the rbOOmit framework.