Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / finiteVolume / fields / fvPatchFields / basic / generic / genericFvPatchField.H
blobd54445712120ff37d04dee0f91674dde2708d182
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::genericFvPatchField
27 Description
28     Foam::genericFvPatchField
30 SourceFiles
31     genericFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef genericFvPatchField_H
36 #define genericFvPatchField_H
38 #include "calculatedFvPatchField.H"
39 #include "HashPtrTable.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                       Class genericFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class Type>
51 class genericFvPatchField
53     public calculatedFvPatchField<Type>
55     // Private data
57         word actualTypeName_;
58         dictionary dict_;
60         HashPtrTable<scalarField> scalarFields_;
61         HashPtrTable<vectorField> vectorFields_;
62         HashPtrTable<sphericalTensorField> sphericalTensorFields_;
63         HashPtrTable<symmTensorField> symmTensorFields_;
64         HashPtrTable<symmTensor4thOrderField> symmTensor4thOrderFields_;
65         HashPtrTable<diagTensorField> diagTensorFields_;
66         HashPtrTable<tensorField> tensorFields_;
69 public:
71     //- Runtime type information
72     TypeName("generic");
75     // Constructors
77         //- Construct from patch and internal field
78         genericFvPatchField
79         (
80             const fvPatch&,
81             const DimensionedField<Type, volMesh>&
82         );
84         //- Construct from patch, internal field and dictionary
85         genericFvPatchField
86         (
87             const fvPatch&,
88             const DimensionedField<Type, volMesh>&,
89             const dictionary&
90         );
92         //- Construct by mapping given patchField<Type> onto a new patch
93         genericFvPatchField
94         (
95             const genericFvPatchField<Type>&,
96             const fvPatch&,
97             const DimensionedField<Type, volMesh>&,
98             const fvPatchFieldMapper&
99         );
101         //- Construct as copy
102         genericFvPatchField
103         (
104             const genericFvPatchField<Type>&
105         );
107         //- Construct and return a clone
108         virtual tmp<fvPatchField<Type> > clone() const
109         {
110             return tmp<fvPatchField<Type> >
111             (
112                 new genericFvPatchField<Type>(*this)
113             );
114         }
116         //- Construct as copy setting internal field reference
117         genericFvPatchField
118         (
119             const genericFvPatchField<Type>&,
120             const DimensionedField<Type, volMesh>&
121         );
123         //- Construct and return a clone setting internal field reference
124         virtual tmp<fvPatchField<Type> > clone
125         (
126             const DimensionedField<Type, volMesh>& iF
127         ) const
128         {
129             return tmp<fvPatchField<Type> >
130             (
131                 new genericFvPatchField<Type>(*this, iF)
132             );
133         }
136     // Member functions
138         // Mapping functions
140             //- Map (and resize as needed) from self given a mapping object
141             virtual void autoMap
142             (
143                 const fvPatchFieldMapper&
144             );
146             //- Reverse map the given fvPatchField onto this fvPatchField
147             virtual void rmap
148             (
149                 const fvPatchField<Type>&,
150                 const labelList&
151             );
154         // Evaluation functions
156             //- Return the matrix diagonal coefficients corresponding to the
157             //  evaluation of the value of this patchField with given weights
158             virtual tmp<Field<Type> > valueInternalCoeffs
159             (
160                 const tmp<scalarField>&
161             ) const;
163             //- Return the matrix source coefficients corresponding to the
164             //  evaluation of the value of this patchField with given weights
165             virtual tmp<Field<Type> > valueBoundaryCoeffs
166             (
167                 const tmp<scalarField>&
168             ) const;
170             //- Return the matrix diagonal coefficients corresponding to the
171             //  evaluation of the gradient of this patchField
172             tmp<Field<Type> > gradientInternalCoeffs() const;
174             //- Return the matrix source coefficients corresponding to the
175             //  evaluation of the gradient of this patchField
176             tmp<Field<Type> > gradientBoundaryCoeffs() const;
179         //- Write
180         virtual void write(Ostream&) const;
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 } // End namespace Foam
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 #ifdef NoRepository
191 #   include "genericFvPatchField.C"
192 #endif
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 #endif
198 // ************************************************************************* //