Loading...
Searching...
No Matches
areaFields.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-2017 Wikki Ltd
9 Copyright (C) 2018-2025 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 "faMesh.H"
30#include "areaFields.H"
31#include "coupledFaPatchField.H"
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36namespace Foam
37{
52(
54 "areaScalarField::Boundary",
55 0
56);
58(
60 "areaVectorField::Boundary",
61 0
62);
64(
66 "areaSphericalTensorField::Boundary",
67 0
68);
70(
72 "areaSymmTensorField::Boundary",
73 0
74);
76(
78 "areaTensorField::Boundary",
79 0
80);
81
82} // End namespace Foam
83
84
85// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86
87// Specializations
88
89namespace Foam
90{
91
92template<>
95(
97) const
98{
99 return *this;
100}
101
102template<>
104(
105 const direction,
108{
109 *this == gsf;
110}
111
112
113#undef fieldChecks
114#define fieldChecks(Type) \
115template<> \
116bool GeometricBoundaryField<Type, faPatchField, areaMesh>::check() const \
117{ \
118 return checkConsistency<coupledFaPatchField<Type>> \
119 ( \
120 FieldBase::localBoundaryTolerance_, \
121 !(debug&4) /* make into warning if debug&4 */ \
122 ); \
123}
124
125fieldChecks(scalar);
130
131#undef fieldChecks
132
133} // End namespace Foam
134
135
136// * * * * * * * * * * * * * * * * Global Data * * * * * * * * * * * * * * * //
137
138// Note hard-coded values are more reliable than other alternatives
139
141({
142 "areaScalarField",
143 "areaVectorField",
144 "areaSphericalTensorField",
145 "areaSymmTensorField",
146 "areaTensorField"
147});
148
150({
151 "areaScalarField::Internal",
152 "areaVectorField::Internal",
153 "areaSphericalTensorField::Internal",
154 "areaSymmTensorField::Internal",
155 "areaTensorField::Internal"
156});
157
158
159// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
160
161bool Foam::fieldTypes::is_area(const word& clsName)
162{
163 return
165 clsName.starts_with("area") && clsName.ends_with("Field")
166 && Foam::fieldTypes::area.contains(clsName)
167 );
168}
169
170
171bool Foam::fieldTypes::is_area_internal(const word& clsName)
172{
173 return
174 (
175 clsName.starts_with("area") && clsName.ends_with("::Internal")
176 && Foam::fieldTypes::area_internal.contains(clsName)
177 );
178}
179
180
181// ************************************************************************* //
#define fieldChecks(Type)
Definition areaFields.C:107
Generic GeometricField class.
DimensionedField< scalar, areaMesh > Internal
void replace(const direction d, const GeometricField< cmptType, PatchField, GeoMesh > &gcf)
Replace specified field component with content from another field.
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=faPatchField< Type >::calculatedType())
GeometricBoundaryField< scalar, faPatchField, areaMesh > Boundary
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
bool ends_with(char c) const
True if string ends with given character (cf. C++20).
Definition string.H:461
bool starts_with(char c) const
True if string starts with given character (cf. C++20).
Definition string.H:436
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTemplateTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information for templates, useful.
Definition className.H:158
#define defineTemplateDebugSwitchWithName(Type, Name, Value)
Define the debug information for templates, lookup as Name.
const wordList area_internal
Standard area internal field types (scalar, vector, tensor, etc).
bool is_area(const word &clsName)
Test if the class name appears to be an area field.
Definition areaFields.C:154
bool is_area_internal(const word &clsName)
Test if the class name appears to be an area internal field.
Definition areaFields.C:164
const wordList area
Standard area field types (scalar, vector, tensor, etc).
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
GeometricField< tensor, faPatchField, areaMesh > areaTensorField
GeometricField< sphericalTensor, faPatchField, areaMesh > areaSphericalTensorField
GeometricField< symmTensor, faPatchField, areaMesh > areaSymmTensorField
Tensor< scalar > tensor
Definition symmTensor.H:57
GeometricField< vector, faPatchField, areaMesh > areaVectorField
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
uint8_t direction
Definition direction.H:49
Vector< scalar > vector
Definition vector.H:57
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition symmTensor.H:55