This class de-serializes a RBEIMEvaluation object using the Cap'n Proto library.
More...
#include <rb_data_deserialization.h>
This class de-serializes a RBEIMEvaluation object using the Cap'n Proto library.
Definition at line 150 of file rb_data_deserialization.h.
◆ RBEIMEvaluationDeserialization() [1/3]
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 188 of file rb_data_deserialization.C.
RBEIMEvaluation & _rb_eim_eval
The RBEIMEvaluation object we will read into.
◆ RBEIMEvaluationDeserialization() [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.
◆ RBEIMEvaluationDeserialization() [3/3]
◆ ~RBEIMEvaluationDeserialization()
libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization::~RBEIMEvaluationDeserialization |
( |
| ) |
|
|
virtualdefault |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ read_from_file()
void libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization::read_from_file |
( |
const std::string & |
path, |
|
|
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 194 of file rb_data_deserialization.C.
References _rb_eim_eval, and libMesh::RBDataDeserialization::load_rb_eim_evaluation_data().
Referenced by main().
197 LOG_SCOPE(
"read_from_file()",
"RBEIMEvaluationDeserialization");
199 int fd = open(path.c_str(), O_RDONLY);
200 libmesh_error_msg_if(!fd,
"Couldn't open the buffer file: " + path);
203 capnp::ReaderOptions reader_options;
204 reader_options.traversalLimitInWords = std::numeric_limits<uint64_t>::max();
206 std::unique_ptr<capnp::InputStreamMessageReader> message;
210 message = std::make_unique<capnp::PackedFdMessageReader>(fd, reader_options);
212 message = std::make_unique<capnp::StreamFdMessageReader>(fd, reader_options);
216 libmesh_error_msg(
"Failed to open capnp buffer");
219 #ifndef LIBMESH_USE_COMPLEX_NUMBERS 220 RBData::RBEIMEvaluationReal::Reader rb_eim_eval_reader =
221 message->getRoot<RBData::RBEIMEvaluationReal>();
223 RBData::RBEIMEvaluationComplex::Reader rb_eim_eval_reader =
224 message->getRoot<RBData::RBEIMEvaluationComplex>();
230 int error = close(fd);
231 libmesh_error_msg_if(error,
"Error closing a read-only file descriptor: " + path);
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.
RBEIMEvaluation & _rb_eim_eval
The RBEIMEvaluation object we will read into.
◆ _rb_eim_eval
RBEIMEvaluation& libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization::_rb_eim_eval |
|
private |
The documentation for this class was generated from the following files: