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
26 Foam::cyclicFvPatchField
29 Foam::cyclicFvPatchField
34 \*---------------------------------------------------------------------------*/
36 #ifndef cyclicFvPatchField_H
37 #define cyclicFvPatchField_H
39 #include "coupledFvPatchField.H"
40 #include "cyclicLduInterfaceField.H"
41 #include "cyclicFvPatch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class cyclicFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
53 class cyclicFvPatchField
55 virtual public cyclicLduInterfaceField,
56 public coupledFvPatchField<Type>
60 //- Local reference cast into the cyclic patch
61 const cyclicFvPatch& cyclicPatch_;
64 // Private member functions
66 //- Return neighbour side field given internal fields
68 tmp<Field<Type2> > neighbourSideField
76 //- Runtime type information
77 TypeName(cyclicFvPatch::typeName_());
82 //- Construct from patch and internal field
86 const DimensionedField<Type, volMesh>&
89 //- Construct from patch, internal field and dictionary
93 const DimensionedField<Type, volMesh>&,
97 //- Construct by mapping given cyclicFvPatchField onto a new patch
100 const cyclicFvPatchField<Type>&,
102 const DimensionedField<Type, volMesh>&,
103 const fvPatchFieldMapper&
106 //- Construct as copy
109 const cyclicFvPatchField<Type>&
112 //- Construct and return a clone
113 virtual tmp<fvPatchField<Type> > clone() const
115 return tmp<fvPatchField<Type> >
117 new cyclicFvPatchField<Type>(*this)
121 //- Construct as copy setting internal field reference
124 const cyclicFvPatchField<Type>&,
125 const DimensionedField<Type, volMesh>&
128 //- Construct and return a clone setting internal field reference
129 virtual tmp<fvPatchField<Type> > clone
131 const DimensionedField<Type, volMesh>& iF
134 return tmp<fvPatchField<Type> >
136 new cyclicFvPatchField<Type>(*this, iF)
145 //- Retirn local reference cast into the cyclic patch
146 const cyclicFvPatch& cyclicPatch() const
152 // Evaluation functions
154 //- Return neighbour coupled given internal cell data
155 tmp<Field<Type> > patchNeighbourField() const;
157 //- Update result field based on interface functionality
158 virtual void updateInterfaceMatrix
160 const scalarField& psiInternal,
163 const scalarField& coeffs,
164 const direction cmpt,
165 const Pstream::commsTypes commsType
169 //- Cyclic coupled interface functions
171 //- Does the patch field perform the transfromation
172 virtual bool doTransform() const
174 return !(cyclicPatch_.parallel() || pTraits<Type>::rank == 0);
177 //- Return face transformation tensor
178 virtual const tensorField& forwardT() const
180 return cyclicPatch_.forwardT();
183 //- Return neighbour-cell transformation tensor
184 virtual const tensorField& reverseT() const
186 return cyclicPatch_.reverseT();
189 //- Return rank of component for transform
190 virtual int rank() const
192 return pTraits<Type>::rank;
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 } // End namespace Foam
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 # include "cyclicFvPatchField.C"
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 // ************************************************************************* //