fieldsExpressionTemplates.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) 2016 OpenFOAM Foundation
9 Copyright (C) 2016-2019 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
27\*---------------------------------------------------------------------------*/
28
29#include "volFields.H"
30#include "surfaceFields.H"
31#include "polySurfaceFields.H"
32
33// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
34
35template<class Type, class FOType>
37{
41
42 if (foundObject<VolFieldType>(fieldNames_[0]))
43 {
44 return store
45 (
47 fo.template calcFieldType<VolFieldType>()
48 );
49 }
50 else if (foundObject<SurfaceFieldType>(fieldNames_[0]))
51 {
52 return store
53 (
55 fo.template calcFieldType<SurfaceFieldType>()
56 );
57 }
58 else if (foundObject<SurfFieldType>(fieldNames_[0]))
59 {
60 return store
61 (
63 fo.template calcFieldType<SurfFieldType>()
64 );
65 }
66
67 return false;
68}
69
70
71template<class Type, class FOType>
73{
74 return calcFieldTypes<Type>(fo);
75}
76
77
78template<class FOType>
80{
81 bool processed = false;
82
83 processed = processed || fo.template calcType<scalar>(fo);
84 processed = processed || fo.template calcType<vector>(fo);
85 processed = processed || fo.template calcType<sphericalTensor>(fo);
86 processed = processed || fo.template calcType<symmTensor>(fo);
87 processed = processed || fo.template calcType<tensor>(fo);
88
89 return processed;
90}
91
92
93// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
wordList fieldNames_
Names of fields to process.
word resultName_
Name of result fields.
bool calcType(FOType &fo)
Call 'calcFieldTypes' for the given 'Type' and functionObject.
bool calcAllTypes(FOType &fo)
Call 'calcType' for the given functionObject.
bool calcFieldTypes(FOType &fo)
Call 'calcFieldType' for the given functionObject.
bool store(word &fieldName, const tmp< ObjectType > &tfield, bool cacheable=false)
Store the field in the (sub) objectRegistry under the given name.
Fields (face and point) for polySurface.
Foam::surfaceFields.