lagrangianFieldDecomposer.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-2025 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::lagrangianFieldDecomposer
26 
27 Description
28  Lagrangian field decomposer.
29 
30 SourceFiles
31  lagrangianFieldDecomposer.C
32  lagrangianFieldDecomposerTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef lagrangianFieldDecomposer_H
37 #define lagrangianFieldDecomposer_H
38 
39 #include "fvMesh.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class IOobjectList;
47 class passiveParticleCloud;
48 
49 /*---------------------------------------------------------------------------*\
50  Class lagrangianFieldDecomposer Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55  // Private Data
56 
57  //- Reference to complete mesh
58  const fvMesh& completeMesh_;
59 
60  //- List of processor meshes
61  const PtrList<fvMesh>& procMeshes_;
62 
63  //- For each processor, for each particle, the global particle index
64  labelListList particleProcAddressing_;
65 
66  //- Decomposed clouds
68 
69  //- The name of the cloud
70  const word cloudName_;
71 
72 
73  // Private Member Functions
74 
75  //- Read, decompose and write all fields
76  template
77  <
78  class Type,
79  template<class> class ReadIOContainer,
80  template<class> class IOContainer
81  >
82  void decomposeFields(const IOobjectList& objects) const;
83 
84 
85 public:
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const fvMesh& completeMesh,
93  const PtrList<fvMesh>& procMeshes,
94  const labelListList& faceProcAddressing,
95  const labelListList& cellProcAddressing,
96  const word& cloudName
97  );
98 
99  //- Disallow default bitwise copy construction
101 
102 
103  //- Destructor
105 
106 
107  // Member Functions
108 
109  //- Return whether anything in the object list gets decomposed
110  static bool decomposes(const IOobjectList& objects);
111 
112  //- Access the decomposed clouds
114 
115  //- Write the decomposed positions
116  void decomposePositions() const;
117 
118  //- Read and Decompose a field
119  template
120  <
121  class Type,
122  template<class> class ReadIOContainer,
123  template<class> class IOContainer
124  >
126 
127  //- Read, decompose and write all fields
128  template<class Type>
129  void decomposeFields(const IOobjectList& objects) const;
130 
131 
132  // Member Operators
133 
134  //- Disallow default bitwise assignment
135  void operator=(const lagrangianFieldDecomposer&) = delete;
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #ifdef NoRepository
147 #endif
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
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
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
void operator=(const lagrangianFieldDecomposer &)=delete
Disallow default bitwise assignment.
void decomposePositions() const
Write the decomposed positions.
static bool decomposes(const IOobjectList &objects)
Return whether anything in the object list gets decomposed.
const PtrList< passiveParticleCloud > & procClouds() const
Access the decomposed clouds.
PtrList< IOContainer< Type > > decomposeField(const IOobject &) const
Read and Decompose a field.
lagrangianFieldDecomposer(const fvMesh &completeMesh, const PtrList< fvMesh > &procMeshes, const labelListList &faceProcAddressing, const labelListList &cellProcAddressing, const word &cloudName)
Construct from components.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
objects
const word cloudName(propsDict.lookup("cloudName"))