pointFieldReconstructor.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2018-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::pointFieldReconstructor
29
30Description
31 Point field reconstructor.
32
33SourceFiles
34 pointFieldReconstructor.C
35 pointFieldReconstructorTemplates.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Foam_pointFieldReconstructor_H
40#define Foam_pointFieldReconstructor_H
41
42#include "pointMesh.H"
43#include "pointFields.H"
45#include "IOobjectList.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class pointFieldReconstructor Declaration
54\*---------------------------------------------------------------------------*/
57{
58 // Private Data
59
60 //- Reconstructed mesh reference
61 const pointMesh& mesh_;
62
63 //- List of processor meshes
64 const PtrList<pointMesh>& procMeshes_;
65
66 //- List of processor point addressing lists
67 const PtrList<labelIOList>& pointProcAddressing_;
68
69 //- List of processor boundary addressing lists
70 const PtrList<labelIOList>& boundaryProcAddressing_;
71
72 //- Point patch addressing
73 labelListListList patchPointAddressing_;
74
75 //- Number of fields reconstructed
76 label nReconstructed_;
77
78
79 // Private Member Functions
80
81 //- No copy construct
83
84 //- No copy assignment
85 void operator=(const pointFieldReconstructor&) = delete;
86
87
88public:
89
90 // Public Classes
93 :
95 {
96 label size_;
97
98 public:
99
100 // Constructors
101
102 //- Construct given size
104 :
105 size_(size)
106 {}
107
108
109 // Member functions
111 label size() const
112 {
113 return size_;
114 }
116 bool direct() const
117 {
118 return true;
119 }
121 bool hasUnmapped() const
122 {
123 return false;
124 }
126 const labelUList& directAddressing() const
127 {
128 return labelUList::null();
129 }
130 };
131
132
133 // Static Data
134
135 //- Output verbosity when writing
136 static int verbose_;
137
138
139 // Constructors
140
141 //- Construct from components
143 (
144 const pointMesh& mesh,
145 const PtrList<pointMesh>& procMeshes,
146 const PtrList<labelIOList>& pointProcAddressing,
147 const PtrList<labelIOList>& boundaryProcAddressing
148 );
149
150
151 // Member Functions
152
153 //- Return number of fields reconstructed
154 label nReconstructed() const noexcept
155 {
156 return nReconstructed_;
157 }
158
159
160 //- Reconstruct field
161 template<class Type>
164 (
165 const IOobject& fieldObject,
167 ) const;
168
169
170 //- Read and reconstruct point field
171 template<class Type>
173 reconstructPointField(const IOobject& fieldObject);
174
175 //- Reconstruct and write specified point fields
176 template<class Type>
178 (
179 const UPtrList<const IOobject>& fieldObjects
180 );
181
182 //- Reconstruct and write all or selected point fields
183 // An empty wordRes corresponds to select ALL.
184 template<class Type>
186 (
187 const IOobjectList& objects,
188 const wordRes& selectedFields = wordRes()
189 );
190
191 //- Reconstruct and write all known field types
193 (
194 const IOobjectList& objects,
195 const wordRes& selectedFields = wordRes()
196 );
197};
198
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202} // End namespace Foam
203
204// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
206#ifdef NoRepository
208#endif
209
210// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212#endif
213
214// ************************************************************************* //
Generic GeometricField class.
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:59
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
static const UList< label > & null()
Return a UList reference to a nullObject.
Definition: UListI.H:53
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:71
bool direct() const
Is it a direct (non-interpolating) mapper?
pointPatchFieldReconstructor(const label size)
Construct given size.
const labelUList & directAddressing() const
Return the direct addressing values.
Point field reconstructor.
label reconstructPointFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Reconstruct and write all or selected point fields.
tmp< GeometricField< Type, pointPatchField, pointMesh > > reconstructPointField(const IOobject &fieldObject)
Read and reconstruct point field.
label reconstructPointFields(const UPtrList< const IOobject > &fieldObjects)
Reconstruct and write specified point fields.
tmp< GeometricField< Type, pointPatchField, pointMesh > > reconstructField(const IOobject &fieldObject, const PtrList< GeometricField< Type, pointPatchField, pointMesh > > &) const
Reconstruct field.
label nReconstructed() const noexcept
Return number of fields reconstructed.
static int verbose_
Output verbosity when writing.
label reconstructAllFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Reconstruct and write all known field types.
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:55
Foam::pointPatchFieldMapper.
A class for managing temporary objects.
Definition: tmp.H:65
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:54
dynamicFvMesh & mesh
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223