pointFieldDecomposer.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::pointFieldDecomposer
26 
27 Description
28  Point field decomposer.
29 
30 SourceFiles
31  pointFieldDecomposer.C
32  pointFieldDecomposerTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef pointFieldDecomposer_H
37 #define pointFieldDecomposer_H
38 
39 #include "pointMesh.H"
40 #include "pointFields.H"
41 #include "forwardFieldMapper.H"
42 #include "IOobjectList.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 class fvMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class pointFieldDecomposer Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57 public:
58 
59  // Public classes
60 
61  //- Point patch field decomposer class
63  :
64  public labelList,
65  public forwardFieldMapper
66  {
67  // Private Member Functions
68 
69  //- Generate the addressing
70  static labelList addressing
71  (
72  const pointPatch& completePatch,
73  const pointPatch& procPatch,
74  const labelList& pointProcAddressing
75  );
76 
77 
78  public:
79 
80  // Constructors
81 
82  //- Construct given patches and addressing
84  (
85  const pointPatch& completePatch,
86  const pointPatch& procPatch,
87  const labelList& pointProcAddressing
88  );
89  };
90 
91 
92 private:
93 
94  // Private Data
95 
96  //- Reference to complete mesh
97  const pointMesh& completeMesh_;
98 
99  //- Reference to processor meshes
100  const PtrList<fvMesh>& procMeshes_;
101 
102  //- Reference to point addressing
103  const labelListList& pointProcAddressing_;
104 
105  //- List of patch field decomposers
106  PtrList<PtrList<patchFieldDecomposer>> patchFieldDecomposers_;
107 
108 
109  // Private Member Functions
110 
111  //- Decompose a field
112  template<class Type>
114  decomposeField(const IOobject& fieldIoObject) const;
115 
116 
117 public:
118 
119  // Constructors
120 
121  //- Construct from components
123  (
124  const pointMesh& completeMesh,
125  const PtrList<fvMesh>& procMeshes,
126  const labelListList& pointAddressing
127  );
128 
129  //- Disallow default bitwise copy construction
131 
132 
133  //- Destructor
135 
136 
137  // Member Functions
138 
139  //- Return whether anything in the object list gets decomposed
140  static bool decomposes(const IOobjectList& objects);
141 
142  //- Read, decompose and write all fields
143  template<class Type>
144  void decomposeFields(const IOobjectList& objects);
145 
146 
147  // Member Operators
148 
149  //- Disallow default bitwise assignment
150  void operator=(const pointFieldDecomposer&) = delete;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #ifdef NoRepository
162 #endif
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:53
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Forward field mapper.
patchFieldDecomposer(const pointPatch &completePatch, const pointPatch &procPatch, const labelList &pointProcAddressing)
Construct given patches and addressing.
Point field decomposer.
void decomposeFields(const IOobjectList &objects)
Read, decompose and write all fields.
pointFieldDecomposer(const pointMesh &completeMesh, const PtrList< fvMesh > &procMeshes, const labelListList &pointAddressing)
Construct from components.
static bool decomposes(const IOobjectList &objects)
Return whether anything in the object list gets decomposed.
void operator=(const pointFieldDecomposer &)=delete
Disallow default bitwise assignment.
~pointFieldDecomposer()
Destructor.
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:53
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:57
Namespace for OpenFOAM.
objects