processorField.H
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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::processorField
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Writes a scalar field whose value is the local processor ID. The output
35  field name is \c processorID.
36 
37  Operands:
38  \table
39  Operand | Type | Location
40  input | volScalarField | $FOAM_CASE/<time>/<inpField>
41  output file | - | -
42  output field | volScalarField | $FOAM_CASE/<time>/<outField>
43  \endtable
44 
45 Usage
46  Minimal example by using \c system/controlDict.functions:
47  \verbatim
48  processorField1
49  {
50  // Mandatory entries (unmodifiable)
51  type processorField;
52  libs (fieldFunctionObjects);
53 
54  // Optional (inherited) entries
55  ...
56  }
57  \endverbatim
58 
59  where the entries mean:
60  \table
61  Property | Description | Type | Req'd | Dflt
62  type | Type name: processorField | word | yes | -
63  libs | Library name: fieldFunctionObjects | word | yes | -
64  \endtable
65 
66  The inherited entries are elaborated in:
67  - \link functionObject.H \endlink
68 
69  Minimal example by using the \c postProcess utility:
70  \verbatim
71  postProcess -func processorField
72  \endverbatim
73 
74 See also
75  - Foam::functionObject
76  - Foam::functionObjects::fvMeshFunctionObject
77  - ExtendedCodeGuide::functionObjects::field::processorField
78 
79 SourceFiles
80  processorField.C
81 
82 \*---------------------------------------------------------------------------*/
83 
84 #ifndef functionObjects_processorField_H
85 #define functionObjects_processorField_H
86 
87 #include "fvMeshFunctionObject.H"
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 namespace functionObjects
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class processorField Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 class processorField
101 :
102  public fvMeshFunctionObject
103 {
104 public:
105 
106  //- Runtime type information
107  TypeName("processorField");
108 
109 
110  // Constructors
111 
112  //- Construct from Time and dictionary
114  (
115  const word& name,
116  const Time& runTime,
117  const dictionary& dict
118  );
119 
120  //- No copy construct
121  processorField(const processorField&) = delete;
122 
123  //- No copy assignment
124  void operator=(const processorField&) = delete;
125 
126 
127  //- Destructor
128  virtual ~processorField() = default;
129 
130 
131  // Member Functions
132 
133  //- Read the input data
134  virtual bool read(const dictionary&);
135 
136  //- Calculate the processorID field
137  virtual bool execute();
138 
139  //- Write the processorID field
140  virtual bool write();
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace functionObjects
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::functionObjects::processorField
Writes a scalar field whose value is the local processor ID. The output field name is processorID.
Definition: processorField.H:133
fvMeshFunctionObject.H
Foam::functionObjects::processorField::processorField
processorField(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: processorField.C:48
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
Foam::functionObjects::processorField::execute
virtual bool execute()
Calculate the processorID field.
Definition: processorField.C:89
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::functionObjects::processorField::read
virtual bool read(const dictionary &)
Read the input data.
Definition: processorField.C:81
Foam::functionObjects::processorField::TypeName
TypeName("processorField")
Runtime type information.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::processorField::write
virtual bool write()
Write the processorID field.
Definition: processorField.C:101
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::processorField::operator=
void operator=(const processorField &)=delete
No copy assignment.
Foam::functionObjects::processorField::~processorField
virtual ~processorField()=default
Destructor.