calculatedFvPatchField.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::calculatedFvPatchField
28 
29 Group
30  grpGenericBoundaryConditions
31 
32 Description
33  This boundary condition is not designed to be evaluated; it is assmued
34  that the value is assigned via field assignment, and not via a call to
35  e.g. \c updateCoeffs or \c evaluate.
36 
37 Usage
38  Example of the boundary condition specification:
39  \verbatim
40  <patchName>
41  {
42  type calculated;
43  value uniform (0 0 0); // Required value entry
44  }
45  \endverbatim
46 
47 SourceFiles
48  calculatedFvPatchField.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef calculatedFvPatchField_H
53 #define calculatedFvPatchField_H
54 
55 #include "fvPatchField.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class calculatedFvPatchField Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 template<class Type>
68 :
69  public fvPatchField<Type>
70 {
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("calculated");
76 
77 
78  // Constructors
79 
80  //- Construct from patch and internal field
82  (
83  const fvPatch&,
85  );
86 
87  //- Construct from patch, internal field and dictionary
89  (
90  const fvPatch&,
92  const dictionary&,
93  const bool valueRequired=true
94  );
95 
96  //- Construct by mapping given patchField<Type> onto a new patch
98  (
100  const fvPatch&,
102  const fvPatchFieldMapper&
103  );
104 
105  //- Construct as copy
107  (
109  );
110 
111  //- Construct and return a clone
112  virtual tmp<fvPatchField<Type>> clone() const
113  {
114  return tmp<fvPatchField<Type>>
115  (
117  );
118  }
119 
120  //- Construct as copy setting internal field reference
122  (
125  );
126 
127  //- Construct and return a clone setting internal field reference
129  (
131  ) const
132  {
133  return tmp<fvPatchField<Type>>
134  (
135  new calculatedFvPatchField<Type>(*this, iF)
136  );
137  }
138 
139 
140  // Member functions
141 
142  // Attributes
143 
144  //- Return true if this patch field fixes a value.
145  // Needed to check if a level has to be specified while solving
146  // Poissons equations.
147  virtual bool fixesValue() const
148  {
149  return true;
150  }
151 
152 
153  // Evaluation functions
154 
155  //- Return the matrix diagonal coefficients corresponding to the
156  // evaluation of the value of this patchField with given weights
158  (
159  const tmp<scalarField>&
160  ) const;
161 
162  //- Return the matrix source 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 diagonal coefficients corresponding to the
170  // evaluation of the gradient of this patchField
172 
173  //- Return the matrix source coefficients corresponding to the
174  // evaluation of the gradient of this patchField
176 
177 
178  //- Write
179  virtual void write(Ostream&) const;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #ifdef NoRepository
190  #include "calculatedFvPatchField.C"
191 #endif
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
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::calculatedFvPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Definition: calculatedFvPatchField.C:168
Foam::calculatedFvPatchField::gradientInternalCoeffs
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Definition: calculatedFvPatchField.C:187
Foam::calculatedFvPatchField::calculatedFvPatchField
calculatedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: calculatedFvPatchField.C:45
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
calculatedFvPatchField.C
Foam::calculatedFvPatchField::gradientBoundaryCoeffs
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
Definition: calculatedFvPatchField.C:204
Foam::calculatedFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: calculatedFvPatchField.C:220
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::calculatedFvPatchField
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
Definition: calculatedFvPatchField.H:66
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::calculatedFvPatchField::valueInternalCoeffs
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Definition: calculatedFvPatchField.C:148
Foam::calculatedFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: calculatedFvPatchField.H:111
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::calculatedFvPatchField::TypeName
TypeName("calculated")
Runtime type information.
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
fvPatchField.H
Foam::calculatedFvPatchField::fixesValue
virtual bool fixesValue() const
Return true if this patch field fixes a value.
Definition: calculatedFvPatchField.H:146