Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / fvMotionSolver / fvMotionSolvers / displacement / componentLaplacian / displacementComponentLaplacianFvMotionSolver.H
blobd71b75ff48e2b1a1c3518aae9ca2f32e76e200cd
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 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
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
19     for more details.
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/>.
24 Class
25     Foam::displacementComponentLaplacianFvMotionSolver
27 Description
28     Mesh motion solver for an fvMesh.  Based on solving the cell-centre
29     Laplacian for the given component of the motion displacement.
31 SourceFiles
32     displacementComponentLaplacianFvMotionSolver.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef displacementComponentLaplacianFvMotionSolver_H
37 #define displacementComponentLaplacianFvMotionSolver_H
39 #include "fvMotionSolver.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 // Forward class declarations
47 class motionDiffusivity;
49 /*---------------------------------------------------------------------------*\
50         Class displacementComponentLaplacianFvMotionSolver Declaration
51 \*---------------------------------------------------------------------------*/
53 class displacementComponentLaplacianFvMotionSolver
55     public fvMotionSolver
57     // Private data
59         //- The component name to solve for
60         word cmptName_;
62         //- The component to solve for
63         direction cmpt_;
65         //- Reference point field for this component
66         scalarField points0_;
68         //- Point motion field
69         mutable pointScalarField pointDisplacement_;
71         //- Cell-centre motion field
72         mutable volScalarField cellDisplacement_;
74         //- Optionally read point-position field. Used only for position
75         //  boundary conditions.
76         mutable autoPtr<pointVectorField> pointLocation_;
78         //- Diffusivity used to control the motion
79         autoPtr<motionDiffusivity> diffusivityPtr_;
81         //- Frozen points (that are not on patches). -1 or points that are
82         //  fixed to be at points0_ location
83         label frozenPointsZone_;
86     // Private Member Functions
88         //- Disallow default bitwise copy construct
89         displacementComponentLaplacianFvMotionSolver
90         (
91             const displacementComponentLaplacianFvMotionSolver&
92         );
94         //- Disallow default bitwise assignment
95         void operator=(const displacementComponentLaplacianFvMotionSolver&);
97         //- Return the component corresponding to the given component name
98         direction cmpt(const word& cmptName) const;
101 public:
103     //- Runtime type information
104     TypeName("displacementComponentLaplacian");
107     // Constructors
109         //- Construct from polyMesh and data stream
110         displacementComponentLaplacianFvMotionSolver
111         (
112             const polyMesh&,
113             Istream& msData
114         );
117     //- Destructor
118     ~displacementComponentLaplacianFvMotionSolver();
121     // Member Functions
123         //- Return reference to the reference field
124         const scalarField& points0() const
125         {
126             return points0_;
127         }
129         //- Non-const access to the cellDisplacement in order to allow
130         //  changes to the boundary motion
131         volScalarField& cellDisplacement()
132         {
133             return cellDisplacement_;
134         }
136         //- Return point location obtained from the current motion field
137         virtual tmp<pointField> curPoints() const;
139         //- Solve for motion
140         virtual void solve();
142         //- Update topology
143         virtual void updateMesh(const mapPolyMesh&);
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 } // End namespace Foam
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 #endif
155 // ************************************************************************* //