processorField.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) 2011-2021 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::functionObjects::processorField
26 
27 Description
28  Writes a scalar field whose value is the local processor ID. The output
29  field name is 'processorID'.
30 
31  Example of function object specification:
32  \verbatim
33  processorField1
34  {
35  type processorField;
36  libs ("libfieldFunctionObjects.so");
37  ...
38  }
39  \endverbatim
40 
41 Usage
42  \table
43  Property | Description | Required | Default value
44  type | type name: processorField | yes |
45  \endtable
46 
47 See also
48  Foam::functionObjects::fvMeshFunctionObject
49 
50 SourceFiles
51  processorField.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef functionObjects_processorField_H
56 #define functionObjects_processorField_H
57 
58 #include "fvMeshFunctionObject.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 namespace functionObjects
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class processorField Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 class processorField
72 :
73  public fvMeshFunctionObject
74 {
75 public:
76 
77  //- Runtime type information
78  TypeName("processorField");
79 
80 
81  // Constructors
82 
83  //- Construct from Time and dictionary
85  (
86  const word& name,
87  const Time& runTime,
88  const dictionary& dict
89  );
90 
91  //- Disallow default bitwise copy construction
92  processorField(const processorField&) = delete;
93 
94 
95  //- Destructor
96  virtual ~processorField();
97 
98 
99  // Member Functions
100 
101  //- Read the input data
102  virtual bool read(const dictionary&);
103 
104  //- Return the list of fields required
105  virtual wordList fields() const
106  {
107  return wordList::null();
108  }
109 
110  //- Calculate the processorID field
111  virtual bool execute();
112 
113  //- Write the processorID field
114  virtual bool write();
115 
116 
117  // Member Operators
118 
119  //- Disallow default bitwise assignment
120  void operator=(const processorField&) = delete;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace functionObjects
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
static const List< word > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Writes a scalar field whose value is the local processor ID. The output field name is 'processorID'.
processorField(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual wordList fields() const
Return the list of fields required.
void operator=(const processorField &)=delete
Disallow default bitwise assignment.
virtual bool execute()
Calculate the processorID field.
virtual bool write()
Write the processorID field.
TypeName("processorField")
Runtime type information.
virtual bool read(const dictionary &)
Read the input data.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict