OpenFOAM logo
Open Source CFD Toolkit

tetDecompositionMotionSolver.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     tetDecompositionMotionSolver
00027 
00028 Description
00029     Virtual base class for tetDecomposition mesh motion solvers.
00030 
00031 SourceFiles
00032     tetDecompositionMotionSolver.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef tetDecompositionMotionSolver_H
00037 #define tetDecompositionMotionSolver_H
00038 
00039 #include "motionSolver.H"
00040 #include "polyMesh.H"
00041 #include "tetPolyMesh.H"
00042 #include "tetPointFields.H"
00043 #include "elementFields.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 // Forward class declarations
00051 class twoDPointCorrector;
00052 
00053 /*---------------------------------------------------------------------------*\
00054                            Class tetDecompositionMotionSolver Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 class tetDecompositionMotionSolver
00058 :
00059     public motionSolver
00060 {
00061     // Private data
00062 
00063         //- Motion mesh
00064         tetPolyMesh tetMesh_;
00065 
00066         //- Motion field
00067         tetPointVectorField motionU_;
00068 
00069         //- Total displacement field
00070         mutable tetPointVectorField* totDisplacementPtr_;
00071 
00072 
00073 public:
00074 
00075     //- Runtime type information
00076     TypeName("tetDecompositionMotionSolver");
00077 
00078 
00079     // Constructors
00080 
00081         //- Construct from components
00082         tetDecompositionMotionSolver(const polyMesh& mesh);
00083 
00084 
00085     // Destructor
00086 
00087         virtual ~tetDecompositionMotionSolver();
00088 
00089 
00090     // Member Functions
00091 
00092         //- Return reference to motion mesh
00093         const tetPolyMesh& tetMesh() const
00094         {
00095             return tetMesh_;
00096         }
00097 
00098         //- Return reference to motion field
00099         tetPointVectorField& motionU()
00100         {
00101             return motionU_;
00102         }
00103 
00104         //- 
00105         void storeTotDisplacement() const
00106         {
00107             if(!totDisplacementPtr_)
00108             {
00109                 totDisplacementPtr_ = 
00110                     new tetPointVectorField
00111                     (
00112                         IOobject
00113                         (
00114                             "totalMotionU",
00115                             mesh().time().timeName(),
00116                             mesh(),
00117                             IOobject::NO_READ,
00118                             IOobject::NO_WRITE
00119                         ),
00120                         tetMesh(),
00121                         dimensionedVector("zero", dimLength, vector::zero)
00122                     );
00123             }
00124         }
00125 
00126         bool needTotDisplacement() const
00127         {
00128             return totDisplacementPtr_;
00129         }
00130 
00131 
00132         //- Return reference to total displacement field
00133         tetPointVectorField& totDisplacement()
00134         {
00135             return *totDisplacementPtr_;
00136         }
00137 
00138         const tetPointVectorField& totDisplacement() const
00139         {
00140             return *totDisplacementPtr_;
00141         }
00142 
00143         //- Provide current points for motion.  Uses current motion field
00144         virtual tmp<pointField> curPoints() const;
00145 
00146         //- Solve for motion
00147         virtual void solve() = 0;
00148 
00149 
00150         //- Update topology (non-implemented)
00151         virtual void updateMesh();
00152 
00153         //- Update tet-mesh topology
00154         virtual void updateTetTopology(const tetPolyMeshMapperFaceDecomp&);
00155 
00156 
00157         //- Distortion energy density
00158         tmp<elementScalarField> distortionEnergy() const;
00159 
00160         //- Deformation energy density
00161         tmp<elementScalarField> deformationEnergy() const;
00162 
00163         //- Total distortion energy density
00164         tmp<elementScalarField> totDistortionEnergy() const;
00165 
00166         //- Total deformation energy density
00167         tmp<elementScalarField> totDeformationEnergy() const;
00168 
00169         //- Return mean cell non-orthogonality
00170         tmp<scalarField> nonOrthogonality() const;
00171 
00172         //- Return mean cell skewness
00173         tmp<Foam::scalarField> cellSkewness() const;
00174 };
00175 
00176 
00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00178 
00179 } // End namespace Foam
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 #endif
00184 
00185 // ************************************************************************* //
For further information go to www.openfoam.org