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

This class de-serializes an RBEvaluation object using the Cap'n Proto library. More...

#include <rb_data_deserialization.h>

Public Member Functions

 RBEvaluationDeserialization (RBEvaluation &rb_eval)
 Initialize a new buffer using the structure from the Cap'n'Proto schema described in rb_data.capnp. More...
 
virtual ~RBEvaluationDeserialization ()
 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

RBEvaluation_rb_eval
 The RBEvaluation object that we will read into. More...
 

Detailed Description

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 55 of file rb_data_deserialization.h.

Constructor & Destructor Documentation

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 70 of file rb_data_deserialization.C.

71  :
72  _rb_eval(rb_eval)
73 {}
RBEvaluation & _rb_eval
The RBEvaluation object that we will read into.
libMesh::RBDataDeserialization::RBEvaluationDeserialization::~RBEvaluationDeserialization ( )
virtual

Destructor.

Definition at line 75 of file rb_data_deserialization.C.

76 {}

Member Function Documentation

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 78 of file rb_data_deserialization.C.

References _rb_eval, libMesh::RBDataDeserialization::load_rb_evaluation_data(), std::max(), and libMesh::RBDataDeserialization::TransientRBEvaluationDeserialization::TransientRBEvaluationDeserialization().

Referenced by main().

80 {
81  LOG_SCOPE("read_from_file()", "RBEvaluationDeserialization");
82 
83  int fd = open(path.c_str(), O_RDONLY);
84  if (!fd)
85  libmesh_error_msg("Couldn't open the buffer file: " + path);
86 
87  // Turn off the limit to the amount of data we can read in
88  capnp::ReaderOptions reader_options;
89  reader_options.traversalLimitInWords = std::numeric_limits<uint64_t>::max();
90 
91  capnp::StreamFdMessageReader message(fd, reader_options);
92 
93 #ifndef LIBMESH_USE_COMPLEX_NUMBERS
94  RBData::RBEvaluationReal::Reader rb_eval_reader =
95  message.getRoot<RBData::RBEvaluationReal>();
96 #else
97  RBData::RBEvaluationComplex::Reader rb_eval_reader =
98  message.getRoot<RBData::RBEvaluationComplex>();
99 #endif
100 
101  load_rb_evaluation_data(_rb_eval, rb_eval_reader, read_error_bound_data);
102 }
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.
long double max(long double a, double b)
RBEvaluation & _rb_eval
The RBEvaluation object that we will read into.

Member Data Documentation

RBEvaluation& libMesh::RBDataDeserialization::RBEvaluationDeserialization::_rb_eval
private

The RBEvaluation object that we will read into.

Definition at line 80 of file rb_data_deserialization.h.

Referenced by read_from_file().


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