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 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::pointFieldReconstructor
29 
30 Description
31  Point field reconstructor.
32 
33 SourceFiles
34  pointFieldReconstructor.C
35  pointFieldReconstructorFields.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef pointFieldReconstructor_H
40 #define pointFieldReconstructor_H
41 
42 #include "pointMesh.H"
43 #include "pointFields.H"
45 #include "IOobjectList.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class pointFieldReconstructor Declaration
54 \*---------------------------------------------------------------------------*/
55 
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 
88 public:
89 
91  :
93  {
94  label size_;
95 
96  public:
97 
98  // Constructors
99 
100  //- Construct given size
102  :
103  size_(size)
104  {}
105 
106 
107  // Member functions
108 
109  label size() const
110  {
111  return size_;
112  }
113 
114  bool direct() const
115  {
116  return true;
117  }
118 
119  bool hasUnmapped() const
120  {
121  return false;
122  }
123 
124  const labelUList& directAddressing() const
125  {
126  return labelUList::null();
127  }
128  };
129 
130 
131  // Constructors
132 
133  //- Construct from components
135  (
136  const pointMesh& mesh,
137  const PtrList<pointMesh>& procMeshes,
138  const PtrList<labelIOList>& pointProcAddressing,
139  const PtrList<labelIOList>& boundaryProcAddressing
140  );
141 
142 
143  // Member Functions
144 
145  //- Return number of fields reconstructed
146  label nReconstructed() const
147  {
148  return nReconstructed_;
149  }
150 
151  //- Reconstruct field
152  template<class Type>
154  reconstructField(const IOobject& fieldIoObject);
155 
156  //- Reconstruct and write specified fields
157  template<class Type>
158  label reconstructFields
159  (
160  const IOobjectList& objects,
161  const UList<word>& fieldNames
162  );
163 
164  //- Reconstruct and write all or selected fields
165  // An empty wordRes corresponds to select ALL.
166  template<class Type>
167  label reconstructFields
168  (
169  const IOobjectList& objects,
170  const wordRes& selectedFields = wordRes()
171  );
172 
173  //- Reconstruct and write all or selected fields
174  // An empty wordHashSet corresponds to select ALL.
175  // \note this may be removed in the future (2018-11)
176  template<class Type>
177  label reconstructFields
178  (
179  const IOobjectList& objects,
180  const wordHashSet& selectedFields
181  );
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #ifdef NoRepository
193 #endif
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
IOobjectList.H
Foam::HashSet< word, Hash< word > >
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::pointFieldReconstructor
Point field reconstructor.
Definition: pointFieldReconstructor.H:55
Foam::pointFieldReconstructor::pointPatchFieldReconstructor::size
label size() const
Definition: pointFieldReconstructor.H:108
Foam::pointFieldReconstructor::nReconstructed
label nReconstructed() const
Return number of fields reconstructed.
Definition: pointFieldReconstructor.H:145
Foam::pointFieldReconstructor::reconstructFields
label reconstructFields(const IOobjectList &objects, const UList< word > &fieldNames)
Reconstruct and write specified fields.
Foam::pointFieldReconstructor::pointPatchFieldReconstructor::directAddressing
const labelUList & directAddressing() const
Definition: pointFieldReconstructor.H:123
Foam::pointFieldReconstructor::pointPatchFieldReconstructor::direct
bool direct() const
Definition: pointFieldReconstructor.H:113
pointPatchFieldMapperPatchRef.H
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
fieldNames
const wordRes fieldNames(propsDict.getOrDefault< wordRes >("fields", wordRes()))
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:51
Foam::IOobjectList
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:55
Foam::pointFieldReconstructor::pointPatchFieldReconstructor::hasUnmapped
bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Definition: pointFieldReconstructor.H:118
Foam::List< labelListList >
Foam::UList< label >
Foam::pointFieldReconstructor::pointPatchFieldReconstructor
Definition: pointFieldReconstructor.H:89
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
Foam::pointFieldReconstructor::pointPatchFieldReconstructor::pointPatchFieldReconstructor
pointPatchFieldReconstructor(const label size)
Construct given size.
Definition: pointFieldReconstructor.H:100
Foam::UList::null
static const UList< T > & null()
Return a UList reference to a nullObject.
Definition: UListI.H:53
Foam::pointFieldReconstructor::reconstructField
tmp< GeometricField< Type, pointPatchField, pointMesh > > reconstructField(const IOobject &fieldIoObject)
Reconstruct field.
pointFields.H
pointFieldReconstructorFields.C
pointMesh.H