1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "cyclicSlipPointPatchField.H"
27 #include "transformField.H"
28 #include "symmTransformField.H"
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
37 const DimensionedField<Type, pointMesh>& iF
40 cyclicPointPatchField<Type>(p, iF)
45 Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
48 const DimensionedField<Type, pointMesh>& iF,
49 const dictionary& dict
52 cyclicPointPatchField<Type>(p, iF, dict)
57 Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
59 const cyclicSlipPointPatchField<Type>& ptf,
61 const DimensionedField<Type, pointMesh>& iF,
62 const pointPatchFieldMapper& mapper
65 cyclicPointPatchField<Type>(ptf, p, iF, mapper)
70 Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
72 const cyclicSlipPointPatchField<Type>& ptf,
73 const DimensionedField<Type, pointMesh>& iF
76 cyclicPointPatchField<Type>(ptf, iF)
80 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
83 void Foam::cyclicSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes)
85 const vectorField& nHat = this->patch().pointNormals();
87 tmp<Field<Type> > tvalues =
90 this->patchInternalField()
91 + transform(I - 2.0*sqr(nHat), this->patchInternalField())
95 // Get internal field to insert values into
96 Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
98 this->setInInternalField(iF, tvalues());
102 // ************************************************************************* //