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 
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)
Load an EIM RB evaluation from a corresponding reader structure in the buffer.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
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.
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 is the base class from which all geometric element types are derived.
Definition: elem.h:89
MeshBase & mesh
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.
RBEvaluationDeserialization(RBEvaluation &rb_eval)
Initialize a new buffer using the structure from the Cap&#39;n&#39;Proto schema described in rb_data...
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 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.
This class de-serializes a RBSCMEvaluation object using the Cap&#39;n Proto library.
This class is part of the rbOOmit framework.
Definition: rb_evaluation.h:50
void load_point(RBData::Point3D::Reader point_reader, Point &point)
Helper function that loads point data.
This class is part of the rbOOmit framework.
TransientRBEvaluation & _trans_rb_eval
The TransientRBEvaluation object that we will read into.
RBEvaluation & _rb_eval
The RBEvaluation object that we will read into.
void load_elem_into_mesh(RBData::MeshElem::Reader mesh_elem_reader, libMesh::Elem *elem, libMesh::ReplicatedMesh &mesh)
Helper function that loads element data.
This class de-serializes an RBEvaluation object using the Cap&#39;n Proto library.
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 de-serializes a RBEIMEvaluation object using the Cap&#39;n Proto library.
This class is part of the rbOOmit framework.