makeFunction1s.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "Constant.H"
27 #include "Uniform.H"
28 #include "ZeroConstant.H"
29 #include "OneConstant.H"
30 #include "PolynomialEntry.H"
31 #include "Sine.H"
32 #include "Square.H"
33 #include "CSV.H"
34 #include "Table.H"
35 #include "TableFile.H"
36 #include "Scale.H"
37 
38 #include "fieldTypes.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 #define makeFunction1s(Type) \
43  makeFunction1(Type); \
44  makeFunction1Type(Constant, Type); \
45  makeFunction1Type(Uniform, Type); \
46  makeFunction1Type(ZeroConstant, Type); \
47  makeFunction1Type(OneConstant, Type); \
48  makeFunction1Type(Polynomial, Type); \
49  makeFunction1Type(Sine, Type); \
50  makeFunction1Type(Square, Type); \
51  makeFunction1Type(CSV, Type); \
52  makeFunction1Type(Table, Type); \
53  makeFunction1Type(TableFile, Type); \
54  makeFunction1Type(Scale, Type);
55 
56 namespace Foam
57 {
59  makeFunction1Type(Constant, label);
60 
61  makeFunction1s(scalar);
66 }
67 
68 
69 template<>
72 (
73  const scalarField& x1,
74  const scalarField& x2
75 ) const
76 {
78  << "Evaluation is not defined for " << type() << " functions"
79  << exit(FatalError);
80 
81  return tmp<Field<label>>(new Field<label>(x1.size()));
82 }
83 
84 
85 // ************************************************************************* //
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:59
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:163
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two values.
Definition: ConstantI.H:39
#define makeFunction1s(Type)
Include the header files for all the primitive types that Fields are instantiated for...
makeFunction1Type(Constant, label)
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
Definition: symmTensor.H:48
makeFunction1(label)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars.
A class for managing temporary objects.
Definition: PtrList.H:53
Tensor< scalar > tensor
Tensor of scalars.
Definition: tensor.H:51
Namespace for OpenFOAM.