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