1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-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"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Forward declaration of classes
51 /*---------------------------------------------------------------------------*\
52 Class perfectInterface Declaration
53 \*---------------------------------------------------------------------------*/
55 class perfectInterface
57 public polyMeshModifier
61 //- Master face zone ID
62 faceZoneID faceZoneID_;
65 polyPatchID masterPatchID_;
68 polyPatchID slavePatchID_;
70 //- Tolerance used for distance comparison (fraction of minimum edge
72 static const scalar tol_;
74 // Private Member Functions
76 //- Calculate face centres on patch
77 static pointField calcFaceCentres(const primitivePatch&);
80 //- Disallow default bitwise copy construct
81 perfectInterface(const perfectInterface&);
83 //- Disallow default bitwise assignment
84 void operator=(const perfectInterface&);
89 //- Runtime type information
90 TypeName("perfectInterface");
95 //- Construct from components
100 const polyTopoChanger& mme,
101 const word& faceZoneName,
102 const word& masterPatchName,
103 const word& slavePatchName
106 //- Construct from dictionary
110 const dictionary& dict,
112 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 //- Modify motion points to comply with the topological change
131 virtual void modifyMotionPoints(pointField& motionPoints) const;
133 //- Force recalculation of locally stored data on topological change
134 virtual void updateMesh(const mapPolyMesh&);
137 virtual void write(Ostream&) const;
140 virtual void writeDict(Ostream&) const;
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 } // End namespace Foam
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 // ************************************************************************* //