makePatchFunction1s.C
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) 2018-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 \*---------------------------------------------------------------------------*/
27 
28 #include "PatchFunction1.H"
29 #include "fieldTypes.H"
30 #include "ConstantField.H"
31 #include "UniformValueField.H"
32 #include "FunctionObjectValue.H"
33 #include "NoneFunction1.H"
34 #include "MappedFile.H"
35 #include "Table.H"
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #define makePatchFunction1s(Type) \
41  makePatchFunction1(Type); \
42  makePatchFunction1Type(ConstantField, Type); \
43  makePatchFunction1Type(MappedFile, Type); \
44  makePatchFunction1Type(UniformValueField, Type);
45 
46 namespace Foam
47 {
48  makePatchFunction1(label);
49  makePatchFunction1Type(ConstantField, label);
50 
51  makePatchFunction1s(scalar);
56 
57 
58  //- Option1 : add UniformFieldValue under the same name as Function1
59  // See makeFunction1s.C. Note that we do not need
60  // Constant & Uniform
61 
68 
69  addUniformValueFieldFunction1s(zero, scalar);
74 
75  addUniformValueFieldFunction1s(one, scalar);
80 
81  addUniformValueFieldFunction1s(polynomial, scalar);
86 
87  addUniformValueFieldFunction1s(cosine, scalar);
92 
93  addUniformValueFieldFunction1s(sine, scalar);
98 
99  addUniformValueFieldFunction1s(square, scalar);
104 
105  addUniformValueFieldFunction1s(csvFile, scalar);
110 
111  addUniformValueFieldFunction1s(table, scalar);
116 
117  addUniformValueFieldFunction1s(tableFile, scalar);
122 
123  addUniformValueFieldFunction1s(scale, scalar);
128 
129  addUniformValueFieldFunction1s(functionObjectValue, scalar);
130  addUniformValueFieldFunction1s(functionObjectValue, vector);
131  addUniformValueFieldFunction1s(functionObjectValue, sphericalTensor);
132  addUniformValueFieldFunction1s(functionObjectValue, symmTensor);
133  addUniformValueFieldFunction1s(functionObjectValue, tensor);
134 
135 
139  //template<class Type>
140  //struct addToUniform
141  //{
142  // addToUniform()
143  // {
144  // // Get the Function1 table
145  // Function1<Type>::constructdictionaryConstructorTables();
146  // const auto& F1Table =
147  // *Function1<Type>::dictionaryConstructorTablePtr_;
148  //
149  // // Get the PatchFunction1 table
150  // PatchFunction1<Type>::constructdictionaryConstructorTables();
151  // auto& PF1Table =
152  // *PatchFunction1<Type>::dictionaryConstructorTablePtr_;
153  //
154  // // Get the UniformValueField constructor
155  // auto ctorIter = PF1Table.cfind
156  // (
157  // PatchFunction1Types::UniformValueField<Type>::typeName
158  // );
159  //
160  // // Add the UniformValueField under the Function1 name
161  // forAllConstIters(F1Table, iter)
162  // {
163  // PF1Table.insert(iter.key(), ctorIter.val());
164  // }
165  // }
166  //};
167  //static const addToUniform<scalar> addScalar;
168  //static const addToUniform<vector> addVector;
169  //static const addToUniform<sphericalTensor> addSphericalTensor;
170  //static const addToUniform<symmTensor> addSymmTensor;
171  //static const addToUniform<tensor> addTensor;
172 }
173 
174 
175 // ************************************************************************* //
Table.H
Foam::sphericalTensor
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
Definition: sphericalTensor.H:54
ConstantField.H
UniformValueField.H
PatchFunction1.H
Foam::makePatchFunction1Type
makePatchFunction1Type(PatchExprField, scalar)
NoneFunction1.H
Foam::makePatchFunction1
makePatchFunction1(label)
Foam::symmTensor
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition: symmTensor.H:59
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
makePatchFunction1s
#define makePatchFunction1s(Type)
Definition: makePatchFunction1s.C:40
Foam::addUniformValueFieldFunction1s
addUniformValueFieldFunction1s(zero, scalar)
Option1 : add UniformFieldValue under the same name as Function1.
FunctionObjectValue.H
MappedFile.H
fieldTypes.H
Header files for all the primitive types that Fields are instantiated for.
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61