1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::polyMeshModifier
28 Virtual base class for mesh modifiers.
33 \*---------------------------------------------------------------------------*/
35 #ifndef polyMeshModifier_H
36 #define polyMeshModifier_H
42 #include "runTimeSelectionTables.H"
44 #include "pointField.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Forward declaration of classes
54 class polyTopoChanger;
58 /*---------------------------------------------------------------------------*\
59 Class polyMeshModifier Declaration
60 \*---------------------------------------------------------------------------*/
62 class polyMeshModifier
72 //- Reference to morph engine
73 const polyTopoChanger& topoChanger_;
76 mutable Switch active_;
79 // Private Member Functions
81 //- Disallow default bitwise copy construct
82 polyMeshModifier(const polyMeshModifier&);
84 //- Disallow default bitwise assignment
85 void operator=(const polyMeshModifier&);
90 // Static data members
92 //- Runtime type information
93 TypeName("meshModifier");
96 // Declare run-time constructor selection tables
98 declareRunTimeSelectionTable
105 const dictionary& dict,
107 const polyTopoChanger& mme
109 (name, dict, index, mme)
115 //- Construct from components
120 const polyTopoChanger& mme,
127 //- Select constructed from dictionary
128 static autoPtr<polyMeshModifier> New
131 const dictionary& dict,
133 const polyTopoChanger& mme
138 virtual ~polyMeshModifier();
144 const word& name() const
149 //- Return the index of this patch in the boundaryMesh
155 //- Return reference to morph engine
156 const polyTopoChanger& topoChanger() const;
158 //- Check for topology change
159 virtual bool changeTopology() const = 0;
161 //- Insert the topological change instructions
162 virtual void setRefinement(polyTopoChange&) const = 0;
164 //- Modify motion points to comply with the topological change
165 virtual void modifyMotionPoints(pointField& motionPoints) const = 0;
167 //- Force recalculation of locally stored data on topological change
168 virtual void updateMesh(const mapPolyMesh&) = 0;
171 // Activation and deactivation
173 const Switch& active() const
178 //- Activate mesh modifier
184 //- Activate mesh modifier
192 virtual void write(Ostream&) const = 0;
195 virtual void writeDict(Ostream&) const = 0;
200 friend Ostream& operator<<(Ostream&, const polyMeshModifier&);
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 } // End namespace Foam
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 // ************************************************************************* //