Loading...
Searching...
No Matches
TimeNew.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2019-2023 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "Time.H"
29#include "argList.H"
30
31// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
32
34{
36 (
37 fileName("."), // root-path
38 fileName("."), // case-name
39 false, // No enableFunctionObjects
40 false // No enableLibs
41 );
42}
43
44// FUTURE?
45// Foam::autoPtr<Foam::Time> Foam::Time::New(const Time& runTime)
46// {
47// fileName caseDir(runTime.path());
48// caseDir.toAbsolute();
49//
50// return autoPtr<Time>::New
51// (
52// caseDir.path(), // root-path
53// caseDir.name(), // case-name
54// false, // No enableFunctionObjects
55// false // No enableLibs
56// );
57// }
58
59
61{
63 (
64 caseDir.path(), // root-path
65 caseDir.name(), // case-name
66 false, // No enableFunctionObjects
67 false // No enableLibs
68 );
69}
70
71
73{
75 (
77 args,
78 false, // No enableFunctionObjects
79 false, // No enableLibs
80 IOobjectOption::MUST_READ // No re-reading
81 );
82}
83
84
86{
88 caseDir.toAbsolute();
89
91 (
92 caseDir.path(), // root-path
93 caseDir.name(), // case-name
94 false, // No enableFunctionObjects
95 false // No enableLibs
96 );
97}
98
99
101{
102 fileName caseDir(runTime.globalPath());
103 caseDir.toAbsolute();
104
105 return autoPtr<Time>::New
106 (
107 caseDir.path(), // root-path
108 caseDir.name(), // case-name
109 false, // No enableFunctionObjects
110 false // No enableLibs
111 );
112}
113
114
115// ************************************************************************* //
@ MUST_READ
Reading required.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition TimeNew.C:26
static word controlDictName
The default control dictionary name (normally "controlDict").
Definition Time.H:267
static autoPtr< Time > NewGlobalTime()
Construct (dummy) global Time - no functionObjects or libraries, using the global path information st...
Definition TimeNew.C:78
Time(const word &ctrlDictName, const argList &args, const bool enableFunctionObjects=true, const bool enableLibs=true, IOobjectOption::readOption rOpt=IOobjectOption::READ_MODIFIED)
Construct from argument list, reading from specified control dictionary name.
Definition TimeI.H:24
Extract command arguments and options from the supplied argc and argv parameters.
Definition argList.H:119
static fileName envGlobalPath()
Global case (directory) from environment variable.
Definition argList.C:668
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition autoPtr.H:178
A class for handling file names.
Definition fileName.H:75
fileName & toAbsolute()
Convert from relative to absolute.
Definition fileName.C:370
static std::string path(const std::string &str)
Return directory path name (part before last /).
Definition fileNameI.H:169
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
Definition fileNameI.H:192
engineTime & runTime
Foam::argList args(argc, argv)