1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Foam::coupledPolyPatch
28 The coupledPolyPatch is an abstract base class for patches that couple
29 regions of the computational domain e.g. cyclic and processor-processor
34 coupledPolyPatchMorph.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef coupledPolyPatch_H
39 #define coupledPolyPatch_H
41 #include "polyPatch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class coupledPolyPatch Declaration
50 \*---------------------------------------------------------------------------*/
52 class coupledPolyPatch
60 // Alowing derived classes to create their own transformation
63 //- Offset (distance) vector from one side of the couple to the other
64 mutable vectorField separation_;
66 //- Face transformation tensor
67 mutable tensorField forwardT_;
69 //- Neighbour-cell transformation tensor
70 mutable tensorField reverseT_;
73 // Protected Member Functions
75 //- Calculate the transformation tensors
76 // smallDist : matching distance per face
77 // absTol : absolute error in normal
78 void calcTransformTensors
80 const vectorField& Cf,
81 const vectorField& Cr,
82 const vectorField& nf,
83 const vectorField& nr,
84 const scalarField& smallDist,
85 const scalar absTol = matchTol_()
88 //- Initialise the calculation of the patch addressing
89 virtual void initAddressing() = 0;
91 //- Calculate the patch addressing
92 virtual void calcAddressing() = 0;
94 //- Initialise the calculation of the patch geometry
95 virtual void initGeometry() = 0;
97 //- Calculate the patch geometry
98 virtual void calcGeometry() = 0;
100 //- Initialise the patches for moving points
101 virtual void initMovePoints(const pointField&) = 0;
103 //- Correct patches after moving points
104 virtual void movePoints(const pointField&) = 0;
109 //- Runtime type information
115 //- Construct from components
122 const polyBoundaryMesh& bm
125 //- Construct from dictionary
129 const dictionary& dict,
131 const polyBoundaryMesh& bm
134 //- Construct as copy, resetting the boundary mesh
135 coupledPolyPatch(const coupledPolyPatch&, const polyBoundaryMesh&);
137 //- Construct given the original patch and resetting the
138 // face list and boundary mesh information
141 const coupledPolyPatch& pp,
142 const polyBoundaryMesh& bm,
151 virtual ~coupledPolyPatch();
158 //- Return true if patch is coupled
159 virtual bool coupled() const
165 //- Are the coupled planes separated
166 bool separated() const
168 return separation_.size();
171 //- Return the offset (distance) vector from one side of the couple
173 const vectorField& separation() const
179 //- Are the cyclic planes parallel
180 bool parallel() const
182 return forwardT_.empty();
185 //- Return face transformation tensor
186 const tensorField& forwardT() const
191 //- Return neighbour-cell transformation tensor
192 const tensorField& reverseT() const
198 //- Initialize ordering for primitivePatch. Does not
199 // refer to *this (except for name() and type() etc.)
200 virtual void initOrder(const primitivePatch&) const = 0;
202 //- Return new ordering for primitivePatch.
203 // Ordering is -faceMap: for every face
204 // index of the new face -rotation:for every new face the clockwise
205 // shift of the original face. Return false if nothing changes
206 // (faceMap is identity, rotation is 0), true otherwise.
209 const primitivePatch&,
214 //- Synchronise communications of ordering for primitivePatch
215 // Used in cases when no topological change happens locally,
216 // but is happening on other processors
217 virtual void syncOrder() const = 0;
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 } // End namespace Foam
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 // ************************************************************************* //