initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / derived / expDirectionMixed / expDirectionMixedFvPatchField.H
blob009e7a9cb6986c365784347fc6617dfec126e258
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::expDirectionMixedFvPatchField
28 Description
29     Foam::expDirectionMixedFvPatchField
31 SourceFiles
32     expDirectionMixedFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef expDirectionMixedFvPatchField_H
37 #define expDirectionMixedFvPatchField_H
39 #include "fvPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class expDirectionMixedFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class Type>
51 class expDirectionMixedFvPatchField
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("expDirectionMixedMixed");
73     // Constructors
75         //- Construct from patch and internal field
76         expDirectionMixedFvPatchField
77         (
78             const fvPatch&,
79             const DimensionedField<Type, volMesh>&
80         );
82         //- Construct from patch, internal field and dictionary
83         expDirectionMixedFvPatchField
84         (
85             const fvPatch&,
86             const DimensionedField<Type, volMesh>&,
87             const dictionary&
88         );
90         //- Construct by mapping given expDirectionMixedFvPatchField
91         //  onto a new patch
92         expDirectionMixedFvPatchField
93         (
94             const expDirectionMixedFvPatchField<Type>&,
95             const fvPatch&,
96             const DimensionedField<Type, volMesh>&,
97             const fvPatchFieldMapper&
98         );
100         //- Construct as copy
101         expDirectionMixedFvPatchField
102         (
103             const expDirectionMixedFvPatchField<Type>&
104         );
106         //- Construct and return a clone
107         virtual tmp<fvPatchField<Type> > clone() const
108         {
109             return tmp<fvPatchField<Type> >
110             (
111                 new expDirectionMixedFvPatchField<Type>(*this)
112             );
113         }
115         //- Construct as copy setting internal field reference
116         expDirectionMixedFvPatchField
117         (
118             const expDirectionMixedFvPatchField<Type>&,
119             const DimensionedField<Type, volMesh>&
120         );
122         //- Construct and return a clone setting internal field reference
123         virtual tmp<fvPatchField<Type> > clone
124         (
125             const DimensionedField<Type, volMesh>& iF
126         ) const
127         {
128             return tmp<fvPatchField<Type> >
129             (
130                 new expDirectionMixedFvPatchField<Type>(*this, iF)
131             );
132         }
135     // Member functions
137         // Access
139             //- Return true if this patch field fixes a value.
140             //  Needed to check if a level has to be specified while solving
141             //  Poissons equations.
142             virtual bool fixesrefValue() const
143             {
144                 return true;
145             }
148         // Return defining fields
150             virtual Field<Type>& refValue()
151             {
152                 return refValue_;
153             }
155             virtual const Field<Type>& refValue() const
156             {
157                 return refValue_;
158             }
160             virtual Field<Type>& refGrad()
161             {
162                 return refGrad_;
163             }
165             virtual const Field<Type>& refGrad() const
166             {
167                 return refGrad_;
168             }
170             virtual scalarField& valueFraction()
171             {
172                 return valueFraction_;
173             }
175             virtual const scalarField& valueFraction() const
176             {
177                 return valueFraction_;
178             }
181         // Mapping functions
183             //- Map (and resize as needed) from self given a mapping object
184             virtual void autoMap
185             (
186                 const fvPatchFieldMapper&
187             );
189             //- Reverse map the given fvPatchField onto this fvPatchField
190             virtual void rmap
191             (
192                 const fvPatchField<Type>&,
193                 const labelList&
194             );
197         // Evaluation functions
199             //- Return gradient at boundary
200             virtual tmp<Field<Type> > snGrad() const;
202             //- Evaluate the patch field
203             virtual void evaluate
204             (
205                 const Pstream::commsTypes commsType=Pstream::blocking
206             );
208             //- Return the matrix diagonal coefficients corresponding to the
209             //  evaluation of the value of this patchField with given weights
210             virtual tmp<Field<Type> > valueInternalCoeffs
211             (
212                 const tmp<scalarField>&
213             ) const;
215             //- Return the matrix source coefficients corresponding to the
216             //  evaluation of the value of this patchField with given weights
217             virtual tmp<Field<Type> > valueBoundaryCoeffs
218             (
219                 const tmp<scalarField>&
220             ) const;
222             //- Return the matrix diagonal coefficients corresponding to the
223             //  evaluation of the gradient of this patchField
224             virtual tmp<Field<Type> > gradientInternalCoeffs() const;
226             //- Return the matrix source coefficients corresponding to the
227             //  evaluation of the gradient of this patchField
228             virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
231         //- Write
232         virtual void write(Ostream&) const;
235     // Member operators
237         virtual void operator=(const fvPatchField<Type>&) {}
238         virtual void operator+=(const fvPatchField<Type>&) {}
239         virtual void operator-=(const fvPatchField<Type>&) {}
240         virtual void operator*=(const fvPatchField<scalar>&) {}
241         virtual void operator/=(const fvPatchField<scalar>&) {}
243         virtual void operator=(const Field<Type>&) {}
244         virtual void operator+=(const Field<Type>&) {}
245         virtual void operator-=(const Field<Type>&) {}
246         virtual void operator*=(const Field<scalar>&) {}
247         virtual void operator/=(const Field<scalar>&) {}
249         virtual void operator=(const Type&) {}
250         virtual void operator+=(const Type&) {}
251         virtual void operator-=(const Type&) {}
252         virtual void operator*=(const scalar) {}
253         virtual void operator/=(const scalar) {}
257 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259 } // End namespace Foam
261 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263 #ifdef NoRepository
264 #   include "expDirectionMixedFvPatchField.C"
265 #endif
267 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
269 #endif
271 // ************************************************************************* //