PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
VecBundleWriter.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 #include <memory>
6 
7 namespace pism {
8 class Grid;
9 namespace array {
10 class Array;
11 }
12 
13 namespace icebin {
14 
15 /** Sets up to easily write out a bundle of PISM variables to a file. */
17  std::shared_ptr<const pism::Grid> m_grid;
18  std::string const fname; // Name of the file to write
19  std::vector<pism::array::Array const *> vecs; // The vectors we will write
20 
21 public:
22  VecBundleWriter(std::shared_ptr<pism::Grid> grid, std::string const &_fname, std::vector<pism::array::Array const *> &_vecs);
23 
24  void init();
25 
26  /** Dump the value of the Vectors at curent PISM simulation time. */
27  void write(double time_s);
28 };
29 } // end of namespace icebin
30 } // end of namespace pism
std::shared_ptr< const pism::Grid > m_grid
VecBundleWriter(std::shared_ptr< pism::Grid > grid, std::string const &_fname, std::vector< pism::array::Array const * > &_vecs)
std::vector< pism::array::Array const * > vecs