initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / motionSolver / motionSolver.H
bloba7bd50ea73b686964ab0e5a0b5776fdaabb5f01e
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::motionSolver
28 Description
29     Virtual base class for mesh motion solver.
31 SourceFiles
32     motionSolver.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef motionSolver_H
37 #define motionSolver_H
39 #include "IOdictionary.H"
40 #include "pointField.H"
41 #include "twoDPointCorrector.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 // Forward class declarations
49 class polyMesh;
50 class mapPolyMesh;
52 /*---------------------------------------------------------------------------*\
53                            Class motionSolver Declaration
54 \*---------------------------------------------------------------------------*/
56 class motionSolver
58     public IOdictionary
60 private:
62     // Private data
64         //- Reference to mesh
65         const polyMesh& mesh_;
67         //- 2-D motion corrector pointer
68         twoDPointCorrector twoDPointCorrector_;
71 public:
73     //- Runtime type information
74     TypeName("motionSolver");
77     // Declare run-time constructor selection tables
79         declareRunTimeSelectionTable
80         (
81             autoPtr,
82             motionSolver,
83             dictionary,
84             (const polyMesh& mesh, Istream& msData),
85             (mesh, msData)
86         );
89     // Selectors
91         //- Select constructed from polyMesh
92         static autoPtr<motionSolver> New(const polyMesh& mesh);
95     // Constructors
97         //- Construct from polyMesh
98         motionSolver(const polyMesh& mesh);
101     // Destructor
103         virtual ~motionSolver();
106     // Member Functions
107         
108         //- Return reference to mesh
109         const polyMesh& mesh() const
110         {
111             return mesh_;
112         }
114         //- Provide new points for motion.  Solves for motion
115         virtual tmp<pointField> newPoints();
117         //- Provide current points for motion.  Uses current motion field
118         virtual tmp<pointField> curPoints() const = 0;
120         virtual void twoDCorrectPoints(pointField&) const;
122         //- Solve for motion
123         virtual void solve() = 0;
125         //- Update topology
126         virtual void updateMesh(const mapPolyMesh&) = 0;
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 } // End namespace Foam
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 #endif
138 // ************************************************************************* //