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) 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 #include "LagrangianMesh.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class IOobjectList;
48 
49 /*---------------------------------------------------------------------------*\
50  Class LagrangianFieldDecomposer Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55  // Private Data
56 
57  //- The complete mesh
58  LagrangianMesh completeMesh_;
59 
60  //- List of processor meshes
61  PtrList<LagrangianMesh> procMeshes_;
62 
63  //- For each processor, for each element, the global element index
64  labelListList particleProcAddressing_;
65 
66 
67  // Private Member Functions
68 
69  //- Return whether anything in the object list gets decomposed
70  template<class GeoField>
71  static bool decomposes(const IOobjectList& objects);
72 
73  //- Return the decomposed internal field given a list of processor
74  // internal fields
75  template<class Type, template<class> class PrimitiveField>
77  decomposeLagrangianField
78  (
80  completeField
81  ) const;
82 
83  //- Return the decomposed field given a list of processor fields
84  template<class Type, template<class> class PrimitiveField>
86  decomposeLagrangianField
87  (
89  completeField
90  ) const;
91 
92 
93 public:
94 
95  // Constructors
96 
97  //- Construct from components
99  (
100  const fvMesh& completeFvMesh,
101  const PtrList<fvMesh>& procFvMeshes,
102  const labelListList& faceProcAddressing,
103  const labelListList& cellProcAddressing,
104  const word& LagrangianName
105  );
106 
107  //- Disallow default bitwise copy construction
109  (
111  ) = delete;
112 
113 
114  //- Destructor
116 
117 
118  // Member Functions
119 
120  //- Return whether anything in the object list gets decomposed
121  static bool decomposes(const IOobjectList& objects);
122 
123  //- Access the decomposed meshes
124  const PtrList<LagrangianMesh>& procMeshes() const;
125 
126  //- Write the decomposed positions
127  void decomposePositions() const;
128 
129  //- Read and decompose a field
130  template<class GeoField>
132 
133  //- Read, decompose and write all Lagrangian fields
134  template<class GeoField>
135  void decomposeFields(const IOobjectList& objects) const;
136 
137 
138  // Member Operators
139 
140  //- Disallow default bitwise assignment
141  void operator=(const LagrangianFieldDecomposer&) = delete;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #ifdef NoRepository
153 #endif
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
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
void decomposePositions() const
Write the decomposed positions.
void decomposeFields(const IOobjectList &objects) const
Read, decompose and write all Lagrangian fields.
LagrangianFieldDecomposer(const fvMesh &completeFvMesh, const PtrList< fvMesh > &procFvMeshes, const labelListList &faceProcAddressing, const labelListList &cellProcAddressing, const word &LagrangianName)
Construct from components.
PtrList< GeoField > decomposeField(const IOobject &) const
Read and decompose a field.
void operator=(const LagrangianFieldDecomposer &)=delete
Disallow default bitwise assignment.
const PtrList< LagrangianMesh > & procMeshes() const
Access the decomposed meshes.
Class containing Lagrangian geometry and topology.
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
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
objects