OpenFOAM logo
Open Source CFD Toolkit

polyMeshModifier.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-2005 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     polyMeshModifier
00027 
00028 Description
00029     Virtual base class for mesh modifiers.
00030 
00031 SourceFiles
00032     polyMeshModifier.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef polyMeshModifier_H
00037 #define polyMeshModifier_H
00038 
00039 #include "label.H"
00040 #include "word.H"
00041 #include "Switch.H"
00042 #include "typeInfo.H"
00043 #include "runTimeSelectionTables.H"
00044 #include "autoPtr.H"
00045 #include "pointField.H"
00046 #include "faceList.H"
00047 #include "cellList.H"
00048 
00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00050 
00051 namespace Foam
00052 {
00053 
00054 // Class forward declarations
00055 class polyTopoChanger;
00056 class polyTopoChange;
00057 class mapPolyMesh;
00058 
00059 /*---------------------------------------------------------------------------*\
00060                        Class polyMeshModifier Declaration
00061 \*---------------------------------------------------------------------------*/
00062 
00063 class polyMeshModifier
00064 {
00065     // Private data
00066 
00067         //- Name of zone
00068         word name_;
00069 
00070         //- Index of zone
00071         label index_;
00072 
00073         //- Reference to morph engine
00074         const polyTopoChanger& topoChanger_;
00075 
00076         //- Activation switch
00077         mutable Switch active_;
00078 
00079 
00080     // Private Member Functions
00081 
00082         //- Disallow default bitwise copy construct
00083         polyMeshModifier(const polyMeshModifier&);
00084 
00085         //- Disallow default bitwise assignment
00086         void operator=(const polyMeshModifier&);
00087 
00088 
00089 public:
00090 
00091     // Static data members
00092 
00093         //- Runtime type information
00094         TypeName("meshModifier");
00095 
00096 
00097     // Declare run-time constructor selection tables
00098 
00099         declareRunTimeSelectionTable
00100         (
00101             autoPtr,
00102             polyMeshModifier,
00103             dictionary,
00104             (
00105                 const word& name,
00106                 const dictionary& dict,
00107                 const label index,
00108                 const polyTopoChanger& mme
00109             ),
00110             (name, dict, index, mme)
00111         );
00112 
00113 
00114     // Constructors
00115 
00116         //- Construct from components
00117         polyMeshModifier
00118         (
00119             const word& name,
00120             const label index,
00121             const polyTopoChanger& mme,
00122             const bool act
00123         );
00124 
00125 
00126     // Selectors
00127 
00128         //- Select constructed from dictionary
00129         static autoPtr<polyMeshModifier> New
00130         (
00131             const word& name,
00132             const dictionary& dict,
00133             const label index,
00134             const polyTopoChanger& mme
00135         );
00136 
00137 
00138     // Destructor
00139 
00140         virtual ~polyMeshModifier();
00141 
00142 
00143     // Member Functions
00144 
00145         //- Return name
00146         const word& name() const
00147         {
00148             return name_;
00149         }
00150 
00151         //- Return the index of this patch in the boundaryMesh
00152         label index() const
00153         {
00154             return index_;
00155         }
00156 
00157         //- Return reference to morph engine
00158         const polyTopoChanger& topoChanger() const;
00159 
00160         //- Check for topology change
00161         virtual bool changeTopology() const = 0;
00162 
00163         //- Insert the topological change instructions
00164         virtual void setRefinement(polyTopoChange&) const = 0;
00165 
00166         //- Modify motion points to comply with the topological change
00167         virtual void modifyMotionPoints(pointField& motionPoints) const = 0;
00168 
00169         //- Force recalculation of locally stored data on topological change
00170         virtual void updateMesh(const mapPolyMesh&) = 0;
00171 
00172 
00173         // Activation and deactivation
00174 
00175             const Switch& active() const
00176             {
00177                 return active_;
00178             }
00179 
00180             //- Activate mesh modifier
00181             void enable() const
00182             {
00183                 active_ = true;
00184             }
00185 
00186             //- Activate mesh modifier
00187             void disable() const
00188             {
00189                 active_ = false;
00190             }
00191 
00192 
00193         //- Write
00194         virtual void write(Ostream&) const = 0;
00195 
00196         //- Write dictionary
00197         virtual void writeDict(Ostream&) const = 0;
00198 
00199 
00200     // Ostream Operator
00201 
00202         friend Ostream& operator<<(Ostream&, const polyMeshModifier&);
00203 };
00204 
00205 
00206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00207 
00208 } // End namespace Foam
00209 
00210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00211 
00212 #endif
00213 
00214 // ************************************************************************* //
For further information go to www.openfoam.org