multiRegion.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) 2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::functionObjects::multiRegion
28 
29 Group
30  grpUtilitiesFunctionObjects
31 
32 Description
33  Wrapper that clones the supplied function object for each region.
34 
35  Simplifies the setup of identical post-processing requirements for
36  multi-region cases.
37  Applies the supplied function to all regions by default.
38 
39 Usage
40  Minimal example by using \c system/controlDict.functions:
41  \verbatim
42  multiRegion
43  {
44  // Mandatory entries
45  type multiRegion;
46  libs (utilityFunctionObjects);
47 
48  function
49  {
50  // Actual object specification
51  type fieldMinMax;
52  libs (fieldFunctionObjects);
53  fields (<field1> ... <fieldN>);
54  }
55 
56  // Optional entries
57  regions (region1 region2);
58  }
59  \endverbatim
60 
61  where the entries mean:
62  \table
63  Property | Description | Type | Reqd | Deflt
64  type | Type name: multiRegion | word | yes | -
65  libs | Library name: utilityFunctionObjects | word | yes | -
66  function | Function object sub-dictionary | dict | yes | -
67  regions | List of region names | wordList | no | all
68  \endtable
69 
70 See also
71  - Foam::functionObject
72 
73 SourceFiles
74  multiRegion.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef functionObjects_multiRegion_H
79 #define functionObjects_multiRegion_H
80 
81 #include "timeFunctionObject.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 namespace functionObjects
88 {
89 
90 /*---------------------------------------------------------------------------*\
91  Class multiRegion Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 class multiRegion
95 :
96  public functionObjects::timeFunctionObject
97 {
98 protected:
99 
100  // Protected Data
101 
102  //- List of cloned objects (1 per region)
103  PtrList<functionObject> functions_;
104 
105 
106  // Protected Member Functions
107 
108  //- No copy construct
109  multiRegion(const multiRegion&) = delete;
110 
111  //- No copy assignment
112  void operator=(const multiRegion&) = delete;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("multiRegion");
119 
120 
121  // Constructors
122 
123  //- Construct from Time and dictionary
125  (
126  const word& name,
127  const Time& runTime,
128  const dictionary& dict
129  );
130 
131 
132  //- Destructor
133  virtual ~multiRegion() = default;
134 
135 
136  // Member Functions
137 
138  //- Read the controls
139  virtual bool read(const dictionary& dict);
140 
141  //- Execute, currently does nothing
142  virtual bool execute();
143 
144  //- Write the multiRegion
145  virtual bool write();
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace functionObjects
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
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::timeFunctionObject
Virtual base class for function objects with a reference to Time.
Definition: timeFunctionObject.H:56
Foam::functionObjects::multiRegion::functions_
PtrList< functionObject > functions_
List of cloned objects (1 per region)
Definition: multiRegion.H:132
Foam::functionObjects::multiRegion::~multiRegion
virtual ~multiRegion()=default
Destructor.
timeFunctionObject.H
Foam::functionObjects::multiRegion::read
virtual bool read(const dictionary &dict)
Read the controls.
Definition: multiRegion.C:68
Foam::functionObjects::multiRegion::multiRegion
multiRegion(const multiRegion &)=delete
No copy construct.
Foam::functionObjects::multiRegion
Wrapper that clones the supplied function object for each region.
Definition: multiRegion.H:123
Foam::PtrList< functionObject >
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::multiRegion::TypeName
TypeName("multiRegion")
Runtime type information.
Foam::functionObjects::multiRegion::operator=
void operator=(const multiRegion &)=delete
No copy assignment.
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::multiRegion::write
virtual bool write()
Write the multiRegion.
Definition: multiRegion.C:156
Foam::functionObjects::multiRegion::execute
virtual bool execute()
Execute, currently does nothing.
Definition: multiRegion.C:143