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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::functionObjects::multiRegion
28
29Group
30 grpUtilitiesFunctionObjects
31
32Description
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
39Usage
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
70See also
71 - Foam::functionObject
72
73SourceFiles
74 multiRegion.C
75
76\*---------------------------------------------------------------------------*/
77
78#ifndef functionObjects_multiRegion_H
79#define functionObjects_multiRegion_H
80
81#include "timeFunctionObject.H"
82
83// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84
85namespace Foam
86{
87namespace functionObjects
88{
89
90/*---------------------------------------------------------------------------*\
91 Class multiRegion Declaration
92\*---------------------------------------------------------------------------*/
93
94class multiRegion
95:
96 public functionObjects::timeFunctionObject
97{
98protected:
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
115public:
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};
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151} // End namespace functionObjects
152} // End namespace Foam
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156#endif
157
158// ************************************************************************* //
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
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.
Wrapper that clones the supplied function object for each region.
Definition: multiRegion.H:126
void operator=(const multiRegion &)=delete
No copy assignment.
multiRegion(const multiRegion &)=delete
No copy construct.
PtrList< functionObject > functions_
List of cloned objects (1 per region)
Definition: multiRegion.H:132
virtual bool read(const dictionary &dict)
Read the controls.
Definition: multiRegion.C:68
virtual ~multiRegion()=default
Destructor.
virtual bool execute()
Execute, currently does nothing.
Definition: multiRegion.C:143
virtual bool write()
Write the multiRegion.
Definition: multiRegion.C:156
TypeName("multiRegion")
Runtime type information.
Virtual base class for function objects with a reference to Time.
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