processorRunTimes.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::processorRunTimes
26 
27 Description
28 
29 SourceFiles
30  processorRunTimes.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef processorRunTimes_H
35 #define processorRunTimes_H
36 
37 #include "Time.H"
38 #include "PtrList.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class processorRunTimes Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 {
51  // Private Data
52 
53  //- The complete run time
54  Time completeRunTime_;
55 
56  //- Processor run times
57  PtrList<Time> procRunTimes_;
58 
59 
60 public:
61 
62  // Constructors
63 
64  //- Construct from directory and arguments
65  processorRunTimes(const word& name, const argList& args);
66 
67 
68  //- Destructor
70 
71 
72  // Member Functions
73 
74  //- Access the complete run time
75  inline const Time& completeTime() const
76  {
77  return completeRunTime_;
78  }
79 
80  //- Access the processor run times
81  inline const PtrList<Time>& procTimes() const
82  {
83  return procRunTimes_;
84  }
85 
86  //- Return the number of processors
87  inline label nProcs() const
88  {
89  return procRunTimes_.size();
90  }
91 
92  //- Set the time
93  void setTime(const instant& inst, const label newIndex);
94 
95  //- Select the time
97 
98  //- Select the time
100 };
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 } // End namespace Foam
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 #endif
110 
111 // ************************************************************************* //
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
label size() const
Return the number of elements in the UPtrList.
Definition: UPtrListI.H:29
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:103
An instant of time. Contains the time value and name.
Definition: instant.H:67
instantList selectComplete(const argList &args)
Select the time.
instantList selectProc(const argList &args)
Select the time.
label nProcs() const
Return the number of processors.
const PtrList< Time > & procTimes() const
Access the processor run times.
void setTime(const instant &inst, const label newIndex)
Set the time.
processorRunTimes(const word &name, const argList &args)
Construct from directory and arguments.
const Time & completeTime() const
Access the complete run time.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::argList args(argc, argv)