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-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::functionObjects::processorField
29
30Group
31 grpFieldFunctionObjects
32
33Description
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
45Usage
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
74See also
75 - Foam::functionObject
76 - Foam::functionObjects::fvMeshFunctionObject
77 - ExtendedCodeGuide::functionObjects::field::processorField
78
79SourceFiles
80 processorField.C
81
82\*---------------------------------------------------------------------------*/
83
84#ifndef functionObjects_processorField_H
85#define functionObjects_processorField_H
86
88
89// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90
91namespace Foam
92{
93namespace functionObjects
94{
95
96/*---------------------------------------------------------------------------*\
97 Class processorField Declaration
98\*---------------------------------------------------------------------------*/
99
100class processorField
101:
102 public fvMeshFunctionObject
103{
104public:
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 //- Update for changes of mesh
143 // The base implementation is a no-op.
144 virtual void updateMesh(const mapPolyMesh& mpm);
145};
146
147
148// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149
150} // End namespace functionObjects
151} // End namespace Foam
152
153// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155#endif
156
157// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const word & name() const noexcept
Return the name of this functionObject.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Writes a scalar field whose value is the local processor ID. The output field name is processorID.
virtual ~processorField()=default
Destructor.
processorField(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
void operator=(const processorField &)=delete
No copy assignment.
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
virtual bool execute()
Calculate the processorID field.
virtual bool write()
Write the processorID field.
processorField(const processorField &)=delete
No copy construct.
TypeName("processorField")
Runtime type information.
virtual bool read(const dictionary &)
Read the input data.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73