Loading...
Searching...
No Matches
emptyFvPatchField.H
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) 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
27Class
28 Foam::emptyFvPatchField
29
30Group
31 grpConstraintBoundaryConditions
32
33Description
34 This boundary condition provides an 'empty' condition for reduced
35 dimensions cases, i.e. 1- and 2-D geometries. Apply this condition to
36 patches whose normal is aligned to geometric directions that do not
37 constitute solution directions.
38
39 The "value" entry is NO_READ, NO_WRITE.
40
41Usage
42 Example of the boundary condition specification:
43 \verbatim
44 <patchName>
45 {
46 type empty;
47 }
48 \endverbatim
49
50SourceFiles
51 emptyFvPatchField.C
52
53\*---------------------------------------------------------------------------*/
54
55#ifndef Foam_emptyFvPatchField_H
56#define Foam_emptyFvPatchField_H
57
58#include "fvPatchField.H"
59#include "emptyFvPatch.H"
60
61// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62
63namespace Foam
64{
65
66/*---------------------------------------------------------------------------*\
67 Class emptyFvPatchField Declaration
68\*---------------------------------------------------------------------------*/
69
70template<class Type>
72:
73 public fvPatchField<Type>
74{
75public:
76
77 //- Runtime type information
78 TypeName(emptyFvPatch::typeName_()); // fieldTypes::emptyTypeName_()
79
80
81 // Constructors
82
83 //- Construct from patch and internal field
85 (
86 const fvPatch&,
88 );
89
90 //- Construct from patch, internal field and dictionary.
91 //- The "value" entry is NO_READ.
93 (
94 const fvPatch&,
96 const dictionary&
97 );
98
99 //- Construct by mapping given emptyFvPatchField onto a new patch
101 (
103 const fvPatch&,
105 const fvPatchFieldMapper&
106 );
107
108 //- Construct as copy
110 (
112 );
113
114 //- Construct as copy setting internal field reference
116 (
119 );
120
121 //- Return a clone
122 virtual tmp<fvPatchField<Type>> clone() const
123 {
124 return fvPatchField<Type>::Clone(*this);
125 }
126
127 //- Clone with an internal field reference
129 (
131 ) const
132 {
133 return fvPatchField<Type>::Clone(*this, iF);
134 }
135
136
137 // Member Functions
138
139 // Mapping functions
140
141 //- Map (and resize as needed) from self given a mapping object
142 virtual void autoMap
143 (
144 const fvPatchFieldMapper&
145 )
146 {}
147
148 //- Reverse map the given fvPatchField onto this fvPatchField
149 virtual void rmap
150 (
151 const fvPatchField<Type>&,
152 const labelList&
153 )
154 {}
156
157 // Evaluation Functions
158
159 //- Update the coefficients associated with the patch field
160 // This only checks to see the case is actually 1D or 2D
161 // for which this boundary condition is valid
162 void updateCoeffs();
163
165 //- Return the matrix diagonal coefficients corresponding to the
166 // evaluation of the value of this patchField with given weights
168 (
169 const tmp<scalarField>&
170 ) const
171 {
172 return tmp<Field<Type>>::New();
173 }
174
175 //- Return the matrix source coefficients corresponding to the
176 // evaluation of the value of this patchField with given weights
178 (
179 const tmp<scalarField>&
180 ) const
181 {
182 return tmp<Field<Type>>::New();
183 }
184
185 //- Return the matrix diagonal coefficients corresponding to the
186 //- evaluation of the gradient of this patchField
187 tmp<Field<Type>> gradientInternalCoeffs() const
189 return tmp<Field<Type>>::New();
190 }
191
192 //- Return the matrix source coefficients corresponding to the
193 //- evaluation of the gradient of this patchField
195 {
196 return tmp<Field<Type>>::New();
197 }
198
199
200 // Contiguous storage
202 //- Retrieve patch-normal gradient [contiguous storage].
203 //- Placeholder value is zero (treated like zero-gradient).
204 virtual void snGrad(UList<Type>& result) const
205 {
206 // Treat like zero-gradient
207 result = Foam::zero{};
208 }
209
210
211 // Member Functions
212
213 //- Write without "value" entry!
214 virtual void write(Ostream&) const;
215};
216
217
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220} // End namespace Foam
221
222// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223
224#ifdef NoRepository
225 #include "emptyFvPatchField.C"
226#endif
227
228// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229
230#endif
231
232// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
TypeName(emptyFvPatch::typeName_())
Runtime type information.
void updateCoeffs()
Update the coefficients associated with the patch field.
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void snGrad(UList< Type > &result) const
Retrieve patch-normal gradient [contiguous storage]. Placeholder value is zero (treated like zero-gra...
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
emptyFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
static tmp< fvPatchField< Type > > New(const word &patchFieldType, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68