coupledFixedValueFvPatchField.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::coupledFixedValueFvPatchField
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 coupledFixedValue;
46  value uniform 0; // example for scalar field usage
47  }
48  \endverbatim
49 
50  SourceFiles
51  coupledFixedValueFvPatchField.C
52 
53  \*---------------------------------------------------------------------------*/
54 
55 #ifndef coupledFixedValueFvPatchField_H
56 #define coupledFixedValueFvPatchField_H
57 
58 #include "fvPatchField.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65  /*---------------------------------------------------------------------------*\
66  Class coupledFixedValueFvPatchField Declaration
67  \*---------------------------------------------------------------------------*/
68 
69  template<class Type>
70  class coupledFixedValueFvPatchField
71  :
72  public fvPatchField<Type>
73  {
74 
75  //private data
76  //
77  const word neighbourName_;
78  label debug_ = 1;//const word neighbourName_;
79  public:
80 
81  //- Runtime type information
82  TypeName("coupledFixedValue");
83 
84 
85  // Constructors
86 
87  //- Construct from patch and internal field
89  (
90  const fvPatch&,
92  );
93 
94  //- Construct from patch, internal field and dictionary
96  (
97  const fvPatch&,
99  const dictionary&
100  );
101 
102  //- Construct by mapping the given coupledFixedValueFvPatchField<Type>
103  // onto a new patch
105  (
107  const fvPatch&,
109  const fvPatchFieldMapper&
110  );
111 
112  //- Construct as copy
114  (
116  );
117 
118  //- Construct and return a clone
119  virtual tmp<fvPatchField<Type> > clone() const
120  {
121  return tmp<fvPatchField<Type> >
122  (
124  );
125  }
126 
127  //- Construct as copy setting internal field reference
129  (
132  );
133 
134  //- Construct and return a clone setting internal field reference
135  virtual tmp<fvPatchField<Type> > clone
136  (
138  ) const
139  {
140  return tmp<fvPatchField<Type> >
141  (
143  );
144  }
145 
146 
147  // Member functions
148 
149  // Access
150 
151  //- Return true if this patch field fixes a value.
152  // Needed to check if a level has to be specified while solving
153  // Poissons equations.
154  virtual bool fixesValue() const
155  {
156  return true;
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  //- Update the coefficients associated with the patch field
185  virtual void updateCoeffs();
186 
187  //- Evaluate the patch field
188  virtual void evaluate
189  (
190  const Pstream::commsTypes commsType=Pstream::blocking
191  );
192 
193  //- Write
194  virtual void write(Ostream&) const;
195 
196 
197  // Member operators
198 
199  virtual void operator=(const UList<Type>&) {}
200 
201  virtual void operator=(const fvPatchField<Type>&) {}
202  virtual void operator+=(const fvPatchField<Type>&) {}
203  virtual void operator-=(const fvPatchField<Type>&) {}
204  virtual void operator*=(const fvPatchField<scalar>&) {}
205  virtual void operator/=(const fvPatchField<scalar>&) {}
206 
207  virtual void operator+=(const Field<Type>&) {}
208  virtual void operator-=(const Field<Type>&) {}
209 
210  virtual void operator*=(const Field<scalar>&) {}
211  virtual void operator/=(const Field<scalar>&) {}
212 
213  virtual void operator=(const Type&) {}
214  virtual void operator+=(const Type&) {}
215  virtual void operator-=(const Type&) {}
216  virtual void operator*=(const scalar) {}
217  virtual void operator/=(const scalar) {}
218  };
219 
220 
221  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 } // End namespace Foam
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #ifdef NoRepository
229 #endif
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #endif
234 
235 // ************************************************************************* //
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::coupledFixedValueFvPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Definition: coupledFixedValueFvPatchField.C:121
Foam::coupledFixedValueFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: coupledFixedValueFvPatchField.H:213
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::coupledFixedValueFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: coupledFixedValueFvPatchField.C:297
Foam::coupledFixedValueFvPatchField::gradientInternalCoeffs
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Definition: coupledFixedValueFvPatchField.C:130
Foam::coupledFixedValueFvPatchField::operator/=
virtual void operator/=(const fvPatchField< scalar > &)
Definition: coupledFixedValueFvPatchField.H:215
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::coupledFixedValueFvPatchField
Definition: coupledFixedValueFvPatchField.H:80
Foam::coupledFixedValueFvPatchField::operator=
virtual void operator=(const Type &)
Definition: coupledFixedValueFvPatchField.H:223
Foam::coupledFixedValueFvPatchField::coupledFixedValueFvPatchField
coupledFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: coupledFixedValueFvPatchField.C:38
Foam::coupledFixedValueFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: coupledFixedValueFvPatchField.H:221
Foam::coupledFixedValueFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: coupledFixedValueFvPatchField.H:226
Foam::coupledFixedValueFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: coupledFixedValueFvPatchField.C:143
Foam::coupledFixedValueFvPatchField::TypeName
TypeName("coupledFixedValue")
Runtime type information.
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
Foam::coupledFixedValueFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: coupledFixedValueFvPatchField.H:227
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Field< Type >
Foam::coupledFixedValueFvPatchField::operator=
virtual void operator=(const UList< Type > &)
Definition: coupledFixedValueFvPatchField.H:209
Foam::coupledFixedValueFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: coupledFixedValueFvPatchField.H:212
Foam::coupledFixedValueFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: coupledFixedValueFvPatchField.H:218
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::coupledFixedValueFvPatchField::operator*=
virtual void operator*=(const fvPatchField< scalar > &)
Definition: coupledFixedValueFvPatchField.H:214
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::coupledFixedValueFvPatchField::debug_
label debug_
Definition: coupledFixedValueFvPatchField.H:88
Foam::coupledFixedValueFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: coupledFixedValueFvPatchField.H:220
Foam::coupledFixedValueFvPatchField::gradientBoundaryCoeffs
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
Definition: coupledFixedValueFvPatchField.C:137
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::coupledFixedValueFvPatchField::valueInternalCoeffs
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Definition: coupledFixedValueFvPatchField.C:108
coupledFixedValueFvPatchField.C
Foam::coupledFixedValueFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: coupledFixedValueFvPatchField.H:211
Foam::UList< Type >
Foam::coupledFixedValueFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: coupledFixedValueFvPatchField.H:129
Foam::coupledFixedValueFvPatchField::neighbourName_
const word neighbourName_
Definition: coupledFixedValueFvPatchField.H:87
Foam::coupledFixedValueFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: coupledFixedValueFvPatchField.H:225
Foam::coupledFixedValueFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field.
Definition: coupledFixedValueFvPatchField.C:274
Foam::coupledFixedValueFvPatchField::fixesValue
virtual bool fixesValue() const
Return true if this patch field fixes a value.
Definition: coupledFixedValueFvPatchField.H:164
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::coupledFixedValueFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: coupledFixedValueFvPatchField.H:217
Foam::coupledFixedValueFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: coupledFixedValueFvPatchField.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:51
fvPatchField.H