ENH: partialWrite: support lagrangian
[OpenFOAM-1.7.x.git] / applications / utilities / parallelProcessing / decomposePar / lagrangianFieldDecomposer.H
blob3429f1f903cd3e4745d2c85f7c89f44676d63254
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::lagrangianFieldDecomposer
27 Description
28     Lagrangian field decomposer.
30 SourceFiles
31     lagrangianFieldDecomposer.C
32     lagrangianFieldDecomposerDecomposeFields.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef lagrangianFieldDecomposer_H
37 #define lagrangianFieldDecomposer_H
39 #include "Cloud.H"
40 #include "indexedParticle.H"
41 #include "passiveParticle.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 class IOobjectList;
50 /*---------------------------------------------------------------------------*\
51                     Class lagrangianFieldDecomposer Declaration
52 \*---------------------------------------------------------------------------*/
54 class lagrangianFieldDecomposer
56     // Private data
58         //- Reference to processor mesh
59         const polyMesh& procMesh_;
61         //- Lagrangian positions for this processor
62         Cloud<passiveParticle> positions_;
64         //- The indices of the particles on this processor
65         labelList particleIndices_;
68     // Private Member Functions
70         //- Disallow default bitwise copy construct
71         lagrangianFieldDecomposer(const lagrangianFieldDecomposer&);
73         //- Disallow default bitwise assignment
74         void operator=(const lagrangianFieldDecomposer&);
77 public:
79     // Constructors
81         //- Construct from components
82         lagrangianFieldDecomposer
83         (
84             const polyMesh& mesh,
85             const polyMesh& procMesh,
86             const labelList& cellProcAddressing,
87             const word& cloudName,
88             const Cloud<indexedParticle>& lagrangianPositions,
89             const List<SLList<indexedParticle*>*>& cellParticles
90         );
93     // Member Functions
95         // Read the fields and hold on the pointer list
96         template<class Type>
97         static void readFields
98         (
99             const label cloudI,
100             const IOobjectList& lagrangianObjects,
101             PtrList<PtrList<IOField<Type> > >& lagrangianFields
102 //            PtrList<IOField<Type> >& lagrangianFields
103         );
105         //- Decompose volume field
106         template<class Type>
107         tmp<IOField<Type> > decomposeField
108         (
109             const word& cloudName,
110             const IOField<Type>& field
111         ) const;
113         template<class GeoField>
114         void decomposeFields
115         (
116             const word& cloudName,
117             const PtrList<GeoField>& fields
118         ) const;
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 } // End namespace Foam
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 #ifdef NoRepository
129 #   include "lagrangianFieldDecomposerDecomposeFields.C"
130 #endif
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 #endif
136 // ************************************************************************* //