ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / OpenFOAM / fields / pointPatchFields / constraint / cyclicSlip / cyclicSlipPointPatchField.C
blob0b822b1a4300a16c9512026a1750bc7310b35cb8
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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  * * * * * * * * * * * * * * //
33 template<class Type>
34 Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
36     const pointPatch& p,
37     const DimensionedField<Type, pointMesh>& iF
40     cyclicPointPatchField<Type>(p, iF)
44 template<class Type>
45 Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
47     const pointPatch& p,
48     const DimensionedField<Type, pointMesh>& iF,
49     const dictionary& dict
52     cyclicPointPatchField<Type>(p, iF, dict)
56 template<class Type>
57 Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
59     const cyclicSlipPointPatchField<Type>& ptf,
60     const pointPatch& p,
61     const DimensionedField<Type, pointMesh>& iF,
62     const pointPatchFieldMapper& mapper
65     cyclicPointPatchField<Type>(ptf, p, iF, mapper)
69 template<class Type>
70 Foam::cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
72     const cyclicSlipPointPatchField<Type>& ptf,
73     const DimensionedField<Type, pointMesh>& iF
76     cyclicPointPatchField<Type>(ptf, iF)
80 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
82 template<class Type>
83 void Foam::cyclicSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes)
85     const vectorField& nHat = this->patch().pointNormals();
87     tmp<Field<Type> > tvalues =
88     (
89         (
90             this->patchInternalField()
91           + transform(I - 2.0*sqr(nHat), this->patchInternalField())
92         )/2.0
93     );
95     // Get internal field to insert values into
96     Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
98     this->setInInternalField(iF, tvalues());
102 // ************************************************************************* //