multiDomainDecomposition.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) 2023-2024 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::multiDomainDecomposition
26 
27 Description
28  ...
29 
30 SourceFiles
31  multiDomainDecomposition.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef multiDomainDecomposition_H
36 #define multiDomainDecomposition_H
37 
38 #include "domainDecomposition.H"
39 #include "MultiRegionList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class multiDomainDecomposition Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public MultiRegionList<domainDecomposition>
53 {
54  // Private Data
55 
56  //- Run times
57  const processorRunTimes& runTimes_;
58 
59 
60  // Private Member Functions
61 
62  //- Initialise and return the list of regions
64  (
65  const processorRunTimes& runTimes,
66  const wordList& regionNames
67  );
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("multiDomainDecomposition");
74 
75 
76  // Constructors
77 
78  //- Construct from processor run times and region names
80  (
81  const processorRunTimes& procRunTimes,
82  const wordList& regionNames
83  );
84 
85 
86  //- Destructor
87  virtual ~multiDomainDecomposition();
88 
89 
90  // Member Functions
91 
92  //- Return the number of processors in the decomposition
93  inline label nProcs() const
94  {
95  return runTimes_.nProcs();
96  }
97 
98  //- Read in the complete mesh. Read the processor meshes if they are
99  // available and up to date relative to the complete mesh, or
100  // decompose if not. Return whether or not decomposition happened.
101  bool readDecompose(const bool doSets);
102 
103  //- Read in the processor meshes. Read the complete mesh if it is
104  // available and up to date relative to the processor meshes, or
105  // reconstruct if not. Return whether or not reconstruction happened.
106  bool readReconstruct(const bool doSets);
107 
108  //- Read-update for decomposition
110 
111  //- Read-update for reconstruction
113 
114  //- Write the decomposed meshes and associated data
115  void writeComplete(const bool doSets) const;
116 
117  //- Write the decomposed meshes and associated data
118  void writeProcs(const bool doSets) const;
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
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
readUpdateState
Enumeration defining the state of the mesh after a read update.
Definition: fvMesh.H:108
virtual ~multiDomainDecomposition()
Destructor.
TypeName("multiDomainDecomposition")
Runtime type information.
multiDomainDecomposition(const processorRunTimes &procRunTimes, const wordList &regionNames)
Construct from processor run times and region names.
label nProcs() const
Return the number of processors in the decomposition.
void writeProcs(const bool doSets) const
Write the decomposed meshes and associated data.
bool readDecompose(const bool doSets)
Read in the complete mesh. Read the processor meshes if they are.
void writeComplete(const bool doSets) const
Write the decomposed meshes and associated data.
bool readReconstruct(const bool doSets)
Read in the processor meshes. Read the complete mesh if it is.
fvMesh::readUpdateState readUpdateReconstruct()
Read-update for reconstruction.
fvMesh::readUpdateState readUpdateDecompose()
Read-update for decomposition.
label nProcs() const
Return the number of processors.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const Foam::wordList regionNames(args.optionFound("allRegions") ? runTime .controlDict().subDict("regionSolvers").toc() :wordList(1, args.optionFound("region") ? args.optionRead< word >("region") :polyMesh::defaultRegion))