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
25 \*---------------------------------------------------------------------------*/
27 #include "wedgePointPatchField.H"
28 #include "transformField.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 wedgePointPatchField<Type>::wedgePointPatchField
41 const DimensionedField<Type, pointMesh>& iF
44 pointPatchField<Type>(p, iF)
49 wedgePointPatchField<Type>::wedgePointPatchField
52 const DimensionedField<Type, pointMesh>& iF,
53 const dictionary& dict
56 pointPatchField<Type>(p, iF, dict)
58 if (!isType<wedgePointPatch>(p))
62 "wedgePointPatchField<Type>::wedgePointPatchField\n"
64 " const pointPatch& p,\n"
65 " const Field<Type>& field,\n"
66 " const dictionary& dict\n"
69 ) << "patch " << this->patch().index() << " not wedge type. "
70 << "Patch type = " << p.type()
71 << exit(FatalIOError);
77 wedgePointPatchField<Type>::wedgePointPatchField
79 const wedgePointPatchField<Type>& ptf,
81 const DimensionedField<Type, pointMesh>& iF,
82 const pointPatchFieldMapper&
85 pointPatchField<Type>(p, iF)
87 if (!isType<wedgePointPatch>(this->patch()))
91 "wedgePointPatchField<Type>::wedgePointPatchField\n"
93 " const wedgePointPatchField<Type>& ptf,\n"
94 " const pointPatch& p,\n"
95 " const DimensionedField<Type, pointMesh>& iF,\n"
96 " const pointPatchFieldMapper& mapper\n"
98 ) << "Field type does not correspond to patch type for patch "
99 << this->patch().index() << "." << endl
100 << "Field type: " << typeName << endl
101 << "Patch type: " << this->patch().type()
108 wedgePointPatchField<Type>::wedgePointPatchField
110 const wedgePointPatchField<Type>& ptf,
111 const DimensionedField<Type, pointMesh>& iF
114 pointPatchField<Type>(ptf, iF)
118 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
121 void wedgePointPatchField<Type>::evaluate(const Pstream::commsTypes)
123 // In order to ensure that the wedge patch is always flat, take the
124 // normal vector from the first point
125 const vector& nHat = this->patch().pointNormals()[0];
127 tmp<Field<Type> > tvalues =
128 transform(I - nHat*nHat, this->patchInternalField());
130 // Get internal field to insert values into
131 Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
133 setInInternalField(iF, tvalues());
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // ************************************************************************* //