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

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

#include <rb_data_deserialization.h>

Public Member Functions

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

Private Attributes

TransientRBEvaluation_trans_rb_eval
 The TransientRBEvaluation object that we will read into. More...
 

Detailed Description

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

Definition at line 88 of file rb_data_deserialization.h.

Constructor & Destructor Documentation

libMesh::RBDataDeserialization::TransientRBEvaluationDeserialization::TransientRBEvaluationDeserialization ( TransientRBEvaluation trans_rb_eval)

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

Definition at line 110 of file rb_data_deserialization.C.

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

110  :
111  _trans_rb_eval(trans_rb_eval)
112 {}
TransientRBEvaluation & _trans_rb_eval
The TransientRBEvaluation object that we will read into.
libMesh::RBDataDeserialization::TransientRBEvaluationDeserialization::~TransientRBEvaluationDeserialization ( )
virtual

Destructor.

Definition at line 114 of file rb_data_deserialization.C.

115 {}

Member Function Documentation

void libMesh::RBDataDeserialization::TransientRBEvaluationDeserialization::read_from_file ( const std::string &  path,
bool  read_error_bound_data 
)

Write the Cap'n'Proto buffer to disk.

Definition at line 117 of file rb_data_deserialization.C.

References _trans_rb_eval, libMesh::RBDataDeserialization::load_transient_rb_evaluation_data(), std::max(), and libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization::RBEIMEvaluationDeserialization().

Referenced by main().

119 {
120  LOG_SCOPE("read_from_file()", "TransientRBEvaluationDeserialization");
121 
122  int fd = open(path.c_str(), O_RDONLY);
123  if (!fd)
124  libmesh_error_msg("Couldn't open the buffer file: " + path);
125 
126  // Turn off the limit to the amount of data we can read in
127  capnp::ReaderOptions reader_options;
128  reader_options.traversalLimitInWords = std::numeric_limits<uint64_t>::max();
129 
130  capnp::StreamFdMessageReader message(fd, reader_options);
131 
132 #ifndef LIBMESH_USE_COMPLEX_NUMBERS
133  RBData::TransientRBEvaluationReal::Reader trans_rb_eval_reader =
134  message.getRoot<RBData::TransientRBEvaluationReal>();
135  RBData::RBEvaluationReal::Reader rb_eval_reader =
136  trans_rb_eval_reader.getRbEvaluation();
137 #else
138  RBData::TransientRBEvaluationComplex::Reader trans_rb_eval_reader =
139  message.getRoot<RBData::TransientRBEvaluationComplex>();
140  RBData::RBEvaluationComplex::Reader rb_eval_reader =
141  trans_rb_eval_reader.getRbEvaluation();
142 #endif
143 
145  rb_eval_reader,
146  trans_rb_eval_reader,
147  read_error_bound_data);
148 }
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.
long double max(long double a, double b)
TransientRBEvaluation & _trans_rb_eval
The TransientRBEvaluation object that we will read into.

Member Data Documentation

TransientRBEvaluation& libMesh::RBDataDeserialization::TransientRBEvaluationDeserialization::_trans_rb_eval
private

The TransientRBEvaluation object that we will read into.

Definition at line 113 of file rb_data_deserialization.h.

Referenced by read_from_file().


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