1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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::mixedFvPatchField
29 Foam::mixedFvPatchField
34 \*---------------------------------------------------------------------------*/
36 #ifndef mixedFvPatchField_H
37 #define mixedFvPatchField_H
39 #include "fvPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class mixedFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
51 class mixedFvPatchField
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
75 //- Construct from patch and internal field
79 const DimensionedField<Type, volMesh>&
82 //- Construct from patch, internal field and dictionary
86 const DimensionedField<Type, volMesh>&,
90 //- Construct by mapping the given mixedFvPatchField onto a new patch
93 const mixedFvPatchField<Type>&,
95 const DimensionedField<Type, volMesh>&,
96 const fvPatchFieldMapper&
102 const mixedFvPatchField<Type>&
105 //- Construct and return a clone
106 virtual tmp<fvPatchField<Type> > clone() const
108 return tmp<fvPatchField<Type> >
110 new mixedFvPatchField<Type>(*this)
114 //- Construct as copy setting internal field reference
117 const mixedFvPatchField<Type>&,
118 const DimensionedField<Type, volMesh>&
121 //- Construct and return a clone setting internal field reference
122 virtual tmp<fvPatchField<Type> > clone
124 const DimensionedField<Type, volMesh>& iF
127 return tmp<fvPatchField<Type> >
129 new mixedFvPatchField<Type>(*this, iF)
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
147 // Return defining fields
149 virtual Field<Type>& refValue()
154 virtual const Field<Type>& refValue() const
159 virtual Field<Type>& refGrad()
164 virtual const Field<Type>& refGrad() const
169 virtual scalarField& valueFraction()
171 return valueFraction_;
174 virtual const scalarField& valueFraction() const
176 return valueFraction_;
182 //- Map (and resize as needed) from self given a mapping object
185 const fvPatchFieldMapper&
188 //- Reverse map the given fvPatchField onto this fvPatchField
191 const fvPatchField<Type>&,
196 // Evaluation functions
198 //- Return gradient at boundary
199 virtual tmp<Field<Type> > snGrad() const;
201 //- Evaluate the patch field
202 virtual void evaluate
204 const Pstream::commsTypes commsType=Pstream::blocking
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
211 const tmp<scalarField>&
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
218 const tmp<scalarField>&
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;
231 virtual void write(Ostream&) const;
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265 # include "mixedFvPatchField.C"
268 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
272 // ************************************************************************* //