1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
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/>.
25 Foam::cyclicFvPatchField
28 Foam::cyclicFvPatchField
33 \*---------------------------------------------------------------------------*/
35 #ifndef cyclicFvPatchField_H
36 #define cyclicFvPatchField_H
38 #include "coupledFvPatchField.H"
39 #include "cyclicLduInterfaceField.H"
40 #include "cyclicFvPatch.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class cyclicFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
52 class cyclicFvPatchField
54 virtual public cyclicLduInterfaceField,
55 public coupledFvPatchField<Type>
59 //- Local reference cast into the cyclic patch
60 const cyclicFvPatch& cyclicPatch_;
63 // Private Member Functions
65 //- Return neighbour side field given internal fields
67 tmp<Field<Type2> > neighbourSideField
75 //- Runtime type information
76 TypeName(cyclicFvPatch::typeName_());
81 //- Construct from patch and internal field
85 const DimensionedField<Type, volMesh>&
88 //- Construct from patch, internal field and dictionary
92 const DimensionedField<Type, volMesh>&,
96 //- Construct by mapping given cyclicFvPatchField onto a new patch
99 const cyclicFvPatchField<Type>&,
101 const DimensionedField<Type, volMesh>&,
102 const fvPatchFieldMapper&
105 //- Construct as copy
108 const cyclicFvPatchField<Type>&
111 //- Construct and return a clone
112 virtual tmp<fvPatchField<Type> > clone() const
114 return tmp<fvPatchField<Type> >
116 new cyclicFvPatchField<Type>(*this)
120 //- Construct as copy setting internal field reference
123 const cyclicFvPatchField<Type>&,
124 const DimensionedField<Type, volMesh>&
127 //- Construct and return a clone setting internal field reference
128 virtual tmp<fvPatchField<Type> > clone
130 const DimensionedField<Type, volMesh>& iF
133 return tmp<fvPatchField<Type> >
135 new cyclicFvPatchField<Type>(*this, iF)
144 //- Return local reference cast into the cyclic patch
145 const cyclicFvPatch& cyclicPatch() const
151 // Evaluation functions
153 //- Return neighbour coupled internal cell data
154 tmp<Field<Type> > patchNeighbourField() const;
156 //- Return reference to neighbour patchField
157 const cyclicFvPatchField<Type>& neighbourPatchField() const;
159 //- Update result field based on interface functionality
160 virtual void updateInterfaceMatrix
162 const scalarField& psiInternal,
165 const scalarField& coeffs,
166 const direction cmpt,
167 const Pstream::commsTypes commsType
171 // Cyclic coupled interface functions
173 //- Does the patch field perform the transfromation
174 virtual bool doTransform() const
176 return !(cyclicPatch_.parallel() || pTraits<Type>::rank == 0);
179 //- Return face transformation tensor
180 virtual const tensorField& forwardT() const
182 return cyclicPatch_.forwardT();
185 //- Return neighbour-cell transformation tensor
186 virtual const tensorField& reverseT() const
188 return cyclicPatch_.reverseT();
191 //- Return rank of component for transform
192 virtual int rank() const
194 return pTraits<Type>::rank;
201 virtual void write(Ostream& os) const;
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 } // End namespace Foam
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 # include "cyclicFvPatchField.C"
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 // ************************************************************************* //