Loading...
Searching...
No Matches
volFields.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) 2011-2016 OpenFOAM Foundation
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 "volFields.H"
30#include "coupledFvPatchField.H"
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35namespace Foam
36{
51(
53 "volScalarField::Boundary",
54 0
55);
57(
59 "volVectorField::Boundary",
60 0
61);
63(
65 "volSphericalTensorField::Boundary",
66 0
67);
69(
71 "volSymmTensorField::Boundary",
72 0
73);
75(
77 "volTensorField::Boundary",
78 0
79);
80
81} // End namespace Foam
82
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86// Specializations
87
88namespace Foam
89{
90
91template<>
94(
95 const direction
96) const
97{
98 return *this;
99}
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, fvPatchField, volMesh>::check() const \
117{ \
118 return checkConsistency<coupledFvPatchField<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 "volScalarField::Internal",
143 "volVectorField::Internal",
144 "volSphericalTensorField::Internal",
145 "volSymmTensorField::Internal",
146 "volTensorField::Internal"
147});
148
149
151({
152 "volScalarField",
153 "volVectorField",
154 "volSphericalTensorField",
155 "volSymmTensorField",
156 "volTensorField"
157});
158
159
160// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
161
162bool Foam::fieldTypes::is_internal(const word& clsName)
163{
164 return
166 clsName.starts_with("vol") && clsName.ends_with("::Internal")
167 && Foam::fieldTypes::internal.contains(clsName)
168 );
169}
170
171
172bool Foam::fieldTypes::is_volume(const word& clsName)
173{
174 return
175 (
176 clsName.starts_with("vol") && clsName.ends_with("Field")
177 && Foam::fieldTypes::volume.contains(clsName)
178 );
179}
180
181
182// ************************************************************************* //
#define fieldChecks(Type)
Definition areaFields.C:107
Generic GeometricField class.
DimensionedField< scalar, volMesh > 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, fvPatchField, volMesh > 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 volume
Standard volume field types (scalar, vector, tensor, etc).
bool is_volume(const word &clsName)
Test if the class name appears to be a volume field.
Definition volFields.C:165
bool is_internal(const word &clsName)
Test if the class name appears to be a volume internal field.
Definition volFields.C:155
const wordList internal
Standard volume internal field types (scalar, vector, tensor, etc).
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Tensor< scalar > tensor
Definition symmTensor.H:57
GeometricField< tensor, fvPatchField, volMesh > volTensorField
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
uint8_t direction
Definition direction.H:49
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
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