1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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::mixedPointPatchField
29 A mixed FixedValue / ZeroGradient boundary condition for pointField.
31 I am still not sure how to do the FixedValue-fixedGradient combination.
34 mixedPointPatchField.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef mixedPointPatchField_H
39 #define mixedPointPatchField_H
41 #include "valuePointPatchField.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class mixedPointPatchField Declaration
50 \*---------------------------------------------------------------------------*/
53 class mixedPointPatchField
55 public valuePointPatchField<Type>
60 Field<Type> refValue_;
62 //- Fraction (0-1) of value used for boundary condition
63 scalarField valueFraction_;
66 // Private member functions
68 void checkFieldSize() const;
73 //- Runtime type information
79 //- Construct from patch and internal field
83 const DimensionedField<Type, pointMesh>&
86 //- Construct from patch, internal field and dictionary
90 const DimensionedField<Type, pointMesh>&,
94 //- Construct by mapping given patchField<Type> onto a new patch
97 const mixedPointPatchField<Type>&,
99 const DimensionedField<Type, pointMesh>&,
100 const pointPatchFieldMapper&
103 //- Construct and return a clone
104 virtual autoPtr<pointPatchField<Type> > clone() const
106 return autoPtr<pointPatchField<Type> >
108 new mixedPointPatchField<Type>
115 //- Construct as copy setting internal field reference
118 const mixedPointPatchField<Type>&,
119 const DimensionedField<Type, pointMesh>&
122 //- Construct and return a clone setting internal field reference
123 virtual autoPtr<pointPatchField<Type> > clone
125 const DimensionedField<Type, pointMesh>& iF
128 return autoPtr<pointPatchField<Type> >
130 new mixedPointPatchField<Type>
141 // Return defining fields
143 virtual Field<Type>& refValue()
148 virtual const Field<Type>& refValue() const
153 virtual scalarField& valueFraction()
155 return valueFraction_;
158 virtual const scalarField& valueFraction() const
160 return valueFraction_;
166 //- Map (and resize as needed) from self given a mapping object
169 const pointPatchFieldMapper&
172 //- Reverse map the given PointPatchField onto
173 // this PointPatchField
176 const pointPatchField<Type>&,
181 // Evaluation functions
183 //- Update the patch field
184 virtual void evaluate
186 const Pstream::commsTypes commsType=Pstream::blocking
191 virtual void write(Ostream&) const;
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 # include "mixedPointPatchField.C"
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 // ************************************************************************* //