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 | Copyright (C) 2011-2013 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 Group
28  grpGenericBoundaryConditions
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  \heading Patch usage
35 
36  \table
37  Property | Description | Required | Default value
38  value | Patch face values | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  myPatch
44  {
45  type fixedValue;
46  value uniform 0; // example for scalar field usage
47  }
48  \endverbatim
49 
50 SourceFiles
51  fixedValueFvPatchField.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef fixedValueFvPatchField_H
56 #define fixedValueFvPatchField_H
57 
58 #include "fvPatchField.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class fixedValueFvPatchField Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 template<class Type>
70 class fixedValueFvPatchField
71 :
72  public fvPatchField<Type>
73 {
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 dictionary
92  (
93  const fvPatch&,
95  const dictionary&
96  );
97 
98  //- Construct by mapping the given fixedValueFvPatchField<Type>
99  // onto a new patch
101  (
103  const fvPatch&,
105  const fvPatchFieldMapper&
106  );
107 
108  //- Construct as copy
110  (
112  );
113 
114  //- Construct and return a clone
115  virtual tmp<fvPatchField<Type> > clone() const
116  {
117  return tmp<fvPatchField<Type> >
118  (
120  );
121  }
122 
123  //- Construct as copy setting internal field reference
125  (
128  );
129 
130  //- Construct and return a clone setting internal field reference
131  virtual tmp<fvPatchField<Type> > clone
132  (
134  ) const
135  {
136  return tmp<fvPatchField<Type> >
137  (
138  new fixedValueFvPatchField<Type>(*this, iF)
139  );
140  }
142 
143  // Member functions
144 
145  // Access
146 
147  //- Return true if this patch field fixes a value.
148  // Needed to check if a level has to be specified while solving
149  // Poissons equations.
150  virtual bool fixesValue() const
151  {
152  return true;
153  }
154 
155 
156  // Evaluation functions
157 
158  //- Return the matrix diagonal coefficients corresponding to the
159  // evaluation of the value of this patchField with given weights
161  (
162  const tmp<scalarField>&
163  ) const;
164 
165  //- Return the matrix source 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 the matrix diagonal coefficients corresponding to the
173  // evaluation of the gradient of this patchField
174  virtual tmp<Field<Type> > gradientInternalCoeffs() const;
175 
176  //- Return the matrix source coefficients corresponding to the
177  // evaluation of the gradient of this patchField
178  virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
179 
180 
181  //- Write
182  virtual void write(Ostream&) const;
183 
184 
185  // Member operators
186 
187  virtual void operator=(const UList<Type>&) {}
188 
189  virtual void operator=(const fvPatchField<Type>&) {}
190  virtual void operator+=(const fvPatchField<Type>&) {}
191  virtual void operator-=(const fvPatchField<Type>&) {}
192  virtual void operator*=(const fvPatchField<scalar>&) {}
193  virtual void operator/=(const fvPatchField<scalar>&) {}
194 
195  virtual void operator+=(const Field<Type>&) {}
196  virtual void operator-=(const Field<Type>&) {}
197 
198  virtual void operator*=(const Field<scalar>&) {}
199  virtual void operator/=(const Field<scalar>&) {}
201  virtual void operator=(const Type&) {}
202  virtual void operator+=(const Type&) {}
203  virtual void operator-=(const Type&) {}
204  virtual void operator*=(const scalar) {}
205  virtual void operator/=(const scalar) {}
206 };
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 } // End namespace Foam
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 #ifdef NoRepository
216 # include "fixedValueFvPatchField.C"
217 #endif
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
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 UList< Type > &)
virtual void operator*=(const fvPatchField< scalar > &)
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Pre-declare SubField and related Field type.
Definition: Field.H:57
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual bool fixesValue() const
Return true if this patch field fixes a value.
TypeName("fixedValue")
Runtime type information.
virtual void write(Ostream &) const
Write.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void operator+=(const fvPatchField< Type > &)
A class for managing temporary objects.
Definition: PtrList.H:118
virtual void operator/=(const fvPatchField< scalar > &)
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.