All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fixedValueFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fixedValueFvPatchField
26 
27 Description
28  This boundary condition supplies a fixed value constraint, and is the base
29  class for a number of other boundary conditions.
30 
31 Usage
32  \table
33  Property | Description | Required | Default value
34  value | Patch face values | yes |
35  \endtable
36 
37  Example of the boundary condition specification:
38  \verbatim
39  <patchName>
40  {
41  type fixedValue;
42  value uniform 0; // Example for scalar field usage
43  }
44  \endverbatim
45 
46 SourceFiles
47  fixedValueFvPatchField.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef fixedValueFvPatchField_H
52 #define fixedValueFvPatchField_H
53 
54 #include "fvPatchField.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class fixedValueFvPatchField Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 template<class Type>
66 class fixedValueFvPatchField
67 :
68  public fvPatchField<Type>
69 {
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("fixedValue");
75 
76 
77  // Constructors
78 
79  //- Construct from patch and internal field
81  (
82  const fvPatch&,
84  );
85 
86  //- Construct from patch, internal field and dictionary
88  (
89  const fvPatch&,
91  const dictionary&,
92  const bool valueRequired=true
93  );
94 
95  //- Construct by mapping the given fixedValueFvPatchField<Type>
96  // onto a new patch
98  (
100  const fvPatch&,
102  const fvPatchFieldMapper&,
103  const bool mappingRequired=true
104  );
105 
106  //- Copy constructor
108  (
110  );
111 
112  //- Construct and return a clone
113  virtual tmp<fvPatchField<Type>> clone() const
114  {
115  return tmp<fvPatchField<Type>>
116  (
118  );
119  }
120 
121  //- Copy constructor setting internal field reference
123  (
126  );
127 
128  //- Construct and return a clone setting internal field reference
130  (
132  ) const
133  {
134  return tmp<fvPatchField<Type>>
135  (
136  new fixedValueFvPatchField<Type>(*this, iF)
137  );
138  }
140 
141  // Member Functions
142 
143  // Attributes
144 
145  //- Return true if this patch field fixes a value.
146  // Needed to check if a level has to be specified while solving
147  // Poissons equations.
148  virtual bool fixesValue() const
149  {
150  return true;
151  }
152 
153  //- Return false: this patch field is not altered by assignment
154  virtual bool assignable() const
155  {
156  return false;
157  }
158 
159 
160  // Evaluation functions
161 
162  //- Return the matrix diagonal coefficients corresponding to the
163  // evaluation of the value of this patchField with given weights
165  (
166  const tmp<scalarField>&
167  ) const;
168 
169  //- Return the matrix source coefficients corresponding to the
170  // evaluation of the value of this patchField with given weights
172  (
173  const tmp<scalarField>&
174  ) const;
175 
176  //- Return the matrix diagonal coefficients corresponding to the
177  // evaluation of the gradient of this patchField
178  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
179 
180  //- Return the matrix source coefficients corresponding to the
181  // evaluation of the gradient of this patchField
182  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
183 
184 
185  //- Write
186  virtual void write(Ostream&) const;
187 
188 
189  // Member Operators
190 
191  virtual void operator=(const UList<Type>&) {}
192 
193  virtual void operator=(const fvPatchField<Type>&) {}
194  virtual void operator+=(const fvPatchField<Type>&) {}
195  virtual void operator-=(const fvPatchField<Type>&) {}
196  virtual void operator*=(const fvPatchField<scalar>&) {}
197  virtual void operator/=(const fvPatchField<scalar>&) {}
198 
199  virtual void operator+=(const Field<Type>&) {}
200  virtual void operator-=(const Field<Type>&) {}
201 
202  virtual void operator*=(const Field<scalar>&) {}
203  virtual void operator/=(const Field<scalar>&) {}
205  virtual void operator=(const Type&) {}
206  virtual void operator+=(const Type&) {}
207  virtual void operator-=(const Type&) {}
208  virtual void operator*=(const scalar) {}
209  virtual void operator/=(const scalar) {}
210 };
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 } // End namespace Foam
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 #ifdef NoRepository
220  #include "fixedValueFvPatchField.C"
221 #endif
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 #endif
226 
227 // ************************************************************************* //
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual void operator/=(const fvPatchField< scalar > &)
virtual void operator=(const UList< Type > &)
virtual void write(Ostream &) const
Write.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Pre-declare SubField and related Field type.
Definition: Field.H:56
TypeName("fixedValue")
Runtime type information.
Foam::fvPatchFieldMapper.
virtual void operator*=(const fvPatchField< scalar > &)
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void operator+=(const fvPatchField< Type > &)
virtual bool fixesValue() const
Return true if this patch field fixes a value.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void operator-=(const fvPatchField< Type > &)
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.