decompositionModel.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) 2014-2016 OpenFOAM Foundation
9  Copyright (C) 2018-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::decompositionModel
29 
30 Description
31  MeshObject wrapper of decompositionMethod
32 
33 SourceFiles
34  decompositionModel.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_decompositionModel_H
39 #define Foam_decompositionModel_H
40 
41 #include "IOdictionary.H"
42 #include "MeshObject.H"
43 #include "decompositionMethod.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward Declarations
51 class mapPolyMesh;
52 class polyMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class decompositionModel Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 :
60  public MeshObject
61  <
62  polyMesh,
63  UpdateableMeshObject,
64  decompositionModel
65  >,
66  public IOdictionary
67 {
68  // Private Data
69 
70  mutable autoPtr<decompositionMethod> decomposerPtr_;
71 
72 
73 public:
74 
75  // Declare name of the class and its debug switch
76  ClassName("decompositionModel");
77 
78  //- The canonical name ("decomposeParDict") under which the
79  //- MeshObject is registered
80  static const word canonicalName;
81 
82 
83  // Constructors
84 
85  //- Construct from typeName, optional decomposeParDict path/name
86  //- or with fallback content
87  explicit decompositionModel
88  (
89  const polyMesh& mesh,
90  const fileName& decompDictFile = "",
91  const dictionary* fallback = nullptr
92  );
93 
94 
95  // Selectors
96 
97  //- Read and register on mesh,
98  //- optionally with alternative decomposeParDict path/name
99  //- or with fallback content
100  static const decompositionModel& New
101  (
102  const polyMesh& mesh,
103  const fileName& decompDictFile = "",
104  const dictionary* fallback = nullptr
105  );
106 
107 
108  // Member Functions
109 
110  //- Return demand-driven decomposition method
112 
113 
114  // UpdateableMeshObject Functions
115 
116  virtual bool movePoints()
117  {
118  return false;
119  }
120 
121  virtual void updateMesh(const mapPolyMesh&)
122  {}
123 
125  // Housekeeping
126 
127  //- Deprecated(2021-04) compatibility constructor
128  // \deprecated(2021-04)
129  FOAM_DEPRECATED_FOR(2021-04, "construct mesh/fileName/dictionary")
131  (
132  const polyMesh& mesh,
133  const dictionary& dict,
134  const fileName& decompDictFile = ""
135  )
136  :
137  decompositionModel(mesh, decompDictFile, &dict)
138  {}
139 
140  //- Deprecated(2021-04) compatibility selector
141  // \deprecated(2021-04)
142  FOAM_DEPRECATED_FOR(2021-04, "New mesh/fileName/dictionary")
143  static const decompositionModel& New
144  (
145  const polyMesh& mesh,
146  const dictionary& dict,
147  const fileName& decompDictFile = ""
148  )
149  {
150  return Foam::decompositionModel::New(mesh, decompDictFile, &dict);
151  }
152 
153  //- Deprecated(2018-08) compatibility method
154  // \deprecated(2018-08) - use IOobject::selectIO directly
155  FOAM_DEPRECATED_FOR(2018-08, "IOobject::selectIO")
156  static IOobject selectIO
157  (
158  const IOobject& io,
159  const fileName& file,
160  const word& name = ""
161  )
162  {
163  return IOobject::selectIO(io, file, name);
164  }
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
dictionary dict
A class for handling file names.
Definition: fileName.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
decompositionModel(const polyMesh &mesh, const fileName &decompDictFile="", const dictionary *fallback=nullptr)
Construct from typeName, optional decomposeParDict path/name or with fallback content.
static const decompositionModel & New(const polyMesh &mesh, const fileName &decompDictFile="", const dictionary *fallback=nullptr)
Read and register on mesh, optionally with alternative decomposeParDict path/name or with fallback co...
decompositionMethod & decomposer() const
Return demand-driven decomposition method.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:157
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Definition: NamedEnum.H:65
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:50
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:85
ClassName("decompositionModel")
const polyMesh & mesh() const noexcept
Reference to the mesh.
Definition: MeshObject.H:157
A class for handling words, derived from Foam::string.
Definition: word.H:63
Abstract base class for domain decomposition.
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
MeshObject wrapper of decompositionMethod.
static const word canonicalName
The canonical name ("decomposeParDict") under which the MeshObject is registered. ...
static IOobject selectIO(const IOobject &io, const fileName &file, const word &name="")
Deprecated(2018-08) compatibility method.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
virtual void updateMesh(const mapPolyMesh &)
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
Namespace for OpenFOAM.
static IOobject selectIO(const IOobject &io, const fileName &altFile, const word &ioName="")
Return the IOobject, but also consider an alternative file name.
Definition: IOobject.C:256