genericFvPatchField.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  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::genericFvPatchField
29 
30 Description
31  This boundary condition provides a generic version of the \c calculated
32  condition, useful as a fallback for handling unknown patch types. Not
33  generally applicable as a user-specified condition.
34 
35 See also
36  Foam::calculatedFvPatchField
37 
38 SourceFiles
39  genericFvPatchField.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef genericFvPatchField_H
44 #define genericFvPatchField_H
45 
46 #include "calculatedFvPatchField.H"
47 #include "HashPtrTable.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class genericFvPatch Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class Type>
60 :
61  public calculatedFvPatchField<Type>
62 {
63  // Private Data
64 
65  const word actualTypeName_;
66 
67  dictionary dict_;
68 
69  HashPtrTable<scalarField> scalarFields_;
70  HashPtrTable<vectorField> vectorFields_;
71  HashPtrTable<sphericalTensorField> sphTensorFields_;
72  HashPtrTable<symmTensorField> symmTensorFields_;
73  HashPtrTable<tensorField> tensorFields_;
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("generic");
80 
81 
82  // Constructors
83 
84  //- Construct from patch and internal field
86  (
87  const fvPatch&,
89  );
90 
91  //- Construct from patch, internal field and dictionary
93  (
94  const fvPatch&,
96  const dictionary&
97  );
98 
99  //- Construct by mapping given patchField<Type> 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  (
119  new genericFvPatchField<Type>(*this)
120  );
121  }
122 
123  //- Construct as copy setting internal field reference
125  (
128  );
129 
130  //- Construct and return a clone setting internal field reference
132  (
134  ) const
135  {
136  return tmp<fvPatchField<Type>>
137  (
138  new genericFvPatchField<Type>(*this, iF)
139  );
140  }
141 
142 
143  // Member Functions
144 
145  // Mapping Functions
146 
147  //- Map (and resize as needed) from self given a mapping object
148  virtual void autoMap
149  (
150  const fvPatchFieldMapper&
151  );
152 
153  //- Reverse map the given fvPatchField onto this fvPatchField
154  virtual void rmap
155  (
156  const fvPatchField<Type>&,
157  const labelList&
158  );
159 
160 
161  // Evaluation Functions
162 
163  //- Return the matrix diagonal coefficients corresponding to the
164  // evaluation of the value of this patchField with given weights
166  (
167  const tmp<scalarField>&
168  ) const;
169 
170  //- Return the matrix source coefficients corresponding to the
171  // evaluation of the value of this patchField with given weights
173  (
174  const tmp<scalarField>&
175  ) const;
176 
177  //- Return the matrix diagonal coefficients corresponding to the
178  // evaluation of the gradient of this patchField
180 
181  //- Return the matrix source coefficients corresponding to the
182  // evaluation of the gradient of this patchField
184 
185 
186  //- Return the actual type
187  const word& actualType() const;
188 
189  //- Write
190  virtual void write(Ostream&) const;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #ifdef NoRepository
201  #include "genericFvPatchField.C"
202 #endif
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:50
Foam::genericFvPatchField
This boundary condition provides a generic version of the calculated condition, useful as a fallback ...
Definition: genericFvPatchField.H:58
Foam::genericFvPatchField::gradientInternalCoeffs
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Definition: genericFvPatchField.C:654
Foam::genericFvPatchField::genericFvPatchField
genericFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: genericFvPatchField.C:36
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
calculatedFvPatchField.H
genericFvPatchField.C
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::genericFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: genericFvPatchField.C:548
Foam::genericFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: genericFvPatchField.C:695
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
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::genericFvPatchField::valueInternalCoeffs
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Definition: genericFvPatchField.C:613
Foam::genericFvPatchField::TypeName
TypeName("generic")
Runtime type information.
Foam::genericFvPatchField::gradientBoundaryCoeffs
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
Definition: genericFvPatchField.C:671
Foam::HashPtrTable
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
Definition: HashPtrTable.H:54
Foam::List< label >
Foam::genericFvPatchField::actualType
const word & actualType() const
Return the actual type.
Definition: genericFvPatchField.C:688
Foam::genericFvPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Definition: genericFvPatchField.C:634
HashPtrTable.H
Foam::genericFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: genericFvPatchField.H:114
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::genericFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: genericFvPatchField.C:513
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54