This class de-serializes an RBEvaluation object using the Cap'n Proto library.
More...
#include <rb_data_deserialization.h>
This class de-serializes an RBEvaluation object using the Cap'n Proto library.
- Author
- David Knezevic
- Date
- 2015 Deserializes RBEvaluation objects using Cap'n Proto.
Definition at line 60 of file rb_data_deserialization.h.
◆ RBEvaluationDeserialization() [1/3]
libMesh::RBDataDeserialization::RBEvaluationDeserialization::RBEvaluationDeserialization |
( |
RBEvaluation & |
rb_eval | ) |
|
Initialize a new buffer using the structure from the Cap'n'Proto schema described in rb_data.capnp.
Definition at line 74 of file rb_data_deserialization.C.
RBEvaluation & _rb_eval
The RBEvaluation object that we will read into.
◆ RBEvaluationDeserialization() [2/3]
Special functions.
- This class contains a reference, so it can't be default copy/move-assigned.
- The destructor is defaulted out of line.
◆ RBEvaluationDeserialization() [3/3]
◆ ~RBEvaluationDeserialization()
libMesh::RBDataDeserialization::RBEvaluationDeserialization::~RBEvaluationDeserialization |
( |
| ) |
|
|
virtualdefault |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ read_from_file()
void libMesh::RBDataDeserialization::RBEvaluationDeserialization::read_from_file |
( |
const std::string & |
path, |
|
|
bool |
read_error_bound_data |
|
) |
| |
Write the Cap'n'Proto buffer to disk.
Definition at line 81 of file rb_data_deserialization.C.
References _rb_eval, and libMesh::RBDataDeserialization::load_rb_evaluation_data().
Referenced by main().
84 LOG_SCOPE(
"read_from_file()",
"RBEvaluationDeserialization");
86 int fd = open(path.c_str(), O_RDONLY);
87 libmesh_error_msg_if(!fd,
"Couldn't open the buffer file: " + path);
90 capnp::ReaderOptions reader_options;
91 reader_options.traversalLimitInWords = std::numeric_limits<uint64_t>::max();
93 std::unique_ptr<capnp::StreamFdMessageReader> message;
96 message = std::make_unique<capnp::StreamFdMessageReader>(fd, reader_options);
100 libmesh_error_msg(
"Failed to open capnp buffer");
103 #ifndef LIBMESH_USE_COMPLEX_NUMBERS 104 RBData::RBEvaluationReal::Reader rb_eval_reader =
105 message->getRoot<RBData::RBEvaluationReal>();
107 RBData::RBEvaluationComplex::Reader rb_eval_reader =
108 message->getRoot<RBData::RBEvaluationComplex>();
113 int error = close(fd);
114 libmesh_error_msg_if(error,
"Error closing a read-only file descriptor: " + path);
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.
RBEvaluation & _rb_eval
The RBEvaluation object that we will read into.
◆ _rb_eval
RBEvaluation& libMesh::RBDataDeserialization::RBEvaluationDeserialization::_rb_eval |
|
private |
The documentation for this class was generated from the following files: