domainDecompositionDryRun.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) 2018-2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::domainDecompositionDryRun
28 
29 Description
30  Testing of domain decomposition for finite-volume meshes
31 
32 SourceFiles
33  domainDecompositionDryRun.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef domainDecompositionDryRun_H
38 #define domainDecompositionDryRun_H
39 
40 #include "fvMesh.H"
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class domainDecompositionDryRun Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 {
51  // Private Data
52 
53  //- The mesh
54  fvMesh mesh_;
55 
56  //- Optional non-standard file for decomposeParDict
57  const fileName decompDictFile_;
58 
59  //- Optional override for numberOfSubdomains in decomposeParDict
60  const label nDomainsOverride_;
61 
62  //- Optional override for method in decomposeParDict
63  const word methodNameOverride_;
64 
65 
66  // Private Members
67 
68  //- Write decomposition as volScalarField for visualization
69  void writeVolField
70  (
71  const word& timeName,
72  const labelUList& cellToProc
73  ) const;
74 
75  //- Write cell distribution as VTU file (binary)
76  void writeVTK
77  (
78  const fileName& file,
79  const labelUList& cellToProc
80  ) const;
81 
82 
83 public:
84 
85  // Constructors
86 
87  //- Construct from components.
88  // \param io the IOobject for mesh
89  // \param decompDictFile optional non-standard location for the
90  // decomposeParDict file
91  // \param nDomains optional override value for numberOfSubdomains
92  // \param methodName optional override value for decomposition method
94  (
95  const IOobject& io,
96  const fileName& decompDictFile = "",
97  const label nDomains = 0,
98  const word& methodName = ""
99  );
100 
101 
102  //- Destructor
103  ~domainDecompositionDryRun() = default;
104 
105 
106  // Member Functions
107 
108  //- The mesh
109  const fvMesh& mesh() const noexcept
110  {
111  return mesh_;
112  }
113 
114  //- Perform dry-run
115  void execute(const bool writeCellDist, const bool verbose = false);
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::domainDecompositionDryRun::~domainDecompositionDryRun
~domainDecompositionDryRun()=default
Destructor.
Foam::domainDecompositionDryRun::domainDecompositionDryRun
domainDecompositionDryRun(const IOobject &io, const fileName &decompDictFile="", const label nDomains=0, const word &methodName="")
Construct from components.
Foam::domainDecompositionDryRun::mesh
const fvMesh & mesh() const noexcept
The mesh.
Definition: domainDecompositionDryRun.H:108
timeName
word timeName
Definition: getTimeIndex.H:3
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::domainDecompositionDryRun::execute
void execute(const bool writeCellDist, const bool verbose=false)
Perform dry-run.
Foam::domainDecompositionDryRun
Testing of domain decomposition for finite-volume meshes.
Definition: domainDecompositionDryRun.H:48
Foam::UList< label >