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::cyclicPointPatchField
29 Cyclic front and back plane patch field
32 cyclicPointPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef cyclicPointPatchField_H
37 #define cyclicPointPatchField_H
39 #include "coupledPointPatchField.H"
40 #include "cyclicPointPatch.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class cyclicPointPatchField Declaration
49 \*---------------------------------------------------------------------------*/
52 class cyclicPointPatchField
54 public coupledPointPatchField<Type>
58 //- Local reference cast into the cyclic patch
59 const cyclicPointPatch& cyclicPatch_;
64 //- Runtime type information
65 TypeName(cyclicPointPatch::typeName_());
70 //- Construct from patch and internal field
74 const DimensionedField<Type, pointMesh>&
77 //- Construct from patch, internal field and dictionary
81 const DimensionedField<Type, pointMesh>&,
85 //- Construct by mapping given patchField<Type> onto a new patch
88 const cyclicPointPatchField<Type>&,
90 const DimensionedField<Type, pointMesh>&,
91 const pointPatchFieldMapper&
94 //- Construct and return a clone
95 virtual autoPtr<pointPatchField<Type> > clone() const
97 return autoPtr<pointPatchField<Type> >
99 new cyclicPointPatchField<Type>
106 //- Construct as copy setting internal field reference
107 cyclicPointPatchField
109 const cyclicPointPatchField<Type>&,
110 const DimensionedField<Type, pointMesh>&
113 //- Construct and return a clone setting internal field reference
114 virtual autoPtr<pointPatchField<Type> > clone
116 const DimensionedField<Type, pointMesh>& iF
119 return autoPtr<pointPatchField<Type> >
121 new cyclicPointPatchField<Type>
131 //- Cyclic coupled interface functions
133 //- Does the patch field perform the transfromation
134 virtual bool doTransform() const
136 return !(cyclicPatch_.parallel() || pTraits<Type>::rank == 0);
139 //- Return face transformation tensor
140 virtual const tensorField& forwardT() const
142 return cyclicPatch_.forwardT();
145 //- Return neighbour-cell transformation tensor
146 virtual const tensorField& reverseT() const
148 return cyclicPatch_.reverseT();
152 // Evaluation functions
154 //- Evaluate the patch field
155 virtual void evaluate
157 const Pstream::commsTypes commsType=Pstream::blocking
161 //- Complete swap of patch point values and add to local values
162 virtual void swapAdd(Field<Type>&) const;
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 } // End namespace Foam
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 # include "cyclicPointPatchField.C"
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 // ************************************************************************* //