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 75 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, |
|
|
bool |
use_packing = false |
|
) |
| |
Read the Cap'n'Proto buffer from disk.
If use_packing
is true, the file is read using the "packed" scheme, which can reduce the filesize on disk.
Definition at line 82 of file rb_data_deserialization.C.
References _rb_eval, and libMesh::RBDataDeserialization::load_rb_evaluation_data().
Referenced by main().
86 LOG_SCOPE(
"read_from_file()",
"RBEvaluationDeserialization");
88 int fd = open(path.c_str(), O_RDONLY);
89 libmesh_error_msg_if(!fd,
"Couldn't open the buffer file: " + path);
92 capnp::ReaderOptions reader_options;
93 reader_options.traversalLimitInWords = std::numeric_limits<uint64_t>::max();
95 std::unique_ptr<capnp::InputStreamMessageReader> message;
100 message = std::make_unique<capnp::PackedFdMessageReader>(fd, reader_options);
102 message = std::make_unique<capnp::StreamFdMessageReader>(fd, reader_options);
106 libmesh_error_msg(
"Failed to open capnp buffer");
109 #ifndef LIBMESH_USE_COMPLEX_NUMBERS 110 RBData::RBEvaluationReal::Reader rb_eval_reader =
111 message->getRoot<RBData::RBEvaluationReal>();
113 RBData::RBEvaluationComplex::Reader rb_eval_reader =
114 message->getRoot<RBData::RBEvaluationComplex>();
119 int error = close(fd);
120 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: