00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::perfectInterface 00026 00027 Description 00028 Hack of attachDetach to couple patches when they perfectly align. 00029 Does not decouple. Used by stitchMesh app. Does geometric matching. 00030 00031 SourceFiles 00032 perfectInterface.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef perfectInterface_H 00037 #define perfectInterface_H 00038 00039 #include <dynamicMesh/polyMeshModifier.H> 00040 #include <OpenFOAM/polyPatchID.H> 00041 #include <OpenFOAM/ZoneIDs.H> 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 // Forward declaration of classes 00049 class Time; 00050 00051 /*---------------------------------------------------------------------------*\ 00052 Class perfectInterface Declaration 00053 \*---------------------------------------------------------------------------*/ 00054 00055 class perfectInterface 00056 : 00057 public polyMeshModifier 00058 { 00059 // Private data 00060 00061 //- Master face zone ID 00062 faceZoneID faceZoneID_; 00063 00064 //- Master patch ID 00065 polyPatchID masterPatchID_; 00066 00067 //- Slave patch ID 00068 polyPatchID slavePatchID_; 00069 00070 //- Tolerance used for distance comparison (fraction of minimum edge 00071 // length) 00072 static const scalar tol_; 00073 00074 // Private Member Functions 00075 00076 //- Calculate face centres on patch 00077 static pointField calcFaceCentres(const primitivePatch&); 00078 00079 00080 //- Disallow default bitwise copy construct 00081 perfectInterface(const perfectInterface&); 00082 00083 //- Disallow default bitwise assignment 00084 void operator=(const perfectInterface&); 00085 00086 00087 public: 00088 00089 //- Runtime type information 00090 TypeName("perfectInterface"); 00091 00092 00093 // Constructors 00094 00095 //- Construct from components 00096 perfectInterface 00097 ( 00098 const word& name, 00099 const label index, 00100 const polyTopoChanger& mme, 00101 const word& faceZoneName, 00102 const word& masterPatchName, 00103 const word& slavePatchName 00104 ); 00105 00106 //- Construct from dictionary 00107 perfectInterface 00108 ( 00109 const word& name, 00110 const dictionary& dict, 00111 const label index, 00112 const polyTopoChanger& mme 00113 ); 00114 00115 00116 // Destructor 00117 00118 virtual ~perfectInterface(); 00119 00120 00121 // Member Functions 00122 00123 //- Check for topology change 00124 virtual bool changeTopology() const; 00125 00126 //- Insert the layer addition/removal instructions 00127 // into the topological change 00128 virtual void setRefinement(polyTopoChange&) const; 00129 00130 //- Modify motion points to comply with the topological change 00131 virtual void modifyMotionPoints(pointField& motionPoints) const; 00132 00133 //- Force recalculation of locally stored data on topological change 00134 virtual void updateMesh(const mapPolyMesh&); 00135 00136 //- Write 00137 virtual void write(Ostream&) const; 00138 00139 //- Write dictionary 00140 virtual void writeDict(Ostream&) const; 00141 00142 }; 00143 00144 00145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00146 00147 } // End namespace Foam 00148 00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00150 00151 #endif 00152 00153 // ************************ vim: set sw=4 sts=4 et: ************************ //