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 decompositionModel_H
39 #define 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 
124 
125  // Housekeeping
126 
127  //- Deprecated(2021-04) compatibility constructor
128  // \deprecated(2021-04)
129  FOAM_DEPRECATED(2021-04)
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(2021-04)
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")
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
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::decompositionModel::decomposer
decompositionMethod & decomposer() const
Return demand-driven decomposition method.
Definition: decompositionModel.C:101
decompositionMethod.H
Foam::baseIOdictionary::name
const word & name() const
Definition: baseIOdictionary.C:85
Foam::decompositionModel::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Definition: decompositionModel.H:120
Foam::decompositionModel
MeshObject wrapper of decompositionMethod.
Definition: decompositionModel.H:57
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::decompositionModel::New
static const decompositionModel & New(const polyMesh &mesh, const fileName &decompDictFile="", const dictionary *fallback=nullptr)
Definition: decompositionModel.C:83
Foam::decompositionModel::canonicalName
static const word canonicalName
Definition: decompositionModel.H:79
Foam::MeshObject< polyMesh, UpdateableMeshObject, decompositionModel >::mesh
const polyMesh & mesh() const
Definition: MeshObject.H:122
Foam::IOobject::selectIO
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:238
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::decompositionModel::selectIO
static IOobject selectIO(const IOobject &io, const fileName &file, const word &name="")
Deprecated(2018-08) compatibility method.
Definition: decompositionModel.H:156
Foam::decompositionMethod
Abstract base class for domain decomposition.
Definition: decompositionMethod.H:51
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
IOdictionary.H
FOAM_DEPRECATED
#define FOAM_DEPRECATED(since)
Definition: stdFoam.H:65
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::decompositionModel::ClassName
ClassName("decompositionModel")
Foam::FOAM_DEPRECATED_FOR
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Definition: NamedEnum.H:69
MeshObject.H
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::MeshObject
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:88
Foam::decompositionModel::decompositionModel
decompositionModel(const polyMesh &mesh, const fileName &decompDictFile="", const dictionary *fallback=nullptr)
Definition: decompositionModel.C:46
Foam::decompositionModel::movePoints
virtual bool movePoints()
Definition: decompositionModel.H:115