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 | Copyright (C) 2011-2013 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::processorField
26 
27 Group
28  grpFieldFunctionObjects
29 
30 Description
31  This function object writes a scalar field whose value is the local
32  processor ID. The output field name is 'processorID'.
33 
34  Example of function object specification:
35  \verbatim
36  processorField1
37  {
38  type processorField;
39  functionObjectLibs ("libfieldFunctionObjects.so");
40  ...
41  }
42  \endverbatim
43 
44  \heading Function object usage
45  \table
46  Property | Description | Required | Default value
47  type | type name: processorField | yes |
48  log | Log to standard output | no | yes
49  \endtable
50 
51 SeeAlso
52  Foam::functionObject
53  Foam::OutputFilterFunctionObject
54 
55 SourceFiles
56  processorField.C
57  IOprocessorField.H
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef processorField_H
62 #define processorField_H
63 
64 #include "OFstream.H"
65 #include "pointFieldFwd.H"
66 #include "volFields.H"
67 #include "surfaceFields.H"
68 #include "coordinateSystem.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 // Forward declaration of classes
76 class objectRegistry;
77 class dictionary;
78 class mapPolyMesh;
79 
80 /*---------------------------------------------------------------------------*\
81  Class processorField Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class processorField
85 {
86 protected:
87 
88  // Protected data
89 
90  //- Name of this set of nearWallFields object
91  word name_;
92 
93  //- Reference to the database
94  const objectRegistry& obr_;
95 
96  //- on/off switch
97  bool active_;
98 
99  //- Result name
101 
102  //- Switch to send output to Info as well as to file
103  Switch log_;
104 
105 
106  // Protected Member Functions
107 
108  //- Disallow default bitwise copy construct
110 
111  //- Disallow default bitwise assignment
112  void operator=(const processorField&);
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("processorField");
119 
120 
121  // Constructors
122 
123  //- Construct for given objectRegistry and dictionary.
124  // Allow the possibility to load fields from files
126  (
127  const word& name,
128  const objectRegistry&,
129  const dictionary&,
130  const bool loadFromFiles = false
131  );
132 
133 
134  //- Destructor
135  virtual ~processorField();
136 
137 
138  // Member Functions
139 
140  //- Return name of the processorField object
141  virtual const word& name() const
142  {
143  return name_;
144  }
145 
146  //- Read the input data
147  virtual void read(const dictionary&);
148 
149  //- Execute, currently does nothing
150  virtual void execute();
151 
152  //- Execute at the final time-loop, currently does nothing
153  virtual void end();
154 
155  //- Called when time was set at the end of the Time::operator++
156  virtual void timeSet();
157 
158  //- Write
159  virtual void write();
160 
161  //- Update for changes of mesh
162  virtual void updateMesh(const mapPolyMesh&)
163  {}
164 
165  //- Update for changes of mesh
166  virtual void movePoints(const polyMesh&)
167  {}
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
volFields.H
Foam::processorField::~processorField
virtual ~processorField()
Destructor.
Definition: processorField.C:92
Foam::processorField::processorField
processorField(const processorField &)
Disallow default bitwise copy construct.
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::processorField::timeSet
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: processorField.C:126
Foam::processorField
This function object writes a scalar field whose value is the local processor ID. The output field na...
Definition: processorField.H:98
surfaceFields.H
Foam::surfaceFields.
coordinateSystem.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::processorField::read
virtual void read(const dictionary &)
Read the input data.
Definition: processorField.C:98
OFstream.H
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::processorField::resultName_
word resultName_
Result name.
Definition: processorField.H:114
pointFieldFwd.H
Foam::processorField::write
virtual void write()
Write.
Definition: processorField.C:132
Foam::processorField::obr_
const objectRegistry & obr_
Reference to the database.
Definition: processorField.H:108
Foam::processorField::execute
virtual void execute()
Execute, currently does nothing.
Definition: processorField.C:107
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::processorField::log_
Switch log_
Switch to send output to Info as well as to file.
Definition: processorField.H:117
Foam::processorField::active_
bool active_
on/off switch
Definition: processorField.H:111
Foam::processorField::movePoints
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: processorField.H:180
Foam::processorField::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: processorField.H:176
Foam::processorField::name_
word name_
Name of this set of nearWallFields object.
Definition: processorField.H:105
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::processorField::TypeName
TypeName("processorField")
Runtime type information.
Foam::processorField::end
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: processorField.C:120
Foam::processorField::operator=
void operator=(const processorField &)
Disallow default bitwise assignment.
Foam::processorField::name
virtual const word & name() const
Return name of the processorField object.
Definition: processorField.H:155