initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / finiteVolume / fields / fvPatchFields / basic / directionMixed / directionMixedFvPatchField.H
blob5277fc7eafb4ecfd18a3856739fbd58a2fb5f2fe
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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::directionMixedFvPatchField
28 Description
29     Foam::directionMixedFvPatchField
31 SourceFiles
32     directionMixedFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef directionMixedFvPatchField_H
37 #define directionMixedFvPatchField_H
39 #include "transformFvPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                       Class directionMixedFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class Type>
51 class directionMixedFvPatchField
53     public transformFvPatchField<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         symmTensorField valueFraction_;
67 public:
69     //- Runtime type information
70     TypeName("directionMixed");
73     // Constructors
75         //- Construct from patch and internal field
76         directionMixedFvPatchField
77         (
78             const fvPatch&,
79             const DimensionedField<Type, volMesh>&
80         );
82         //- Construct from patch, internal field and dictionary
83         directionMixedFvPatchField
84         (
85             const fvPatch&,
86             const DimensionedField<Type, volMesh>&,
87             const dictionary&
88         );
90         //- Construct by mapping given directionMixedFvPatchField onto
91         //  a new patch
92         directionMixedFvPatchField
93         (
94             const directionMixedFvPatchField<Type>&,
95             const fvPatch&,
96             const DimensionedField<Type, volMesh>&,
97             const fvPatchFieldMapper&
98         );
100         //- Construct and return a clone
101         virtual tmp<fvPatchField<Type> > clone() const
102         {
103             return tmp<fvPatchField<Type> >
104             (
105                 new directionMixedFvPatchField<Type>(*this)
106             );
107         }
109         //- Construct as copy setting internal field reference
110         directionMixedFvPatchField
111         (
112             const directionMixedFvPatchField<Type>&,
113             const DimensionedField<Type, volMesh>&
114         );
116         //- Construct and return a clone setting internal field reference
117         virtual tmp<fvPatchField<Type> > clone
118         (
119             const DimensionedField<Type, volMesh>& iF
120         ) const
121         {
122             return tmp<fvPatchField<Type> >
123             (
124                 new directionMixedFvPatchField<Type>(*this, iF)
125             );
126         }
129     // Member functions
131         // Access
133             //- Return true if this patch field fixes a value.
134             //  Needed to check if a level has to be specified while solving
135             //  Poissons equations.
136             virtual bool fixesValue() const
137             {
138                 return true;
139             }
142         // Mapping functions
144             //- Map (and resize as needed) from self given a mapping object
145             virtual void autoMap
146             (
147                 const fvPatchFieldMapper&
148             );
150             //- Reverse map the given fvPatchField onto this fvPatchField
151             virtual void rmap
152             (
153                 const fvPatchField<Type>&,
154                 const labelList&
155             );
158         // Return defining fields
160             virtual Field<Type>& refValue()
161             {
162                 return refValue_;
163             }
165             virtual const Field<Type>& refValue() const
166             {
167                 return refValue_;
168             }
170             virtual Field<Type>& refGrad()
171             {
172                 return refGrad_;
173             }
175             virtual const Field<Type>& refGrad() const
176             {
177                 return refGrad_;
178             }
180             virtual symmTensorField& valueFraction()
181             {
182                 return valueFraction_;
183             }
185             virtual const symmTensorField& valueFraction() const
186             {
187                 return valueFraction_;
188             }
191         // Evaluation functions
193             //- Return gradient at boundary
194             virtual tmp<Field<Type> > snGrad() const;
196             //- Evaluate the patch field
197             virtual void evaluate
198             (
199                 const Pstream::commsTypes commsType=Pstream::blocking
200             );
202             //- Return face-gradient transform diagonal
203             virtual tmp<Field<Type> > snGradTransformDiag() const;
206         //- Write
207         virtual void write(Ostream&) const;
210     // Member operators
212         virtual void operator=(const fvPatchField<Type>&) {}
213         virtual void operator+=(const fvPatchField<Type>&) {}
214         virtual void operator-=(const fvPatchField<Type>&) {}
215         virtual void operator*=(const fvPatchField<Type>&) {}
216         virtual void operator/=(const fvPatchField<Type>&) {}
218         virtual void operator=(const Field<Type>&) {}
219         virtual void operator+=(const Field<Type>&) {}
220         virtual void operator-=(const Field<Type>&) {}
221         virtual void operator*=(const Field<scalar>&) {}
222         virtual void operator/=(const Field<scalar>&) {}
224         virtual void operator=(const Type&) {}
225         virtual void operator+=(const Type&) {}
226         virtual void operator-=(const Type&) {}
227         virtual void operator*=(const scalar) {}
228         virtual void operator/=(const scalar) {}
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 } // End namespace Foam
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 #ifdef NoRepository
239 #   include "directionMixedFvPatchField.C"
240 #endif
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 #endif
246 // ************************************************************************* //