libMesh
Loading...
Searching...
No Matches
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#include <string>
35
36namespace libMesh
37{
38
39// Forward declarations
40class RBEvaluation;
41class TransientRBEvaluation;
42class RBEIMEvaluation;
43class RBSCMEvaluation;
44class RBParametrized;
45class ReplicatedMesh;
46class Elem;
47class Point;
48
49namespace RBDataDeserialization
50{
51
61{
62public:
63
69
81
87 void read_from_file(const std::string & path,
88 bool read_error_bound_data,
89 bool use_packing = false);
90
91private:
92
97};
98
99
100
143
144
145
187
188
189
190// RBSCMEvaluation should only be available
191// if SLEPc and GLPK support is enabled.
192#if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
193
235
236#endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
237
242void load_parameter_ranges(RBParametrized & rb_evaluation,
243 RBData::ParameterRanges::Reader & parameter_ranges,
244 RBData::DiscreteParameterList::Reader & discrete_parameters_list);
245
249template <typename RBEvaluationReaderNumber>
250void load_rb_evaluation_data(RBEvaluation & rb_evaluation,
251 RBEvaluationReaderNumber & rb_evaluation_reader,
252 bool read_error_bound_data);
253
258template <typename RBEvaluationReaderNumber, typename TransRBEvaluationReaderNumber>
260 RBEvaluationReaderNumber & rb_evaluation_reader,
261 TransRBEvaluationReaderNumber & trans_rb_eval_reader,
262 bool read_error_bound_data);
263
268template <typename RBEIMEvaluationReaderNumber>
270 RBEIMEvaluationReaderNumber & rb_eim_eval_reader);
271
272#if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
281 RBData::RBSCMEvaluation::Reader & rb_scm_eval_reader);
282#endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
283
287void load_point(RBData::Point3D::Reader point_reader, Point & point);
288
289} // namespace RBDataDeserialization
290
291} // namespace libMesh
292
293#endif // #if defined(LIBMESH_HAVE_CAPNPROTO)
294
295#endif // RB_COMPONENT_DATA_DESERIALIZATION_H
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition point.h:40
This class de-serializes a RBEIMEvaluation object using the Cap'n Proto library.
RBEIMEvaluationDeserialization(const RBEIMEvaluationDeserialization &)=default
void read_from_file(const std::string &path, bool use_packing=false)
Read the Cap'n'Proto buffer from disk.
RBEIMEvaluation & _rb_eim_eval
The RBEIMEvaluation object we will read into.
RBEIMEvaluationDeserialization & operator=(const RBEIMEvaluationDeserialization &)=delete
RBEIMEvaluationDeserialization(RBEIMEvaluationDeserialization &&)=default
Special functions.
This class de-serializes an RBEvaluation object using the Cap'n Proto library.
RBEvaluationDeserialization(RBEvaluationDeserialization &&)=default
Special functions.
RBEvaluationDeserialization & operator=(const RBEvaluationDeserialization &)=delete
RBEvaluation & _rb_eval
The RBEvaluation object that we will read into.
RBEvaluationDeserialization(const RBEvaluationDeserialization &)=default
void read_from_file(const std::string &path, bool read_error_bound_data, bool use_packing=false)
Read the Cap'n'Proto buffer from disk.
This class de-serializes a RBSCMEvaluation object using the Cap'n Proto library.
RBSCMEvaluation & _rb_scm_eval
The RBSCMEvaluation object we will read into.
RBSCMEvaluationDeserialization & operator=(const RBSCMEvaluationDeserialization &)=delete
RBSCMEvaluationDeserialization(RBSCMEvaluationDeserialization &&)=default
Special functions.
RBSCMEvaluationDeserialization(const RBSCMEvaluationDeserialization &)=default
void read_from_file(const std::string &path, bool use_packing=false)
Read the Cap'n'Proto buffer from disk.
This class de-serializes a TransientRBEvaluation object using the Cap'n Proto library.
TransientRBEvaluation & _trans_rb_eval
The TransientRBEvaluation object that we will read into.
TransientRBEvaluationDeserialization & operator=(const TransientRBEvaluationDeserialization &)=delete
TransientRBEvaluationDeserialization(const TransientRBEvaluationDeserialization &)=default
TransientRBEvaluationDeserialization(TransientRBEvaluationDeserialization &&)=default
Special functions.
void read_from_file(const std::string &path, bool read_error_bound_data, bool use_packing=false)
Read the Cap'n'Proto buffer from disk.
This class enables evaluation of an Empirical Interpolation Method (EIM) approximation.
This class is part of the rbOOmit framework.
This class is part of the rbOOmit framework.
This class is part of the rbOOmit framework.
This class is part of the rbOOmit framework.
void load_point(RBData::Point3D::Reader point_reader, Point &point)
Helper function that loads point data.
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.
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.
void load_rb_eim_evaluation_data(RBEIMEvaluation &rb_eim_eval, RBEIMEvaluationReaderNumber &rb_eim_eval_reader)
Load an EIM RB evaluation from a corresponding reader structure in the buffer.
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...
The libMesh namespace provides an interface to certain functionality in the library.