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::perfectInterface
28 Hack of attachDetach to couple patches when they perfectly align.
29 Does not decouple. Used by stitchMesh app. Does geometric matching.
34 \*---------------------------------------------------------------------------*/
36 #ifndef perfectInterface_H
37 #define perfectInterface_H
39 #include "polyMeshModifier.H"
40 #include "polyPatchID.H"
42 #include "indirectPrimitivePatch.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Forward declaration of classes
52 /*---------------------------------------------------------------------------*\
53 Class perfectInterface Declaration
54 \*---------------------------------------------------------------------------*/
56 class perfectInterface
58 public polyMeshModifier
62 //- Master face zone ID
63 faceZoneID faceZoneID_;
66 polyPatchID masterPatchID_;
69 polyPatchID slavePatchID_;
71 //- Tolerance used for distance comparison (fraction of minimum edge
73 static const scalar tol_;
75 // Private Member Functions
77 //- Calculate face centres on patch
78 static pointField calcFaceCentres(const indirectPrimitivePatch&);
81 //- Disallow default bitwise copy construct
82 perfectInterface(const perfectInterface&);
84 //- Disallow default bitwise assignment
85 void operator=(const perfectInterface&);
90 //- Runtime type information
91 TypeName("perfectInterface");
96 //- Construct from components
101 const polyTopoChanger& mme,
102 const word& faceZoneName,
103 const word& masterPatchName,
104 const word& slavePatchName
107 //- Construct from dictionary
111 const dictionary& dict,
113 const polyTopoChanger& mme
118 virtual ~perfectInterface();
123 //- Check for topology change
124 virtual bool changeTopology() const;
126 //- Insert the layer addition/removal instructions
127 // into the topological change
128 virtual void setRefinement(polyTopoChange&) const;
130 //- Insert the layer addition/removal instructions
131 // into the topological change. Uses only mesh, not any of the
132 // patch and zone indices. Bit of a workaround - used in extruding
134 virtual void setRefinement
136 const indirectPrimitivePatch& pp0,
137 const indirectPrimitivePatch& pp1,
141 //- Modify motion points to comply with the topological change
142 virtual void modifyMotionPoints(pointField& motionPoints) const;
144 //- Force recalculation of locally stored data on topological change
145 virtual void updateMesh(const mapPolyMesh&);
148 virtual void write(Ostream&) const;
151 virtual void writeDict(Ostream&) const;
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 } // End namespace Foam
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 // ************************************************************************* //