1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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::perfectInterface
29 Hack of attachDetach to couple patches when they perfectly align.
30 Does not decouple. Used by stitchMesh app. Does geometric matching.
35 \*---------------------------------------------------------------------------*/
37 #ifndef perfectInterface_H
38 #define perfectInterface_H
40 #include "polyMeshModifier.H"
41 #include "polyPatchID.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 primitivePatch&);
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
119 virtual ~perfectInterface();
124 //- Check for topology change
125 virtual bool changeTopology() const;
127 //- Insert the layer addition/removal instructions
128 // into the topological change
129 virtual void setRefinement(polyTopoChange&) const;
131 //- Modify motion points to comply with the topological change
132 virtual void modifyMotionPoints(pointField& motionPoints) const;
134 //- Force recalculation of locally stored data on topological change
135 virtual void updateMesh(const mapPolyMesh&);
138 virtual void write(Ostream&) const;
141 virtual void writeDict(Ostream&) const;
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 } // End namespace Foam
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 // ************************************************************************* //