www.cemf.ir
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 #ifndef __Time_hpp__
22 #define __Time_hpp__
23 
24 #include "error.hpp"
25 #include "types.hpp"
26 
27 #include "fileSystem.hpp"
28 #include "repository.hpp"
29 #include "timeControl.hpp"
30 
31 
32 namespace pFlow
33 {
34 
35 class dictionary;
36 
37 class Time
38  : public repository
39  , public timeControl
40 {
41 private:
42 
43  bool outFormatBinary_ = false;
44 
45  // - geometry folder/repository
47 
48  bool readDictionary(const dictionary& dict);
49 
50 public:
51 
52  // Constructor with owner and settings dict
53  Time(repository* owner, const dictionary& setiingsDict);
54 
55  Time(
57  dictionary& setiingsDict,
59  real endTime,
60  real saveInterval,
61  word startTimeName
62  );
63 
65  fileSystem localPath() const override;
66 
67  // - geometry repository
68  const repository& geometry() const
69  {
70  return geometry_;
71  }
72 
74  {
75  return geometry_;
76  }
77 
79 
81  bool outFileBinary() const override
82  {
83  return outFormatBinary_;
84  }
85 
86  // override the base write to manage write operation
87  // based on the valid write time intervals
88  virtual bool write(bool verbose = false) const;
89 };
90 
91 } // namespace pFlow
92 
93 #endif // __Time_hpp__
pFlow::real
float real
Definition: builtinTypes.hpp:45
types.hpp
pFlow::Time::outFormatBinary_
bool outFormatBinary_
Definition: Time.hpp:43
pFlow::repository::owner
const repository * owner() const
Definition: repository.cpp:82
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::Time::outFileBinary
bool outFileBinary() const override
Write to the file with binary format?
Definition: Time.hpp:81
pFlow::Time::geometry
const repository & geometry() const
Definition: Time.hpp:68
pFlow::Time::localPath
fileSystem localPath() const override
Definition: Time.cpp:74
pFlow::Time::geometry
repository & geometry()
Definition: Time.hpp:73
fileSystem.hpp
pFlow
Definition: demGeometry.hpp:27
pFlow::Time::write
virtual bool write(bool verbose=false) const
Definition: Time.cpp:86
pFlow::fileSystem
Manages file pathes, manupulate and combines them.
Definition: fileSystem.hpp:71
repository.hpp
timeControl.hpp
pFlow::timeControl
Definition: timeControl.hpp:37
pFlow::Time::Time
Time(repository *owner, const dictionary &setiingsDict)
Definition: Time.cpp:44
pFlow::Time::readDictionary
bool readDictionary(const dictionary &dict)
Definition: Time.cpp:26
pFlow::Time::geometry_
repository geometry_
Definition: Time.hpp:46
pFlow::timeControl::startTime
real startTime() const
Definition: timeControl.hpp:120
pFlow::repository
Definition: repository.hpp:34
pFlow::Time::integrationFolder
fileSystem integrationFolder() const
Definition: Time.cpp:80
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67
error.hpp
pFlow::Time
Definition: Time.hpp:37