NLMech  0.1.0
restartDeck.h
1 // Copyright (c) 2019 Prashant K. Jha
3 // Copyright (c) 2019 Patrick Diehl
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 
9 #ifndef INP_RESTARTDECK_H
10 #define INP_RESTARTDECK_H
11 
12 #include <string>
13 #include "util/utilIO.h"
14 
15 namespace inp {
16 
23 struct RestartDeck {
24 
26  std::string d_file;
27 
29  size_t d_step;
30 
34  RestartDeck() : d_step(0){};
35 
45  std::string printStr(int nt = 0, int lvl = 0) const {
46  auto tabS = util::io::getTabS(nt);
47  std::ostringstream oss;
48  oss << tabS << "------- RestartDeck --------" << std::endl << std::endl;
49  oss << tabS << "Restart file = " << d_file << std::endl;
50  oss << tabS << "Restart step = " << d_step << std::endl;
51  oss << tabS << std::endl;
52 
53  return oss.str();
54  };
55 
63  void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); };
64 };
65 
68 } // namespace inp
69 
70 #endif // INP_RESTARTDECK_H
Collection of methods and database related to input.
Definition: main.cpp:21
std::string getTabS(int nt)
Generate a string contaning nt tabs.
Definition: utilIO.h:26
Structure to read and store restart related data input.
Definition: restartDeck.h:23
RestartDeck()
Constructor.
Definition: restartDeck.h:34
std::string d_file
restart filename
Definition: restartDeck.h:26
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing information about the instance of the object.
Definition: restartDeck.h:45
void print(int nt=0, int lvl=0) const
Prints the information about the instance of the object.
Definition: restartDeck.h:63
size_t d_step
Restart time step.
Definition: restartDeck.h:29