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

extendedCellToFaceStencil.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     Foam::extendedCellToFaceStencil
00026 
00027 Description
00028     Calculates/constains the extended cell-to-face stencil.
00029 
00030     The stencil is a list of indices into either cells or boundary faces
00031     in a compact way. (element 0 is owner, 1 is neighbour). The index numbering
00032     is
00033     - cells first
00034     - then all (non-empty patch) boundary faces
00035 
00036     When used in evaluation is a two stage process:
00037     - collect the data (cell data and non-empty boundaries) into a
00038     single field
00039     - (parallel) distribute the field
00040     - sum the weights*field.
00041 
00042 SourceFiles
00043     extendedCellToFaceStencil.C
00044     extendedCellToFaceStencilTemplates.C
00045 
00046 \*---------------------------------------------------------------------------*/
00047 
00048 #ifndef extendedCellToFaceStencil_H
00049 #define extendedCellToFaceStencil_H
00050 
00051 #include <OpenFOAM/mapDistribute.H>
00052 #include <finiteVolume/volFields.H>
00053 #include <finiteVolume/surfaceFields.H>
00054 
00055 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00056 
00057 namespace Foam
00058 {
00059 
00060 class globalIndex;
00061 
00062 /*---------------------------------------------------------------------------*\
00063                            Class extendedCellToFaceStencil Declaration
00064 \*---------------------------------------------------------------------------*/
00065 
00066 class extendedCellToFaceStencil
00067 {
00068 protected:
00069 
00070     // Protected data
00071 
00072         const polyMesh& mesh_;
00073 
00074 
00075     // Protected Member Functions
00076 
00077 
00078 
00079 private:
00080 
00081     // Private Member Functions
00082 
00083         //- Disallow default bitwise copy construct
00084         extendedCellToFaceStencil(const extendedCellToFaceStencil&);
00085 
00086         //- Disallow default bitwise assignment
00087         void operator=(const extendedCellToFaceStencil&);
00088 
00089 
00090 protected:
00091 
00092         //- Write some statistics about stencil
00093         static void writeStencilStats
00094         (
00095             Ostream& os,
00096             const labelListList& stencil,
00097             const mapDistribute& map
00098         );
00099 
00100 public:
00101 
00102     // Declare name of the class and its debug switch
00103     ClassName("extendedCellToFaceStencil");
00104 
00105 
00106     // Constructors
00107 
00108         //- Construct from mesh
00109         explicit extendedCellToFaceStencil(const polyMesh&);
00110 
00111 
00112     // Member Functions
00113 
00114         //- Calculate distribute map
00115         static autoPtr<mapDistribute> calcDistributeMap
00116         (
00117             const polyMesh& mesh,
00118             const globalIndex& globalNumbering,
00119             labelListList& faceStencil
00120         );
00121 
00122         //- Use map to get the data into stencil order
00123         template<class T>
00124         static void collectData
00125         (
00126             const mapDistribute& map,
00127             const labelListList& stencil,
00128             const GeometricField<T, fvPatchField, volMesh>& fld,
00129             List<List<T> >& stencilFld
00130         );
00131 
00132         //- Sum vol field contributions to create face values
00133         template<class Type>
00134         static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00135         weightedSum
00136         (
00137             const mapDistribute& map,
00138             const labelListList& stencil,
00139             const GeometricField<Type, fvPatchField, volMesh>& fld,
00140             const List<List<scalar> >& stencilWeights
00141         );
00142 };
00143 
00144 
00145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00146 
00147 } // End namespace Foam
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 #ifdef NoRepository
00152 #   include "extendedCellToFaceStencilTemplates.C"
00153 #endif
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 #endif
00158 
00159 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines