initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / basic / mixed / mixedFvPatchField.H
blobd1839572a2e93685bd414cf2f10a98bb1ffe1886
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::mixedFvPatchField
28 Description
29     Foam::mixedFvPatchField
31 SourceFiles
32     mixedFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef mixedFvPatchField_H
37 #define mixedFvPatchField_H
39 #include "fvPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class mixedFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class Type>
51 class mixedFvPatchField
53     public fvPatchField<Type>
55     // Private data
57         //- Value field
58         Field<Type> refValue_;
60         //- Normal gradient field
61         Field<Type> refGrad_;
63         //- Fraction (0-1) of value used for boundary condition
64         scalarField valueFraction_;
67 public:
69     //- Runtime type information
70     TypeName("mixed");
73     // Constructors
75         //- Construct from patch and internal field
76         mixedFvPatchField
77         (
78             const fvPatch&,
79             const DimensionedField<Type, volMesh>&
80         );
82         //- Construct from patch, internal field and dictionary
83         mixedFvPatchField
84         (
85             const fvPatch&,
86             const DimensionedField<Type, volMesh>&,
87             const dictionary&
88         );
90         //- Construct by mapping the given mixedFvPatchField onto a new patch
91         mixedFvPatchField
92         (
93             const mixedFvPatchField<Type>&,
94             const fvPatch&,
95             const DimensionedField<Type, volMesh>&,
96             const fvPatchFieldMapper&
97         );
99         //- Construct as copy
100         mixedFvPatchField
101         (
102             const mixedFvPatchField<Type>&
103         );
105         //- Construct and return a clone
106         virtual tmp<fvPatchField<Type> > clone() const
107         {
108             return tmp<fvPatchField<Type> >
109             (
110                 new mixedFvPatchField<Type>(*this)
111             );
112         }
114         //- Construct as copy setting internal field reference
115         mixedFvPatchField
116         (
117             const mixedFvPatchField<Type>&,
118             const DimensionedField<Type, volMesh>&
119         );
121         //- Construct and return a clone setting internal field reference
122         virtual tmp<fvPatchField<Type> > clone
123         (
124             const DimensionedField<Type, volMesh>& iF
125         ) const
126         {
127             return tmp<fvPatchField<Type> >
128             (
129                 new mixedFvPatchField<Type>(*this, iF)
130             );
131         }
134     // Member functions
136         // Access
138             //- Return true if this patch field fixes a value.
139             //  Needed to check if a level has to be specified while solving
140             //  Poissons equations.
141             virtual bool fixesValue() const
142             {
143                 return true;
144             }
147         // Return defining fields
149             virtual Field<Type>& refValue()
150             {
151                 return refValue_;
152             }
154             virtual const Field<Type>& refValue() const
155             {
156                 return refValue_;
157             }
159             virtual Field<Type>& refGrad()
160             {
161                 return refGrad_;
162             }
164             virtual const Field<Type>& refGrad() const
165             {
166                 return refGrad_;
167             }
169             virtual scalarField& valueFraction()
170             {
171                 return valueFraction_;
172             }
174             virtual const scalarField& valueFraction() const
175             {
176                 return valueFraction_;
177             }
180         // Mapping functions
182             //- Map (and resize as needed) from self given a mapping object
183             virtual void autoMap
184             (
185                 const fvPatchFieldMapper&
186             );
188             //- Reverse map the given fvPatchField onto this fvPatchField
189             virtual void rmap
190             (
191                 const fvPatchField<Type>&,
192                 const labelList&
193             );
196         // Evaluation functions
198             //- Return gradient at boundary
199             virtual tmp<Field<Type> > snGrad() const;
201             //- Evaluate the patch field
202             virtual void evaluate
203             (
204                 const Pstream::commsTypes commsType=Pstream::blocking
205             );
207             //- Return the matrix diagonal coefficients corresponding to the
208             //  evaluation of the value of this patchField with given weights
209             virtual tmp<Field<Type> > valueInternalCoeffs
210             (
211                 const tmp<scalarField>&
212             ) const;
214             //- Return the matrix source coefficients corresponding to the
215             //  evaluation of the value of this patchField with given weights
216             virtual tmp<Field<Type> > valueBoundaryCoeffs
217             (
218                 const tmp<scalarField>&
219             ) const;
221             //- Return the matrix diagonal coefficients corresponding to the
222             //  evaluation of the gradient of this patchField
223             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
225             //- Return the matrix source coefficients corresponding to the
226             //  evaluation of the gradient of this patchField
227             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
230         //- Write
231         virtual void write(Ostream&) const;
234     // Member operators
236         virtual void operator=(const UList<Type>&) {}
238         virtual void operator=(const fvPatchField<Type>&) {}
239         virtual void operator+=(const fvPatchField<Type>&) {}
240         virtual void operator-=(const fvPatchField<Type>&) {}
241         virtual void operator*=(const fvPatchField<scalar>&) {}
242         virtual void operator/=(const fvPatchField<scalar>&) {}
244         virtual void operator+=(const Field<Type>&) {}
245         virtual void operator-=(const Field<Type>&) {}
247         virtual void operator*=(const Field<scalar>&) {}
248         virtual void operator/=(const Field<scalar>&) {}
250         virtual void operator=(const Type&) {}
251         virtual void operator+=(const Type&) {}
252         virtual void operator-=(const Type&) {}
253         virtual void operator*=(const scalar) {}
254         virtual void operator/=(const scalar) {}
258 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260 } // End namespace Foam
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
264 #ifdef NoRepository
265 #   include "mixedFvPatchField.C"
266 #endif
268 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
270 #endif
272 // ************************************************************************* //