ReFRACtor
output_hdf_iteration.h
Go to the documentation of this file.
1 #ifndef OUTPUT_HDF_ITERATION_H
2 #define OUTPUT_HDF_ITERATION_H
3 #include "output.h"
4 #include "hdf_file_generating.h"
5 #include "connor_solver.h"
6 
7 namespace FullPhysics {
8 // Helper class for OutputHdfIteration
9 // Don't have Doxygen document this class
11 class OutputHdfIterationHelperBase {
12 public:
13  virtual ~OutputHdfIterationHelperBase() {}
14  virtual void write() = 0;
15 };
16 
18 
19 /****************************************************************/
28 class OutputHdfIteration : public OutputTemplate<OutputHdfIteration>,
29  public Observer<ConnorSolver> {
30 public:
32  const std::string& Iteration_group = "Iteration")
33  :h(H), iteration_group(Iteration_group) {}
34  virtual ~OutputHdfIteration() { close(); }
35  void close();
36  virtual void print(std::ostream& Os) const {Os << "OutputHdfIteration";}
37  virtual void notify_update(const ConnorSolver& Solver)
38  { write(); }
39 protected:
40  virtual void end_because_of_error() { h->abandon(); }
41  template<class T> void write_data_t(const std::string& Dataset_name,
42  T Val);
43  template<class T, int D> void write_data_t(const std::string& Dataset_name,
44  const blitz::Array<T, D>& Val);
46 private:
48  std::map<std::string, boost::shared_ptr<OutputHdfIterationHelperBase> >
49  data;
50  std::string iteration_group;
51 };
52 }
53 #endif
virtual void notify_update(const ConnorSolver &Solver)
Called when the Observed object is updated.
OutputHdfIteration(const boost::shared_ptr< HdfFileGenerating > &H, const std::string &Iteration_group="Iteration")
This write the output of the Level 2 Full physics.
Most of the time the write_data needed by Output is best done through a template. ...
Definition: output.h:276
virtual void end_because_of_error()
Notify when an error occurred.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual void print(std::ostream &Os) const
Simple Mixin to be and Observer of another object of class T.
Definition: observer.h:29

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10