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 
35 namespace libMesh
36 {
37 
38 // Forward declarations
39 class RBEvaluation;
40 class TransientRBEvaluation;
41 class RBEIMEvaluation;
42 class RBSCMEvaluation;
43 
44 namespace RBDataDeserialization
45 {
46 
56 {
57 public:
58 
64 
69 
73  void read_from_file(const std::string & path, bool read_error_bound_data);
74 
75 private:
76 
81 
82 };
83 
89 {
90 public:
91 
97 
102 
106  void read_from_file(const std::string & path, bool read_error_bound_data);
107 
108 private:
109 
114 
115 };
116 
122 {
123 public:
124 
130 
135 
139  void read_from_file(const std::string & path);
140 
141 private:
142 
147 
148 };
149 
150 // RBSCMEvaluation should only be available
151 // if SLEPc and GLPK support is enabled.
152 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
153 
159 {
160 public:
161 
167 
172 
176  void read_from_file(const std::string & path);
177 
178 private:
179 
184 
185 };
186 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
187 
192 void load_parameter_ranges(RBParametrized & rb_evaluation,
193  RBData::ParameterRanges::Reader & parameter_ranges,
194  RBData::DiscreteParameterList::Reader & discrete_parameters_list);
195 
199 template <typename RBEvaluationReaderNumber>
200 void load_rb_evaluation_data(RBEvaluation & rb_evaluation,
201  RBEvaluationReaderNumber & rb_evaluation_reader,
202  bool read_error_bound_data);
203 
208 template <typename RBEvaluationReaderNumber, typename TransRBEvaluationReaderNumber>
210  RBEvaluationReaderNumber & rb_evaluation_reader,
211  TransRBEvaluationReaderNumber & trans_rb_eval_reader,
212  bool read_error_bound_data);
213 
218 template <typename RBEvaluationReaderNumber, typename RBEIMEvaluationReaderNumber>
220  RBEvaluationReaderNumber & rb_evaluation_reader,
221  RBEIMEvaluationReaderNumber & rb_eim_eval_reader);
222 
223 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
224 
232  RBData::RBSCMEvaluation::Reader & rb_scm_eval_reader);
233 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
234 
238 void load_point(RBData::Point3D::Reader point_reader, Point & point);
239 
243 void load_elem_into_mesh(RBData::MeshElem::Reader mesh_elem_reader,
244  libMesh::Elem * elem,
246 
247 } // namespace RBDataDeserialization
248 
249 } // namespace libMesh
250 
251 #endif // #if defined(LIBMESH_HAVE_CAPNPROTO)
252 
253 #endif // RB_COMPONENT_DATA_DESERIALIZATION_H
void load_rb_eim_evaluation_data(RBEIMEvaluation &rb_eim_eval, RBEvaluationReaderNumber &rb_evaluation_reader, RBEIMEvaluationReaderNumber &rb_eim_eval_reader)
Mesh data structure replicated on all processors.
void load_rb_evaluation_data(RBEvaluation &rb_evaluation, RBEvaluationReaderNumber &rb_evaluation_reader, bool read_error_bound_data)
void load_rb_scm_evaluation_data(RBSCMEvaluation &rb_scm_eval, RBData::RBSCMEvaluation::Reader &rb_scm_eval_reader)
The base class for all geometric element types.
Definition: elem.h:100
MeshBase & mesh
void load_transient_rb_evaluation_data(TransientRBEvaluation &trans_rb_eval, RBEvaluationReaderNumber &rb_evaluation_reader, TransRBEvaluationReaderNumber &trans_rb_eval_reader, bool read_error_bound_data)
void load_parameter_ranges(RBParametrized &rb_evaluation, RBData::ParameterRanges::Reader &parameter_ranges, RBData::DiscreteParameterList::Reader &discrete_parameters_list)
void read_from_file(const std::string &path, bool read_error_bound_data)
void load_point(RBData::Point3D::Reader point_reader, Point &point)
void read_from_file(const std::string &path, bool read_error_bound_data)
void load_elem_into_mesh(RBData::MeshElem::Reader mesh_elem_reader, libMesh::Elem *elem, libMesh::ReplicatedMesh &mesh)
Deserializes RBEvaluation objects using Cap&#39;n Proto.
TransientRBEvaluationDeserialization(TransientRBEvaluation &trans_rb_eval)
A geometric point in (x,y,z) space.
Definition: point.h:38