Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / utilities / parallelProcessing / reconstructPar / faFieldReconstructor.H
blob612ad57243cfa6e76fcb99980ab1b93af3ec2aa7
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     faFieldReconstructor
27 Description
28     FA area and edge field reconstructor.
30 Author
31     Zeljko Tukovic, FSB Zagreb.  All rights reserved
33 SourceFiles
34     faFieldReconstructor.C
35     faFieldReconstructorReconstructFields.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef faFieldReconstructor_H
40 #define faFieldReconstructor_H
42 #include "PtrList.H"
43 #include "faMesh.H"
44 #include "IOobjectList.H"
45 #include "faPatchFieldMapper.H"
46 #include "labelIOList.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
54 /*---------------------------------------------------------------------------*\
55                      Class faFieldReconstructor Declaration
56 \*---------------------------------------------------------------------------*/
58 class faFieldReconstructor
60     // Private data
62         //- Reconstructed mesh reference
63         faMesh& mesh_;
65         //- List of processor meshes
66         const PtrList<faMesh>& procMeshes_;
68         //- List of processor edge addressing lists
69         const PtrList<labelIOList>& edgeProcAddressing_;
71         //- List of processor face addressing lists
72         const PtrList<labelIOList>& faceProcAddressing_;
74         //- List of processor boundary addressing lists
75         const PtrList<labelIOList>& boundaryProcAddressing_;
78     // Private Member Functions
80         //- Disallow default bitwise copy construct
81         faFieldReconstructor(const faFieldReconstructor&);
83         //- Disallow default bitwise assignment
84         void operator=(const faFieldReconstructor&);
87 public:
89         class faPatchFieldReconstructor
90         :
91             public faPatchFieldMapper
92         {
93             label size_;
94             label sizeBeforeMapping_;
96         public:
98             // Constructors
100                 //- Construct given size
101                 faPatchFieldReconstructor
102                 (
103                     const label size,
104                     const label sizeBeforeMapping
105                 )
106                 :
107                     size_(size),
108                     sizeBeforeMapping_(sizeBeforeMapping)
109                 {}
112             // Member functions
114                 virtual label size() const
115                 {
116                     return size_;
117                 }
119                 virtual label sizeBeforeMapping() const
120                 {
121                     return sizeBeforeMapping_;
122                 }
124                 virtual bool direct() const
125                 {
126                     return true;
127                 }
129                 virtual const unallocLabelList& directAddressing() const
130                 {
131                     return unallocLabelList::null();
132                 }
133         };
136     // Constructors
138         //- Construct from components
139         faFieldReconstructor
140         (
141             faMesh& mesh,
142             const PtrList<faMesh>& procMeshes,
143             const PtrList<labelIOList>& edgeProcAddressing,
144             const PtrList<labelIOList>& faceProcAddressing,
145             const PtrList<labelIOList>& boundaryProcAddressing
146         );
149     // Member Functions
151         //- Reconstruct area field
152         template<class Type>
153         tmp<GeometricField<Type, faPatchField, areaMesh> >
154         reconstructFaAreaField
155         (
156             const IOobject& fieldIoObject
157         );
159         //- Reconstruct edge field
160         template<class Type>
161         tmp<GeometricField<Type, faePatchField, edgeMesh> >
162         reconstructFaEdgeField
163         (
164             const IOobject& fieldIoObject
165         );
167         //- Reconstruct and write all area fields
168         template<class Type>
169         void reconstructFaAreaFields
170         (
171             const IOobjectList& objects
172         );
174         //- Reconstruct and write all area fields
175         template<class Type>
176         void reconstructFaEdgeFields
177         (
178             const IOobjectList& objects
179         );
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 } // End namespace Foam
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 #ifdef NoRepository
190 #   include "faFieldReconstructorReconstructFields.C"
191 #endif
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 #endif
197 // ************************************************************************* //