libMesh
Public Member Functions | Private Attributes | List of all members
libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization Class Reference

This class de-serializes a RBEIMEvaluation object using the Cap'n Proto library. More...

#include <rb_data_deserialization.h>

Public Member Functions

 RBEIMEvaluationDeserialization (RBEIMEvaluation &trans_rb_eval)
 Initialize a new buffer using the structure from the Cap'n'Proto schema described in rb_data.capnp. More...
 
virtual ~RBEIMEvaluationDeserialization ()
 Destructor. More...
 
void read_from_file (const std::string &path)
 Write the Cap'n'Proto buffer to disk. More...
 

Private Attributes

RBEIMEvaluation_rb_eim_eval
 The RBEIMEvaluation object we will read into. More...
 

Detailed Description

This class de-serializes a RBEIMEvaluation object using the Cap'n Proto library.

Definition at line 121 of file rb_data_deserialization.h.

Constructor & Destructor Documentation

libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization::RBEIMEvaluationDeserialization ( RBEIMEvaluation trans_rb_eval)

Initialize a new buffer using the structure from the Cap'n'Proto schema described in rb_data.capnp.

Definition at line 156 of file rb_data_deserialization.C.

Referenced by libMesh::RBDataDeserialization::TransientRBEvaluationDeserialization::read_from_file().

156  :
157  _rb_eim_eval(rb_eim_eval)
158 {}
RBEIMEvaluation & _rb_eim_eval
The RBEIMEvaluation object we will read into.
libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization::~RBEIMEvaluationDeserialization ( )
virtual

Destructor.

Definition at line 160 of file rb_data_deserialization.C.

161 {}

Member Function Documentation

void libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization::read_from_file ( const std::string &  path)

Write the Cap'n'Proto buffer to disk.

Definition at line 163 of file rb_data_deserialization.C.

References _rb_eim_eval, libMesh::RBDataDeserialization::load_rb_eim_evaluation_data(), std::max(), and libMesh::RBDataDeserialization::RBSCMEvaluationDeserialization::RBSCMEvaluationDeserialization().

Referenced by main().

164 {
165  LOG_SCOPE("read_from_file()", "RBEIMEvaluationDeserialization");
166 
167  int fd = open(path.c_str(), O_RDONLY);
168  if (!fd)
169  libmesh_error_msg("Couldn't open the buffer file: " + path);
170 
171  // Turn off the limit to the amount of data we can read in
172  capnp::ReaderOptions reader_options;
173  reader_options.traversalLimitInWords = std::numeric_limits<uint64_t>::max();
174 
175  capnp::StreamFdMessageReader message(fd, reader_options);
176 
177 #ifndef LIBMESH_USE_COMPLEX_NUMBERS
178  RBData::RBEIMEvaluationReal::Reader rb_eim_eval_reader =
179  message.getRoot<RBData::RBEIMEvaluationReal>();
180  RBData::RBEvaluationReal::Reader rb_eval_reader =
181  rb_eim_eval_reader.getRbEvaluation();
182 #else
183  RBData::RBEIMEvaluationComplex::Reader rb_eim_eval_reader =
184  message.getRoot<RBData::RBEIMEvaluationComplex>();
185  RBData::RBEvaluationComplex::Reader rb_eval_reader =
186  rb_eim_eval_reader.getRbEvaluation();
187 #endif
188 
190  rb_eval_reader,
191  rb_eim_eval_reader);
192 }
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.
long double max(long double a, double b)
RBEIMEvaluation & _rb_eim_eval
The RBEIMEvaluation object we will read into.

Member Data Documentation

RBEIMEvaluation& libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization::_rb_eim_eval
private

The RBEIMEvaluation object we will read into.

Definition at line 146 of file rb_data_deserialization.h.

Referenced by read_from_file().


The documentation for this class was generated from the following files: