BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / finiteVolume / fields / fvPatchFields / basic / fixedGradient / fixedGradientFvPatchField.H
blobcdf83f486ab1274f00d86baafbe4ef82443db4df
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Class
25     Foam::fixedGradientFvPatchField
27 Description
28     Foam::fixedGradientFvPatchField
30 SourceFiles
31     fixedGradientFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef fixedGradientFvPatchField_H
36 #define fixedGradientFvPatchField_H
38 #include "fvPatchField.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                            Class fixedGradientFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class Type>
50 class fixedGradientFvPatchField
52     public fvPatchField<Type>
54     // Private data
56         Field<Type> gradient_;
59 public:
61     //- Runtime type information
62     TypeName("fixedGradient");
65     // Constructors
67         //- Construct from patch and internal field
68         fixedGradientFvPatchField
69         (
70             const fvPatch&,
71             const DimensionedField<Type, volMesh>&
72         );
74         //- Construct from patch, internal field and dictionary
75         fixedGradientFvPatchField
76         (
77             const fvPatch&,
78             const DimensionedField<Type, volMesh>&,
79             const dictionary&
80         );
82         //- Construct by mapping the given fixedGradientFvPatchField
83         //  onto a new patch
84         fixedGradientFvPatchField
85         (
86             const fixedGradientFvPatchField<Type>&,
87             const fvPatch&,
88             const DimensionedField<Type, volMesh>&,
89             const fvPatchFieldMapper&
90         );
92         //- Construct as copy
93         fixedGradientFvPatchField
94         (
95             const fixedGradientFvPatchField<Type>&
96         );
98         //- Construct and return a clone
99         virtual tmp<fvPatchField<Type> > clone() const
100         {
101             return tmp<fvPatchField<Type> >
102             (
103                 new fixedGradientFvPatchField<Type>(*this)
104             );
105         }
107         //- Construct as copy setting internal field reference
108         fixedGradientFvPatchField
109         (
110             const fixedGradientFvPatchField<Type>&,
111             const DimensionedField<Type, volMesh>&
112         );
114         //- Construct and return a clone setting internal field reference
115         virtual tmp<fvPatchField<Type> > clone
116         (
117             const DimensionedField<Type, volMesh>& iF
118         ) const
119         {
120             return tmp<fvPatchField<Type> >
121             (
122                 new fixedGradientFvPatchField<Type>(*this, iF)
123             );
124         }
127     // Member functions
129         // Return defining fields
131             //- Return gradient at boundary
132             virtual Field<Type>& gradient()
133             {
134                 return gradient_;
135             }
137             virtual const Field<Type>& gradient() const
138             {
139                 return gradient_;
140             }
143         // Mapping functions
145             //- Map (and resize as needed) from self given a mapping object
146             virtual void autoMap
147             (
148                 const fvPatchFieldMapper&
149             );
151             //- Reverse map the given fvPatchField onto this fvPatchField
152             virtual void rmap
153             (
154                 const fvPatchField<Type>&,
155                 const labelList&
156             );
159         // Evaluation functions
161             //- Return gradient at boundary
162             virtual tmp<Field<Type> > snGrad() const
163             {
164                 return gradient_;
165             }
167             //- Evaluate the patch field
168             virtual void evaluate
169             (
170                 const Pstream::commsTypes commsType=Pstream::blocking
171             );
173             //- Return the matrix diagonal coefficients corresponding to the
174             //  evaluation of the value of this patchField with given weights
175             virtual tmp<Field<Type> > valueInternalCoeffs
176             (
177                 const tmp<scalarField>&
178             ) const;
180             //- Return the matrix source coefficients corresponding to the
181             //  evaluation of the value of this patchField with given weights
182             virtual tmp<Field<Type> > valueBoundaryCoeffs
183             (
184                 const tmp<scalarField>&
185             ) const;
187             //- Return the matrix diagonal coefficients corresponding to the
188             //  evaluation of the gradient of this patchField
189             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
191             //- Return the matrix source coefficients corresponding to the
192             //  evaluation of the gradient of this patchField
193             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
196         //- Write
197         virtual void write(Ostream&) const;
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 } // End namespace Foam
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 #ifdef NoRepository
208 #   include "fixedGradientFvPatchField.C"
209 #endif
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 #endif
215 // ************************************************************************* //