fixedValueFvPatchField.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-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::fixedValueFvPatchField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 This boundary condition supplies a fixed value constraint, and is the base
34 class for a number of other boundary conditions.
35
36Usage
37 \table
38 Property | Description | Required | Default value
39 value | Patch face values | yes |
40 \endtable
41
42 Example of the boundary condition specification:
43 \verbatim
44 <patchName>
45 {
46 type fixedValue;
47 value uniform 0; // Example for scalar field usage
48 }
49 \endverbatim
50
51SourceFiles
52 fixedValueFvPatchField.C
53
54\*---------------------------------------------------------------------------*/
55
56#ifndef fixedValueFvPatchField_H
57#define fixedValueFvPatchField_H
58
59#include "fvPatchField.H"
60
61// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62
63namespace Foam
64{
65
66/*---------------------------------------------------------------------------*\
67 Class fixedValueFvPatchField Declaration
68\*---------------------------------------------------------------------------*/
69
70template<class Type>
71class fixedValueFvPatchField
72:
73 public fvPatchField<Type>
74{
75
76public:
77
78 //- Runtime type information
79 TypeName("fixedValue");
81
82 // Constructors
83
84 //- Construct from patch and internal field
86 (
87 const fvPatch&,
89 );
90
91 //- Construct from patch, internal field and value
93 (
94 const fvPatch&,
96 const Type& value
97 );
98
99 //- Construct from patch, internal field and dictionary
101 (
102 const fvPatch&,
104 const dictionary&,
105 const bool valueRequired=true
106 );
107
108 //- Construct by mapping the given fixedValueFvPatchField<Type>
109 // onto a new patch
111 (
113 const fvPatch&,
115 const fvPatchFieldMapper&
116 );
117
118 //- Construct as copy
120 (
122 );
123
124 //- Construct and return a clone
125 virtual tmp<fvPatchField<Type>> clone() const
126 {
128 (
130 );
131 }
132
133 //- Construct as copy setting internal field reference
135 (
138 );
139
140 //- Construct and return a clone setting internal field reference
142 (
144 ) const
145 {
147 (
148 new fixedValueFvPatchField<Type>(*this, iF)
149 );
151
152
153 // Member functions
154
155 // Attributes
156
157 //- Return true if this patch field fixes a value.
158 // Needed to check if a level has to be specified while solving
159 // Poissons equations.
160 virtual bool fixesValue() const
161 {
162 return true;
163 }
164
165 //- Return false: this patch field is not altered by assignment
166 virtual bool assignable() const
167 {
168 return false;
170
171
172 // Evaluation functions
173
174 //- Return the matrix diagonal coefficients corresponding to the
175 // evaluation of the value of this patchField with given weights
177 (
178 const tmp<scalarField>&
179 ) const;
180
181 //- Return the matrix source coefficients corresponding to the
182 // evaluation of the value of this patchField with given weights
184 (
185 const tmp<scalarField>&
186 ) const;
187
188 //- Return the matrix diagonal coefficients corresponding to the
189 // evaluation of the gradient of this patchField
191
192 //- Return the matrix source coefficients corresponding to the
193 // evaluation of the gradient of this patchField
195
196
197 //- Write
198 virtual void write(Ostream&) const;
199
200
201 // Member operators
202
203 virtual void operator=(const UList<Type>&) {}
204
205 virtual void operator=(const fvPatchField<Type>&) {}
206 virtual void operator+=(const fvPatchField<Type>&) {}
207 virtual void operator-=(const fvPatchField<Type>&) {}
208 virtual void operator*=(const fvPatchField<scalar>&) {}
209 virtual void operator/=(const fvPatchField<scalar>&) {}
210
211 virtual void operator+=(const Field<Type>&) {}
212 virtual void operator-=(const Field<Type>&) {}
213
214 virtual void operator*=(const Field<scalar>&) {}
215 virtual void operator/=(const Field<scalar>&) {}
217 virtual void operator=(const Type&) {}
218 virtual void operator+=(const Type&) {}
219 virtual void operator-=(const Type&) {}
220 virtual void operator*=(const scalar) {}
221 virtual void operator/=(const scalar) {}
222};
225// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227} // End namespace Foam
229// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231#ifdef NoRepository
232 #include "fixedValueFvPatchField.C"
233#endif
234
235// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236
237#endif
238
239// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
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:94
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual void operator/=(const Field< scalar > &)
virtual bool fixesValue() const
Return true if this patch field fixes a value.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual void operator+=(const Field< Type > &)
virtual void operator=(const Type &)
virtual void operator*=(const Field< scalar > &)
virtual void operator+=(const fvPatchField< Type > &)
TypeName("fixedValue")
Runtime type information.
virtual void operator/=(const fvPatchField< scalar > &)
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual void operator=(const fvPatchField< Type > &)
virtual void operator*=(const fvPatchField< scalar > &)
virtual void operator/=(const scalar)
virtual void operator-=(const fvPatchField< Type > &)
virtual void operator=(const UList< Type > &)
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void operator-=(const Type &)
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
virtual void operator*=(const scalar)
virtual void operator-=(const Field< Type > &)
virtual void operator+=(const Type &)
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting 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...
Definition: fvPatchField.H:82
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73