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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::functionObjects::surfaceInterpolate
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
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 
46 Usage
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 
76 See also
77  - Foam::functionObject
78  - Foam::functionObjects::fvMeshFunctionObject
79  - ExtendedCodeGuide::functionObjects::field::surfaceInterpolate
80 
81 SourceFiles
82  surfaceInterpolate.C
83  surfaceInterpolateTemplates.C
84 
85 \*---------------------------------------------------------------------------*/
86 
87 #ifndef functionObjects_surfaceInterpolate_H
88 #define functionObjects_surfaceInterpolate_H
89 
90 #include "fvMeshFunctionObject.H"
91 #include "surfaceFieldsFwd.H"
92 #include "Tuple2.H"
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 namespace Foam
97 {
98 
99 // Forward declaration of classes
100 class objectRegistry;
101 class dictionary;
102 class mapPolyMesh;
103 
104 namespace functionObjects
105 {
106 
107 /*---------------------------------------------------------------------------*\
108  Class surfaceInterpolate Declaration
109 \*---------------------------------------------------------------------------*/
110 
111 class surfaceInterpolate
112 :
113  public fvMeshFunctionObject
114 {
115 protected:
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 
130 public:
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
159 
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace functionObjects
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #ifdef NoRepository
180 #endif
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
surfaceInterpolateTemplates.C
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
fvMeshFunctionObject.H
Foam::functionObjects::surfaceInterpolate::fieldSet_
List< Tuple2< word, word > > fieldSet_
Fields to process.
Definition: surfaceInterpolate.H:159
Tuple2.H
Foam::functionObjects::surfaceInterpolate
Linearly interpolates volume fields to generate surface fields.
Definition: surfaceInterpolate.H:150
Foam::functionObjects::surfaceInterpolate::~surfaceInterpolate
virtual ~surfaceInterpolate()=default
Destructor.
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
Foam::functionObjects::surfaceInterpolate::write
virtual bool write()
Write the interpolated fields.
Definition: surfaceInterpolate.C:92
Foam::functionObjects::surfaceInterpolate::TypeName
TypeName("surfaceInterpolate")
Runtime type information.
Foam::functionObjects::surfaceInterpolate::surfaceInterpolate
surfaceInterpolate(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
Definition: surfaceInterpolate.C:48
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::functionObjects::surfaceInterpolate::operator=
void operator=(const surfaceInterpolate &)=delete
No copy assignment.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::surfaceInterpolate::execute
virtual bool execute()
Calculate the interpolated fields.
Definition: surfaceInterpolate.C:76
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::surfaceInterpolate::interpolateFields
void interpolateFields()
Linearly interpolate volume fields to generate surface fields.
Definition: surfaceInterpolateTemplates.C:36
Foam::functionObjects::surfaceInterpolate::read
virtual bool read(const dictionary &)
Read the controls.
Definition: surfaceInterpolate.C:64
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
surfaceFieldsFwd.H