genericFvsPatchField.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) 2019 OpenCFD Ltd.
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::genericFvsPatchField
28 
29 Description
30  This boundary condition provides a generic version of the \c calculated
31  condition, useful as a fallback for handling unknown patch types. Not
32  generally applicable as a user-specified condition.
33 
34 See also
35  Foam::calculatedFvsPatchField
36 
37 SourceFiles
38  genericFvsPatchField.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef genericFvsPatchField_H
43 #define genericFvsPatchField_H
44 
46 #include "HashPtrTable.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class genericFvsPatch Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class Type>
59 :
60  public calculatedFvsPatchField<Type>
61 {
62  // Private Data
63 
64  const word actualTypeName_;
65 
66  dictionary dict_;
67 
68  HashPtrTable<scalarField> scalarFields_;
69  HashPtrTable<vectorField> vectorFields_;
70  HashPtrTable<sphericalTensorField> sphTensorFields_;
71  HashPtrTable<symmTensorField> symmTensorFields_;
72  HashPtrTable<tensorField> tensorFields_;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("generic");
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 given patchField<Type> onto a new patch
100  (
102  const fvPatch&,
104  const fvPatchFieldMapper&
105  );
106 
107  //- Construct as copy
109  (
111  );
112 
113  //- Construct and return a clone
114  virtual tmp<fvsPatchField<Type>> clone() const
115  {
117  (
118  new genericFvsPatchField<Type>(*this)
119  );
120  }
121 
122  //- Construct as copy setting internal field reference
124  (
127  );
128 
129  //- Construct and return a clone setting internal field reference
131  (
133  ) const
134  {
136  (
137  new genericFvsPatchField<Type>(*this, iF)
138  );
139  }
140 
141 
142  // Member Functions
143 
144  // Mapping Functions
145 
146  //- Map (and resize as needed) from self given a mapping object
147  virtual void autoMap
148  (
149  const fvPatchFieldMapper&
150  );
151 
152  //- Reverse map the given fvsPatchField onto this fvsPatchField
153  virtual void rmap
154  (
155  const fvsPatchField<Type>&,
156  const labelList&
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
179 
180  //- Return the matrix source coefficients corresponding to the
181  // evaluation of the gradient of this patchField
183 
184 
185  //- Return the actual type
186  const word& actualType() const;
187 
188  //- Write
189  virtual void write(Ostream&) const;
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #ifdef NoRepository
200  #include "genericFvsPatchField.C"
201 #endif
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
Foam::genericFvsPatchField::TypeName
TypeName("generic")
Runtime type information.
Foam::genericFvsPatchField
This boundary condition provides a generic version of the calculated condition, useful as a fallback ...
Definition: genericFvsPatchField.H:57
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::genericFvsPatchField::clone
virtual tmp< fvsPatchField< Type > > clone() const
Construct and return a clone.
Definition: genericFvsPatchField.H:113
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::genericFvsPatchField::valueBoundaryCoeffs
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
Definition: genericFvsPatchField.C:633
Foam::fvsPatchField
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:68
Foam::genericFvsPatchField::actualType
const word & actualType() const
Return the actual type.
Definition: genericFvsPatchField.C:687
Foam::calculatedFvsPatchField
Foam::calculatedFvsPatchField.
Definition: calculatedFvsPatchField.H:51
genericFvsPatchField.C
Foam::genericFvsPatchField::gradientInternalCoeffs
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
Definition: genericFvsPatchField.C:653
Foam::genericFvsPatchField::gradientBoundaryCoeffs
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
Definition: genericFvsPatchField.C:670
Foam::genericFvsPatchField::write
virtual void write(Ostream &) const
Write.
Definition: genericFvsPatchField.C:694
Foam::genericFvsPatchField::valueInternalCoeffs
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
Definition: genericFvsPatchField.C:612
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
calculatedFvsPatchField.H
Foam::genericFvsPatchField::rmap
virtual void rmap(const fvsPatchField< Type > &, const labelList &)
Reverse map the given fvsPatchField onto this fvsPatchField.
Definition: genericFvsPatchField.C:547
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::genericFvsPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: genericFvsPatchField.C:512
Foam::HashPtrTable
A HashTable of pointers to objects of type <T>.
Definition: HashPtrTable.H:54
Foam::List< label >
HashPtrTable.H
Foam::genericFvsPatchField::genericFvsPatchField
genericFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
Definition: genericFvsPatchField.C:35
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::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54