readControlDict.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 #ifndef __readControlDict_hpp__
22 #define __readControlDict_hpp__
23 
24 #include "fileSystem.hpp"
25 
26 
27 namespace pFlow
28 {
29 
30 class
32 {
33 protected:
34 
36 
38 
40 
42 
44 
46 
48 
49  inline static fileSystem defaultRootPath = CWD();
50  inline static fileSystem defaultCDPath = CWD()/"system"+"controlDict";
51 
52  word convertTimeToName(const real t, const int32 precision)const;
53 
54  bool read();
55 
56 public:
57 
59  const fileSystem& rootPath = defaultRootPath,
60  const fileSystem& cdPath = defaultCDPath);
61 
62  auto startTime()const
63  {
64  return startTime_;
65  }
66 
67  auto endTime()const
68  {
69  return endTime_;
70  }
71 
72  auto saveInterval()const
73  {
74  return saveInterval_;
75  }
76 
77  auto startTimeName()const
78  {
79  return convertTimeToName(startTime_, precision_);
80  }
81 
82 };
83 
84 }
85 
86 #endif //__readControlDict_hpp__
87 
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::readControlDict::startTime_
real startTime_
Definition: readControlDict.hpp:39
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
fileSystem.hpp
pFlow
Definition: demComponent.hpp:28
pFlow::fileSystem
Definition: fileSystem.hpp:63
pFlow::int32
int int32
Definition: builtinTypes.hpp:53
pFlow::readControlDict::startTime
auto startTime() const
Definition: readControlDict.hpp:62
pFlow::readControlDict::startTimeName
auto startTimeName() const
Definition: readControlDict.hpp:77
pFlow::readControlDict::saveInterval_
real saveInterval_
Definition: readControlDict.hpp:43
pFlow::readControlDict::saveInterval
auto saveInterval() const
Definition: readControlDict.hpp:72
pFlow::readControlDict::endTime
auto endTime() const
Definition: readControlDict.hpp:67
pFlow::readControlDict::formatType_
word formatType_
Definition: readControlDict.hpp:45
pFlow::readControlDict
Definition: readControlDict.hpp:30
pFlow::CWD
fileSystem CWD()
Definition: fileSystem.hpp:186
pFlow::readControlDict::cdPath_
fileSystem cdPath_
Definition: readControlDict.hpp:37
pFlow::readControlDict::precision_
int32 precision_
Definition: readControlDict.hpp:47
pFlow::readControlDict::endTime_
real endTime_
Definition: readControlDict.hpp:41
pFlow::readControlDict::rootPath_
fileSystem rootPath_
Definition: readControlDict.hpp:35