00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 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 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your 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, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::motionSolver 00026 00027 Description 00028 Virtual base class for mesh motion solver. 00029 00030 SourceFiles 00031 motionSolver.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef motionSolver_H 00036 #define motionSolver_H 00037 00038 #include <OpenFOAM/IOdictionary.H> 00039 #include <OpenFOAM/pointField.H> 00040 #include <meshTools/twoDPointCorrector.H> 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 // Forward class declarations 00048 class polyMesh; 00049 class mapPolyMesh; 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 twoDPointCorrector_; 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, Istream& msData), 00084 (mesh, msData) 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(const mapPolyMesh&) = 0; 00126 }; 00127 00128 00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00130 00131 } // End namespace Foam 00132 00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00134 00135 #endif 00136 00137 // ************************ vim: set sw=4 sts=4 et: ************************ //