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 calculatedFaPatchField
31 calculatedFaPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef calculatedFaPatchField_H
36 #define calculatedFaPatchField_H
38 #include "faPatchField.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class calculatedFaPatch Declaration
47 \*---------------------------------------------------------------------------*/
50 class calculatedFaPatchField
52 public faPatchField<Type>
57 //- Runtime type information
58 TypeName("calculated");
63 //- Construct from patch and internal field
64 calculatedFaPatchField
67 const DimensionedField<Type, areaMesh>&
70 //- Construct from patch, internal field and dictionary
71 calculatedFaPatchField
74 const DimensionedField<Type, areaMesh>&,
78 //- Construct by mapping given patchField<Type> onto a new patch
79 calculatedFaPatchField
81 const calculatedFaPatchField<Type>&,
83 const DimensionedField<Type, areaMesh>&,
84 const faPatchFieldMapper&
88 calculatedFaPatchField
90 const calculatedFaPatchField<Type>&
93 //- Construct and return a clone
94 virtual tmp<faPatchField<Type> > clone() const
96 return tmp<faPatchField<Type> >
98 new calculatedFaPatchField<Type>(*this)
102 //- Construct as copy setting internal field reference
103 calculatedFaPatchField
105 const calculatedFaPatchField<Type>&,
106 const DimensionedField<Type, areaMesh>&
109 //- Construct and return a clone setting internal field reference
110 virtual tmp<faPatchField<Type> > clone
112 const DimensionedField<Type, areaMesh>& iF
115 return tmp<faPatchField<Type> >
117 new calculatedFaPatchField<Type>(*this, iF)
126 //- Return true if this patch field fixes a value.
127 // Needed to check if a level has to be specified while solving
128 // Poissons equations.
129 virtual bool fixesValue() const
135 // Evaluation functions
137 //- Return the matrix diagonal coefficients corresponding to the
138 // evaluation of the value of this patchField with given weights
139 virtual tmp<Field<Type> > valueInternalCoeffs
141 const tmp<scalarField>&
144 //- Return the matrix source coefficients corresponding to the
145 // evaluation of the value of this patchField with given weights
146 virtual tmp<Field<Type> > valueBoundaryCoeffs
148 const tmp<scalarField>&
151 //- Return the matrix diagonal coefficients corresponding to the
152 // evaluation of the gradient of this patchField
153 tmp<Field<Type> > gradientInternalCoeffs() const;
155 //- Return the matrix source coefficients corresponding to the
156 // evaluation of the gradient of this patchField
157 tmp<Field<Type> > gradientBoundaryCoeffs() const;
161 virtual void write(Ostream&) const;
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 # include "calculatedFaPatchField.C"
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 // ************************************************************************* //