NeoFOAM
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
time.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2023 NeoFOAM authors
3#pragma once
4
5#include <iostream>
6#include <string>
7
9
10const std::string NL = "\n";
11
12namespace NeoFOAM
13{
14
15using word = std::string;
16
18{
19
20public:
21
22 ArgList([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) {};
23
24 [[nodiscard]] bool checkRootCase() const { return true; };
25};
26
27class Time
28{
29public:
30
31 const static word CONTROL_DICT_NAME;
32
33 Time() : time_(0.) {};
34
35 Time(const word, const ArgList) : time_(0.) {};
36
37 [[nodiscard]] word timeName() { return std::to_string(time_); }
38
39 [[nodiscard]] bool loop()
40 {
41 time_ += 1.;
42 return 10.0 >= time_;
43 };
44
45 std::ostream& printExecutionTime(std::ostream& os) const { return os; };
46
47private:
48
49 scalar time_;
50};
51
52} // namespace NeoFOAM
bool checkRootCase() const
Definition time.hpp:24
ArgList(int argc, char *argv[])
Definition time.hpp:22
Time(const word, const ArgList)
Definition time.hpp:35
bool loop()
Definition time.hpp:39
static const word CONTROL_DICT_NAME
Definition time.hpp:31
word timeName()
Definition time.hpp:37
std::ostream & printExecutionTime(std::ostream &os) const
Definition time.hpp:45
float scalar
Definition scalar.hpp:11
std::string word
Definition time.hpp:15
const std::string NL
Definition time.hpp:10