OpenFOAM logo
Open Source CFD Toolkit

motionSolver.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     motionSolver
00027 
00028 Description
00029     Virtual base class for mesh motion solver.
00030 
00031 SourceFiles
00032     motionSolver.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef motionSolver_H
00037 #define motionSolver_H
00038 
00039 #include "IOdictionary.H"
00040 #include "pointField.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 // Forward class declarations
00048 class polyMesh;
00049 class twoDPointCorrector;
00050 
00051 /*---------------------------------------------------------------------------*\
00052                            Class motionSolver Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class motionSolver
00056 :
00057     public IOdictionary
00058 {
00059 private:
00060 
00061     // Private data
00062 
00063         //- Reference to mesh
00064         const polyMesh& mesh_;
00065 
00066         //- 2-D motion corrector pointer
00067         twoDPointCorrector* correct2DPtr_;
00068 
00069 
00070 public:
00071 
00072     //- Runtime type information
00073     TypeName("motionSolver");
00074 
00075 
00076     // Declare run-time constructor selection tables
00077 
00078         declareRunTimeSelectionTable
00079         (
00080             autoPtr,
00081             motionSolver,
00082             dictionary,
00083             (const polyMesh& mesh),
00084             (mesh)
00085         );
00086 
00087 
00088     // Selectors
00089 
00090         //- Select constructed from polyMesh
00091         static autoPtr<motionSolver> New(const polyMesh& mesh);
00092 
00093 
00094     // Constructors
00095 
00096         //- Construct from polyMesh
00097         motionSolver(const polyMesh& mesh);
00098 
00099 
00100     // Destructor
00101 
00102         virtual ~motionSolver();
00103 
00104 
00105     // Member Functions
00106         
00107         //- Return reference to mesh
00108         const polyMesh& mesh() const
00109         {
00110             return mesh_;
00111         }
00112 
00113         //- Provide new points for motion.  Solves for motion
00114         virtual tmp<pointField> newPoints();
00115 
00116         //- Provide current points for motion.  Uses current motion field
00117         virtual tmp<pointField> curPoints() const = 0;
00118 
00119         virtual void twoDCorrectPoints(pointField&) const;
00120 
00121         //- Solve for motion
00122         virtual void solve() = 0;
00123 
00124         //- Update topology
00125         virtual void updateMesh();
00126 };
00127 
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 } // End namespace Foam
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 #endif
00136 
00137 // ************************************************************************* //
For further information go to www.openfoam.org