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  }
141 
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>&) {}
200 
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 };
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace Foam
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #ifdef NoRepository
216 # include "fixedValueFvPatchField.C"
217 #endif
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::fixedValueFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: fixedValueFvPatchField.H:214
Foam::fixedValueFvPatchField::gradientBoundaryCoeffs
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
Definition: fixedValueFvPatchField.C:135
Foam::fixedValueFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: fixedValueFvPatchField.H:199
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fixedValueFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: fixedValueFvPatchField.H:212
Foam::fixedValueFvPatchField::operator=
virtual void operator=(const Type &)
Definition: fixedValueFvPatchField.H:210
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:79
Foam::fixedValueFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: fixedValueFvPatchField.H:196
Foam::fixedValueFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedValueFvPatchField.C:142
Foam::fixedValueFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: fixedValueFvPatchField.H:213
Foam::Field< Type >
Foam::fixedValueFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: fixedValueFvPatchField.H:201
Foam::fixedValueFvPatchField::fixesValue
virtual bool fixesValue() const
Return true if this patch field fixes a value.
Definition: fixedValueFvPatchField.H:159
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::fixedValueFvPatchField::operator/=
virtual void operator/=(const fvPatchField< scalar > &)
Definition: fixedValueFvPatchField.H:202
Foam::fixedValueFvPatchField::fixedValueFvPatchField
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedValueFvPatchField.C:37
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::fixedValueFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: fixedValueFvPatchField.H:211
Foam::fixedValueFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedValueFvPatchField.H:124
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fixedValueFvPatchField::valueInternalCoeffs
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Definition: fixedValueFvPatchField.C:106
Foam::fixedValueFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: fixedValueFvPatchField.H:205
Foam::fixedValueFvPatchField::gradientInternalCoeffs
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Definition: fixedValueFvPatchField.C:128
Foam::fixedValueFvPatchField::TypeName
TypeName("fixedValue")
Runtime type information.
Foam::fixedValueFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: fixedValueFvPatchField.H:204
Foam::fixedValueFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: fixedValueFvPatchField.H:198
Foam::UList< Type >
Foam::fixedValueFvPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Definition: fixedValueFvPatchField.C:119
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::fixedValueFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: fixedValueFvPatchField.H:207
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
fixedValueFvPatchField.C
Foam::fixedValueFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: fixedValueFvPatchField.H:208
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::fixedValueFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: fixedValueFvPatchField.H:200
fvPatchField.H