OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

repatchPolyTopoChanger.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::repatchPolyTopoChanger
00027 
00028 Description
00029     A mesh which allows changes in the patch distribution of the
00030     boundary faces.  The change in patching is set using changePatchID. For a
00031     boundary face, a new patch ID is given. 
00032 
00033 SourceFiles
00034     repatchPolyTopoChanger.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef repatchPolyTopoChanger_H
00039 #define repatchPolyTopoChanger_H
00040 
00041 #include "polyMesh.H"
00042 #include "polyTopoChange.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050                        Class repatchPolyTopoChanger Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class repatchPolyTopoChanger
00054 {
00055     // Private data
00056 
00057         //- The polyMesh to be repatched
00058         polyMesh& mesh_;
00059 
00060         //- Topological change to accumulated all mesh changes
00061         autoPtr<polyTopoChange> meshModPtr_;
00062 
00063 
00064     // Private Member Functions
00065 
00066         //- Demand driven access to polyTopoChange
00067         polyTopoChange& meshMod();
00068 
00069         //- Disallow default bitwise copy construct
00070         repatchPolyTopoChanger(const repatchPolyTopoChanger&);
00071 
00072         //- Disallow default bitwise assignment
00073         void operator=(const repatchPolyTopoChanger&);
00074 
00075 
00076 public:
00077 
00078     // Constructors
00079 
00080         //- Construct for given mesh
00081         explicit repatchPolyTopoChanger(polyMesh& mesh);
00082 
00083 
00084     // Destructor
00085 
00086         virtual ~repatchPolyTopoChanger()
00087         {}
00088 
00089 
00090     // Member Functions
00091 
00092         //- Change patches.
00093         void changePatches(const List<polyPatch*>& patches);
00094 
00095         //- Change patch ID for a boundary face. Note: patchID should be in new
00096         //  numbering.
00097         void changePatchID
00098         (
00099             const label faceID,
00100             const label patchID
00101         );
00102 
00103         //- Set zone ID for a face
00104         void setFaceZone
00105         (
00106             const label faceID,
00107             const label zoneID,
00108             const bool zoneFlip
00109         );
00110 
00111         //- Change anchor point (zero'th point of face) for a boundary face.
00112         void changeAnchorPoint
00113         (
00114             const label faceID,
00115             const label fp
00116         );
00117 
00118 
00119         //- Re-patch the mesh
00120         void repatch();
00121 };
00122 
00123 
00124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00125 
00126 } // End namespace Foam
00127 
00128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00129 
00130 #endif
00131 
00132 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd