OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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