surfaceInterpolate.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) 2016-2020 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::surfaceInterpolate
29
30Group
31 grpFieldFunctionObjects
32
33Description
34 Linearly interpolates volume fields to generate surface fields.
35
36 Operands:
37 \table
38 Operand | Type | Location
39 input | vol<Type>Field | $FOAM_CASE/<time>/<inpField>
40 output file | - | -
41 output field | surface<Type>Field | $FOAM_CASE/<time>/<outField>
42 \endtable
43
44 where \c <Type>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor.
45
46Usage
47 Minimal example by using \c system/controlDict.functions:
48 \verbatim
49 surfaceInterpolate1
50 {
51 // Mandatory entries (unmodifiable)
52 type surfaceInterpolate;
53 libs (fieldFunctionObjects);
54
55 // Mandatory entries (runtime modifiable)
56 fields ((<inpField1> <outField1>) ... (<inpFieldN> <outFieldN>));
57
58 // Optional (inherited) entries
59 ...
60 }
61 \endverbatim
62
63 where the entries mean:
64 \table
65 Property | Description | Type | Req'd | Dflt
66 type | Type name: surfaceInterpolate | word | yes | -
67 libs | Library name: fieldFunctionObjects | word | yes | -
68 fields | Names of operand and output fields | wordList | yes | -
69 \endtable
70
71 The inherited entries are elaborated in:
72 - \link functionObject.H \endlink
73
74 Usage by the \c postProcess utility is not available.
75
76See also
77 - Foam::functionObject
78 - Foam::functionObjects::fvMeshFunctionObject
79 - ExtendedCodeGuide::functionObjects::field::surfaceInterpolate
80
81SourceFiles
82 surfaceInterpolate.C
83 surfaceInterpolateTemplates.C
84
85\*---------------------------------------------------------------------------*/
86
87#ifndef functionObjects_surfaceInterpolate_H
88#define functionObjects_surfaceInterpolate_H
89
91#include "surfaceFieldsFwd.H"
92#include "Tuple2.H"
93
94// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95
96namespace Foam
97{
98
99// Forward declaration of classes
100class objectRegistry;
101class dictionary;
102class mapPolyMesh;
103
104namespace functionObjects
105{
106
107/*---------------------------------------------------------------------------*\
108 Class surfaceInterpolate Declaration
109\*---------------------------------------------------------------------------*/
110
111class surfaceInterpolate
112:
113 public fvMeshFunctionObject
114{
115protected:
116
117 // Protected Data
118
119 //- Fields to process
120 List<Tuple2<word, word>> fieldSet_;
121
122
123 // Protected Member Functions
124
125 //- Linearly interpolate volume fields to generate surface fields
126 template<class Type>
127 void interpolateFields();
128
129
130public:
131
132 //- Runtime type information
133 TypeName("surfaceInterpolate");
134
135
136 // Constructors
137
138 //- Construct for given objectRegistry and dictionary.
139 // Allow the possibility to load fields from files
141 (
142 const word& name,
143 const Time& runTime,
144 const dictionary& dict
145 );
146
147 //- No copy construct
148 surfaceInterpolate(const surfaceInterpolate&) = delete;
149
150 //- No copy assignment
151 void operator=(const surfaceInterpolate&) = delete;
152
153
154 //- Destructor
155 virtual ~surfaceInterpolate() = default;
156
157
158 // Member Functions
160 //- Read the controls
161 virtual bool read(const dictionary&);
162
163 //- Calculate the interpolated fields
164 virtual bool execute();
165
166 //- Write the interpolated fields
167 virtual bool write();
168};
169
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173} // End namespace functionObjects
174} // End namespace Foam
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178#ifdef NoRepository
180#endif
181
182// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183
184#endif
185
186// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
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...
Linearly interpolates volume fields to generate surface fields.
void interpolateFields()
Linearly interpolate volume fields to generate surface fields.
surfaceInterpolate(const surfaceInterpolate &)=delete
No copy construct.
TypeName("surfaceInterpolate")
Runtime type information.
void operator=(const surfaceInterpolate &)=delete
No copy assignment.
List< Tuple2< word, word > > fieldSet_
Fields to process.
surfaceInterpolate(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
virtual ~surfaceInterpolate()=default
Destructor.
virtual bool execute()
Calculate the interpolated fields.
virtual bool write()
Write the interpolated fields.
virtual bool read(const dictionary &)
Read the controls.
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