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 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 "MappedFile.H"
34 #include "Table.H"
35 
36 #define makePatchFunction1s(Type) \
37  makePatchFunction1(Type); \
38  makePatchFunction1Type(ConstantField, Type); \
39  makePatchFunction1Type(MappedFile, Type); \
40  makePatchFunction1Type(UniformValueField, Type);
41 
42 #define addUniformValueFieldFunction1s(F1Type, Type) \
43  PatchFunction1<Type>::adddictionaryConstructorToTable \
44  <PatchFunction1Types::UniformValueField<Type>> \
45  add##F1Type##UniformValueField##Type##ConstructorToTable_(#F1Type);
46 
47 namespace Foam
48 {
50  makePatchFunction1Type(ConstantField, label);
51 
57 
58 
59  //- Option1 : add UniformFieldValue under the same name as Function1
60  // See makeFunction1s.C. Note that we do not need
61  // Constant & Uniform
67 
73 
74  addUniformValueFieldFunction1s(polynomial, scalar);
79 
80  addUniformValueFieldFunction1s(sine, scalar);
85 
86  addUniformValueFieldFunction1s(square, scalar);
91 
92  addUniformValueFieldFunction1s(csvFile, scalar);
97 
98  addUniformValueFieldFunction1s(table, scalar);
103 
104  addUniformValueFieldFunction1s(tableFile, scalar);
109 
110  addUniformValueFieldFunction1s(scale, scalar);
115 
116 
120  //template<class Type>
121  //class addToUniform
122  //{
123  //public:
124  // addToUniform()
125  // {
126  // // Get the Function1 table
127  // typedef typename Function1<Type>::dictionaryConstructorTable
128  // F1Type;
129  // Function1<Type>::constructdictionaryConstructorTables();
130  // const F1Type& F1Table =
131  // *Function1<Type>::dictionaryConstructorTablePtr_;
132  //
133  // // Get the PatchFunction1 table
134  // typedef typename PatchFunction1<Type>::dictionaryConstructorTable
135  // PF1Type;
136  //
137  // PatchFunction1<Type>::constructdictionaryConstructorTables();
138  // PF1Type& PF1Table =
139  // *PatchFunction1<Type>::dictionaryConstructorTablePtr_;
140  //
141  // // Get the UniformValueField constructor
142  // auto cstrIter =
143  // PatchFunction1<Type>::dictionaryConstructorTablePtr_->cfind
144  // (
145  // PatchFunction1Types::UniformValueField<Type>::typeName
146  // );
147  //
148  // // Add the UniformValueField under the Function1 name
149  // forAllConstIters(F1Table, iter)
150  // {
151  // //bool ok =
152  // PF1Table.insert(iter.key(), cstrIter());
153  // //if (!ok)
154  // //{
155  // // std::cout<< "** problem" << std::endl;
156  // //}
157  // }
158  // }
159  //};
160  //static const addToUniform<scalar> addScalar;
161  //static const addToUniform<vector> addVector;
162  //static const addToUniform<sphericalTensor> addSphericalTensor;
163  //static const addToUniform<symmTensor> addSymmTensor;
164  //static const addToUniform<tensor> addTensor;
165 }
166 
167 
168 // ************************************************************************* //
Foam::Tensor< scalar >
Table.H
Foam::SymmTensor< scalar >
ConstantField.H
UniformValueField.H
PatchFunction1.H
Foam::one
A class representing the concept of 1 (one), which can be used to avoid manipulating objects that are...
Definition: one.H:60
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::makePatchFunction1Type
makePatchFunction1Type(Sampled, scalar)
addUniformValueFieldFunction1s
#define addUniformValueFieldFunction1s(F1Type, Type)
Definition: makePatchFunction1s.C:42
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
makePatchFunction1s
#define makePatchFunction1s(Type)
Definition: makePatchFunction1s.C:36
Foam::SphericalTensor
Templated 3D SphericalTensor derived from VectorSpace adding construction from 1 component,...
Definition: SphericalTensor.H:55
Foam::Vector< scalar >
makePatchFunction1
#define makePatchFunction1(Type)
Definition: PatchFunction1.H:259
MappedFile.H
fieldTypes.H
Header files for all the primitive types that Fields are instantiated for.
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61