initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / perfectInterface / perfectInterface.H
blob3916bb3e74b6bfd647ddbb5a46a5b116a2d2910b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::perfectInterface
28 Description
29     Hack of attachDetach to couple patches when they perfectly align.
30     Does not decouple. Used by stitchMesh app. Does geometric matching.
32 SourceFiles
33     perfectInterface.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef perfectInterface_H
38 #define perfectInterface_H
40 #include "polyMeshModifier.H"
41 #include "polyPatchID.H"
42 #include "ZoneIDs.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 // Forward declaration of classes
50 class Time;
52 /*---------------------------------------------------------------------------*\
53                        Class perfectInterface Declaration
54 \*---------------------------------------------------------------------------*/
56 class perfectInterface
58     public polyMeshModifier
60     // Private data
62         //- Master face zone ID
63         faceZoneID faceZoneID_;
65         //- Master patch ID
66         polyPatchID masterPatchID_;
68         //- Slave patch ID
69         polyPatchID slavePatchID_;
71         //- Tolerance used for distance comparison (fraction of minimum edge
72         //  length)
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&);
88 public:
90     //- Runtime type information
91     TypeName("perfectInterface");
94     // Constructors
96         //- Construct from components
97         perfectInterface
98         (
99             const word& name,
100             const label index,
101             const polyTopoChanger& mme,
102             const word& faceZoneName,
103             const word& masterPatchName,
104             const word& slavePatchName
105         );
107         //- Construct from dictionary
108         perfectInterface
109         (
110             const word& name,
111             const dictionary& dict,
112             const label index,
113             const polyTopoChanger& mme
114         );
117     // Destructor
119         virtual ~perfectInterface();
122     // Member Functions
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&);
137         //- Write
138         virtual void write(Ostream&) const;
140         //- Write dictionary
141         virtual void writeDict(Ostream&) const;
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 } // End namespace Foam
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 #endif
154 // ************************************************************************* //