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

pointFieldDecomposer.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::pointFieldDecomposer
00026 
00027 Description
00028     Point field decomposer.
00029 
00030 SourceFiles
00031     pointFieldDecomposer.C
00032     pointFieldDecomposerDecomposeFields.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef pointFieldDecomposer_H
00037 #define pointFieldDecomposer_H
00038 
00039 #include <OpenFOAM/pointMesh.H>
00040 #include <OpenFOAM/pointPatchFieldMapperPatchRef.H>
00041 #include <OpenFOAM/pointFields.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                Class pointFieldDecomposer Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class pointFieldDecomposer
00053 {
00054 
00055 public:
00056 
00057         //- Point patch field decomposer class
00058         class patchFieldDecomposer
00059         :
00060             public pointPatchFieldMapperPatchRef
00061         {
00062             // Private data
00063 
00064                 labelList directAddressing_;
00065 
00066         public:
00067 
00068             // Constructors
00069 
00070                 //- Construct given addressing
00071                 patchFieldDecomposer
00072                 (
00073                     const pointPatch& completeMeshPatch,
00074                     const pointPatch& procMeshPatch,
00075                     const labelList& directAddr
00076                 );
00077 
00078 
00079             // Member functions
00080 
00081                 label size() const
00082                 {
00083                     return directAddressing_.size();
00084                 }
00085 
00086                 bool direct() const
00087                 {
00088                     return true;
00089                 }
00090 
00091                 const unallocLabelList& directAddressing() const
00092                 {
00093                     return directAddressing_;
00094                 }
00095         };
00096 
00097 
00098 private:
00099 
00100     // Private data
00101 
00102         //- Reference to complete mesh
00103         const pointMesh& completeMesh_;
00104 
00105         //- Reference to processor mesh
00106         const pointMesh& procMesh_;
00107 
00108         //- Reference to point addressing
00109         const labelList& pointAddressing_;
00110 
00111         //- Reference to boundary addressing
00112         const labelList& boundaryAddressing_;
00113 
00114         //- List of patch field decomposers
00115         List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
00116 
00117 
00118     // Private Member Functions
00119 
00120         //- Disallow default bitwise copy construct
00121         pointFieldDecomposer(const pointFieldDecomposer&);
00122 
00123         //- Disallow default bitwise assignment
00124         void operator=(const pointFieldDecomposer&);
00125 
00126 
00127 public:
00128 
00129     // Constructors
00130 
00131         //- Construct from components
00132         pointFieldDecomposer
00133         (
00134             const pointMesh& completeMesh,
00135             const pointMesh& procMesh,
00136             const labelList& pointAddressing,
00137             const labelList& boundaryAddressing
00138         );
00139 
00140 
00141     // Destructor
00142 
00143         ~pointFieldDecomposer();
00144 
00145 
00146     // Member Functions
00147 
00148         //- Decompose point field
00149         template<class Type>
00150         tmp<GeometricField<Type, pointPatchField, pointMesh> >
00151         decomposeField
00152         (
00153             const GeometricField<Type, pointPatchField, pointMesh>&
00154         ) const;
00155 
00156         template<class GeoField>
00157         void decomposeFields(const PtrList<GeoField>& fields) const;
00158 };
00159 
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00162 
00163 } // End namespace Foam
00164 
00165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00166 
00167 #ifdef NoRepository
00168 #   include "pointFieldDecomposerDecomposeFields.C"
00169 #endif
00170 
00171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00172 
00173 #endif
00174 
00175 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines