FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

quadraticFitSnGradData.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-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     quadraticFitSnGradData
00026 
00027 Description
00028     Data for the quadratic fit correction snGrad scheme
00029 
00030 SourceFiles
00031     quadraticFitSnGradData.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef quadraticFitSnGradData_H
00036 #define quadraticFitSnGradData_H
00037 
00038 #include <OpenFOAM/MeshObject.H>
00039 #include <finiteVolume/fvMesh.H>
00040 #include <finiteVolume/extendedCellToFaceStencil.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                     Class quadraticFitSnGradData Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class quadraticFitSnGradData
00052 :
00053     public MeshObject<fvMesh, quadraticFitSnGradData>
00054 {
00055     // Private data
00056 
00057         const scalar centralWeight_;
00058         const label dim_;
00059 
00060         //- minimum stencil size
00061         const label minSize_;
00062 
00063         //- Extended stencil addressing
00064         extendedCellToFaceStencil stencil_;
00065 
00066         //- For each cell in the mesh store the values which multiply the
00067         //  values of the stencil to obtain the gradient for each direction
00068         List<scalarList> fit_;
00069 
00070 
00071     // Private member functions
00072 
00073         //- Find the normal direction and i, j and k directions for face faci
00074         static void findFaceDirs
00075         (
00076             vector& idir,        // value changed in return
00077             vector& jdir,        // value changed in return
00078             vector& kdir,        // value changed in return
00079             const fvMesh& mesh,
00080             const label faci
00081         );
00082 
00083         label calcFit(const List<point>&, const label faci);
00084 
00085 
00086 public:
00087 
00088     TypeName("quadraticFitSnGradData");
00089 
00090 
00091     // Constructors
00092 
00093         explicit quadraticFitSnGradData
00094         (
00095             const fvMesh& mesh,
00096             const scalar cWeight
00097         );
00098 
00099 
00100     // Destructor
00101 
00102         virtual ~quadraticFitSnGradData()
00103         {};
00104 
00105 
00106     // Member functions
00107 
00108         //- Return reference to the stencil
00109         const extendedCellToFaceStencil& stencil() const
00110         {
00111             return stencil_;
00112         }
00113 
00114         //- Return reference to fit coefficients
00115         const List<scalarList>& fit() const { return fit_; }
00116 
00117         //- Delete the data when the mesh moves not implemented
00118         virtual bool movePoints();
00119 };
00120 
00121 
00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00123 
00124 } // End namespace Foam
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 #endif
00129 
00130 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines