fixedValueFvsPatchField.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) 2024 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 Class
28  Foam::fixedValueFvsPatchField
29 
30 Description
31  This boundary condition supplies a fixed value constraint, and is the base
32  class for a number of other boundary conditions.
33 
34  The "value" entry is MUST_READ.
35 
36 Usage
37  \table
38  Property | Description | Required | Default
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 
51 SourceFiles
52  fixedValueFvsPatchField.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef Foam_fixedValueFvsPatchField_H
57 #define Foam_fixedValueFvsPatchField_H
58 
59 #include "fvsPatchField.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class fixedValueFvsPatchField Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 template<class Type>
71 class fixedValueFvsPatchField
72 :
73  public fvsPatchField<Type>
74 {
75 public:
76 
77  //- Runtime type information
78  TypeName("fixedValue");
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 value
92  (
93  const fvPatch&,
95  const Type& value
96  );
97 
98  //- Construct from patch, internal field and dictionary
100  (
101  const fvPatch&,
103  const dictionary&,
105  );
106 
107  //- Construct by mapping the given fixedValue patch field
108  //- onto a new patch
110  (
112  const fvPatch&,
114  const fvPatchFieldMapper&
115  );
116 
117  //- Construct as copy
119  (
121  );
122 
124  (
127  );
128 
129  //- Return clone
130  virtual tmp<fvsPatchField<Type>> clone() const
131  {
132  return fvsPatchField<Type>::Clone(*this);
133  }
134 
135  //- Clone with an internal field reference
137  (
139  ) const
140  {
141  return fvsPatchField<Type>::Clone(*this, iF);
142  }
143 
144 
145  // Member Functions
146 
147  //- True: this patch field fixes a value.
148  virtual bool fixesValue() const { return true; }
150  //- Write includes "value" entry
151  virtual void write(Ostream&) const;
152 
153 
154  // Evaluation Functions
155 
156  //- Return the matrix diagonal coefficients corresponding to the
157  // evaluation of the value of this patchField with given weights
159  (
160  const tmp<scalarField>&
161  ) const;
162 
163  //- Return the matrix source coefficients corresponding to the
164  // evaluation of the value of this patchField with given weights
166  (
167  const tmp<scalarField>&
168  ) const;
169 
170  //- Return the matrix diagonal coefficients corresponding to the
171  // evaluation of the gradient of this patchField
172  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
173 
174  //- Return the matrix source coefficients corresponding to the
175  // evaluation of the gradient of this patchField
176  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
177 
178 
179  // Member Operators
180 
181  virtual void operator=(const UList<Type>&) {}
182 
183  virtual void operator=(const fvsPatchField<Type>&) {}
184  virtual void operator+=(const fvsPatchField<Type>&) {}
185  virtual void operator-=(const fvsPatchField<Type>&) {}
186  virtual void operator*=(const fvsPatchField<scalar>&) {}
187  virtual void operator/=(const fvsPatchField<scalar>&) {}
188 
189  virtual void operator+=(const Field<Type>&) {}
190  virtual void operator-=(const Field<Type>&) {}
191 
192  virtual void operator*=(const Field<scalar>&) {}
193  virtual void operator/=(const Field<scalar>&) {}
194 
195  virtual void operator=(const Type&) {}
196  virtual void operator+=(const Type&) {}
197  virtual void operator-=(const Type&) {}
198  virtual void operator*=(const scalar) {}
199  virtual void operator/=(const scalar) {}
200 };
201 
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #ifdef NoRepository
210  #include "fixedValueFvsPatchField.C"
211 #endif
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
virtual tmp< fvsPatchField< Type > > clone() const
Return clone.
virtual void operator/=(const fvsPatchField< scalar > &)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
static tmp< fvsPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual void operator+=(const fvsPatchField< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual void write(Ostream &) const
Write includes "value" entry.
fixedValueFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
A FieldMapper for finite-volume patch fields.
virtual void operator=(const UList< Type > &)
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual void operator-=(const fvsPatchField< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual bool fixesValue() const
True: this patch field fixes a value.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
TypeName("fixedValue")
Runtime type information.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
virtual void operator*=(const fvsPatchField< scalar > &)
Namespace for OpenFOAM.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
readOption
Enumeration defining read preferences.