initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / fvMotionSolver / fvMotionSolvers / displacement / laplacian / displacementLaplacianFvMotionSolver.H
blob47570239ba72b7547e11f1f3b68345813982f501
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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::displacementLaplacianFvMotionSolver
28 Description
29     Mesh motion solver for an fvMesh.  Based on solving the cell-centre
30     Laplacian for the motion displacement.
32 SourceFiles
33     displacementLaplacianFvMotionSolver.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef displacementLaplacianFvMotionSolver_H
38 #define displacementLaplacianFvMotionSolver_H
40 #include "fvMotionSolver.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 // Forward class declarations
48 class motionDiffusivity;
50 /*---------------------------------------------------------------------------*\
51              Class displacementLaplacianFvMotionSolver Declaration
52 \*---------------------------------------------------------------------------*/
54 class displacementLaplacianFvMotionSolver
56     public fvMotionSolver
58     // Private data
60         //- Reference point field
61         pointField points0_;
63         //- Point motion field
64         mutable pointVectorField pointDisplacement_;
66         //- Cell-centre motion field
67         mutable volVectorField cellDisplacement_;
69         //- Optionally read point-position field. Used only for position
70         //  boundary conditions.
71         mutable autoPtr<pointVectorField> pointLocation_;
73         //- Diffusivity used to control the motion
74         autoPtr<motionDiffusivity> diffusivityPtr_;
76         //- Frozen points (that are not on patches). -1 or points that are
77         //  fixed to be at points0_ location
78         label frozenPointsZone_;
81     // Private Member Functions
83         //- Disallow default bitwise copy construct
84         displacementLaplacianFvMotionSolver
85         (
86             const displacementLaplacianFvMotionSolver&
87         );
89         //- Disallow default bitwise assignment
90         void operator=(const displacementLaplacianFvMotionSolver&);
93 public:
95     //- Runtime type information
96     TypeName("displacementLaplacian");
99     // Constructors
101         //- Construct from polyMesh and data stream
102         displacementLaplacianFvMotionSolver
103         (
104             const polyMesh& mesh,
105             Istream& msData
106         );
109     // Destructor
111         ~displacementLaplacianFvMotionSolver();
114     // Member Functions
117         //- Return reference to the reference field
118         const pointField& points0() const
119         {
120             return points0_;
121         }
123         //- Return reference to the point motion displacement field
124         pointVectorField& pointDisplacement()
125         {
126             return pointDisplacement_;
127         }
129         //- Return const reference to the point motion displacement field
130         const pointVectorField& pointDisplacement() const
131         {
132             return pointDisplacement_;
133         }
135         //- Return reference to the cell motion displacement field
136         volVectorField& cellDisplacement()
137         {
138             return cellDisplacement_;
139         }
141         //- Return const reference to the cell motion displacement field
142         const volVectorField& cellDisplacement() const
143         {
144             return cellDisplacement_;
145         }
147         //- Return point location obtained from the current motion field
148         virtual tmp<pointField> curPoints() const;
150         //- Solve for motion
151         virtual void solve();
153         //- Update topology
154         virtual void updateMesh(const mapPolyMesh&);
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #endif
166 // ************************************************************************* //