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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::fixedValueFvPatchField
28 
29 Group
30  grpGenericBoundaryConditions
31 
32 Description
33  This boundary condition supplies a fixed value constraint, and is the base
34  class for a number of other boundary conditions.
35 
36 Usage
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 
51 SourceFiles
52  fixedValueFvPatchField.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef fixedValueFvPatchField_H
57 #define fixedValueFvPatchField_H
58 
59 #include "fvPatchField.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class fixedValueFvPatchField Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 template<class Type>
71 class fixedValueFvPatchField
72 :
73  public fvPatchField<Type>
74 {
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("fixedValue");
80 
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  {
127  return tmp<fvPatchField<Type>>
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  {
146  return tmp<fvPatchField<Type>>
147  (
148  new fixedValueFvPatchField<Type>(*this, iF)
149  );
150  }
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;
169  }
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
190  virtual tmp<Field<Type>> gradientInternalCoeffs() const;
191 
192  //- Return the matrix source coefficients corresponding to the
193  // evaluation of the gradient of this patchField
194  virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
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>&) {}
216 
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 };
223 
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 } // End namespace Foam
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #ifdef NoRepository
232  #include "fixedValueFvPatchField.C"
233 #endif
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:51
Foam::fixedValueFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: fixedValueFvPatchField.H:230
Foam::fixedValueFvPatchField::gradientBoundaryCoeffs
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
Definition: fixedValueFvPatchField.C:149
Foam::fixedValueFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: fixedValueFvPatchField.H:215
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fixedValueFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: fixedValueFvPatchField.H:228
Foam::fixedValueFvPatchField::operator=
virtual void operator=(const Type &)
Definition: fixedValueFvPatchField.H:226
Foam::fixedValueFvPatchField::valueInternalCoeffs
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Definition: fixedValueFvPatchField.C:117
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
Foam::fixedValueFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: fixedValueFvPatchField.H:212
Foam::fixedValueFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedValueFvPatchField.C:156
Foam::fixedValueFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: fixedValueFvPatchField.H:229
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::fixedValueFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: fixedValueFvPatchField.H:217
Foam::fixedValueFvPatchField::fixesValue
virtual bool fixesValue() const
Return true if this patch field fixes a value.
Definition: fixedValueFvPatchField.H:169
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::fixedValueFvPatchField::operator/=
virtual void operator/=(const fvPatchField< scalar > &)
Definition: fixedValueFvPatchField.H:218
Foam::fixedValueFvPatchField::fixedValueFvPatchField
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedValueFvPatchField.C:34
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::fixedValueFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: fixedValueFvPatchField.H:227
Foam::fixedValueFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedValueFvPatchField.H:134
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fixedValueFvPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Definition: fixedValueFvPatchField.C:131
Foam::fixedValueFvPatchField::gradientInternalCoeffs
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Definition: fixedValueFvPatchField.C:141
Foam::fixedValueFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: fixedValueFvPatchField.H:221
Foam::fixedValueFvPatchField::TypeName
TypeName("fixedValue")
Runtime type information.
Foam::fixedValueFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: fixedValueFvPatchField.H:220
Foam::fixedValueFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: fixedValueFvPatchField.H:214
Foam::UList< Type >
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::fixedValueFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: fixedValueFvPatchField.H:223
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::fixedValueFvPatchField::assignable
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
Definition: fixedValueFvPatchField.H:175
fixedValueFvPatchField.C
Foam::fixedValueFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: fixedValueFvPatchField.H:224
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::fixedValueFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: fixedValueFvPatchField.H:216
fvPatchField.H