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