Time.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 
22 #ifndef __Time_hpp__
23 #define __Time_hpp__
24 
25 
26 #include "types.hpp"
27 #include "error.hpp"
28 
29 #include "timeControl.hpp"
30 #include "repository.hpp"
31 
32 
33 
34 namespace pFlow
35 {
36 
37 class dictionary;
38 
39 class Time
40 :
41  public repository,
42  public timeControl
43 {
44 
45 protected:
46 
47  bool outFormatBinary_ = false;
48 
49  // - geometry folder/repository
51 
52  // - integration folder/repository
54 
55 
56  bool readDictionary(const dictionary& dict);
57 
58 public:
59 
60  // Constructor with owner and settings dict
61  Time( repository* owner, const dictionary& setiingsDict);
62 
63  Time(
64  repository* owner,
65  dictionary& setiingsDict,
66  real startTime,
67  real endTime,
68  real saveInterval,
69  word startTimeName);
70 
71 
73  virtual fileSystem localPath()const
74  {
75  return timeName();
76  }
77 
78  // - geometry repository
79  const repository& geometry()const
80  {
81  return geometry_;
82  }
83 
85  {
86  return geometry_;
87  }
88 
89  const repository& integration()const
90  {
91  return integration_;
92  }
93 
95  {
96  return integration_;
97  }
98 
100  bool outFileBinary()const override
101  {
102  return outFormatBinary_;
103  }
104 
105  // override the base write to manage write operation
106  // based on the valid write time intervals
107  virtual bool write(bool verbose = false) const;
108 
109 };
110 
111 } // pFlow
112 
113 #endif // __Time_hpp__
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::Time::localPath
virtual fileSystem localPath() const
Definition: Time.hpp:73
types.hpp
pFlow::Time::outFormatBinary_
bool outFormatBinary_
Definition: Time.hpp:47
pFlow::repository::owner
const repository * owner() const
Definition: repository.cpp:73
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::Time::outFileBinary
bool outFileBinary() const override
Write to the file with binary format?
Definition: Time.hpp:100
pFlow::Time::geometry
const repository & geometry() const
Definition: Time.hpp:79
pFlow::Time::integration
repository & integration()
Definition: Time.hpp:94
pFlow::Time::integration
const repository & integration() const
Definition: Time.hpp:89
pFlow::Time::geometry
repository & geometry()
Definition: Time.hpp:84
pFlow
Definition: demComponent.hpp:28
pFlow::Time::write
virtual bool write(bool verbose=false) const
Definition: Time.cpp:108
pFlow::fileSystem
Definition: fileSystem.hpp:63
repository.hpp
pFlow::timeControl::timeName
word timeName() const
Definition: timeControl.cpp:120
timeControl.hpp
pFlow::timeControl
Definition: timeControl.hpp:37
pFlow::Time::integration_
repository integration_
Definition: Time.hpp:53
pFlow::Time::Time
Time(repository *owner, const dictionary &setiingsDict)
Definition: Time.cpp:46
pFlow::Time::readDictionary
bool readDictionary(const dictionary &dict)
Definition: Time.cpp:27
pFlow::Time::geometry_
repository geometry_
Definition: Time.hpp:50
pFlow::timeControl::startTime
real startTime() const
Definition: timeControl.hpp:128
pFlow::repository
Definition: repository.hpp:34
pFlow::dictionary
Definition: dictionary.hpp:38
error.hpp
pFlow::Time
Definition: Time.hpp:39