1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
26 Foam::expDirectionMixedFvPatchField
29 Foam::expDirectionMixedFvPatchField
32 expDirectionMixedFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef expDirectionMixedFvPatchField_H
37 #define expDirectionMixedFvPatchField_H
39 #include "fvPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class expDirectionMixedFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
51 class expDirectionMixedFvPatchField
53 public fvPatchField<Type>
58 Field<Type> refValue_;
60 //- Normal gradient field
63 //- Fraction (0-1) of value used for boundary condition
64 scalarField valueFraction_;
69 //- Runtime type information
70 TypeName("expDirectionMixedMixed");
75 //- Construct from patch and internal field
76 expDirectionMixedFvPatchField
79 const DimensionedField<Type, volMesh>&
82 //- Construct from patch, internal field and dictionary
83 expDirectionMixedFvPatchField
86 const DimensionedField<Type, volMesh>&,
90 //- Construct by mapping given expDirectionMixedFvPatchField
92 expDirectionMixedFvPatchField
94 const expDirectionMixedFvPatchField<Type>&,
96 const DimensionedField<Type, volMesh>&,
97 const fvPatchFieldMapper&
100 //- Construct as copy
101 expDirectionMixedFvPatchField
103 const expDirectionMixedFvPatchField<Type>&
106 //- Construct and return a clone
107 virtual tmp<fvPatchField<Type> > clone() const
109 return tmp<fvPatchField<Type> >
111 new expDirectionMixedFvPatchField<Type>(*this)
115 //- Construct as copy setting internal field reference
116 expDirectionMixedFvPatchField
118 const expDirectionMixedFvPatchField<Type>&,
119 const DimensionedField<Type, volMesh>&
122 //- Construct and return a clone setting internal field reference
123 virtual tmp<fvPatchField<Type> > clone
125 const DimensionedField<Type, volMesh>& iF
128 return tmp<fvPatchField<Type> >
130 new expDirectionMixedFvPatchField<Type>(*this, iF)
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
148 // Return defining fields
150 virtual Field<Type>& refValue()
155 virtual const Field<Type>& refValue() const
160 virtual Field<Type>& refGrad()
165 virtual const Field<Type>& refGrad() const
170 virtual scalarField& valueFraction()
172 return valueFraction_;
175 virtual const scalarField& valueFraction() const
177 return valueFraction_;
183 //- Map (and resize as needed) from self given a mapping object
186 const fvPatchFieldMapper&
189 //- Reverse map the given fvPatchField onto this fvPatchField
192 const fvPatchField<Type>&,
197 // Evaluation functions
199 //- Return gradient at boundary
200 virtual tmp<Field<Type> > snGrad() const;
202 //- Evaluate the patch field
203 virtual void evaluate
205 const Pstream::commsTypes commsType=Pstream::blocking
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
212 const tmp<scalarField>&
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
219 const tmp<scalarField>&
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;
232 virtual void write(Ostream&) const;
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
264 # include "expDirectionMixedFvPatchField.C"
267 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
271 // ************************************************************************* //