Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::decompositionModel
29
30Description
31 MeshObject wrapper of decompositionMethod
32
33SourceFiles
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
47namespace Foam
48{
49
50// Forward Declarations
51class mapPolyMesh;
52class polyMesh;
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 Typedefs
69
70 typedef MeshObject
71 <
75 > MeshObject_type;
76
77
78 // Private Data
79
80 mutable autoPtr<decompositionMethod> decomposerPtr_;
82
83public:
84
85 // Declare name of the class and its debug switch
86 ClassName("decompositionModel");
88 //- The canonical name ("decomposeParDict") under which the
89 //- MeshObject is registered
90 static const word canonicalName;
91
92
93 // Constructors
94
95 //- Construct from typeName, optional decomposeParDict path/name
96 //- or with fallback content
97 explicit decompositionModel
98 (
99 const polyMesh& mesh,
100 const fileName& decompDictFile = "",
101 const dictionary* fallback = nullptr
102 );
103
104
105 // Selectors
106
107 //- Read and register on mesh,
108 //- optionally with alternative decomposeParDict path/name
109 //- or with fallback content
110 static const decompositionModel& New
112 const polyMesh& mesh,
113 const fileName& decompDictFile = "",
114 const dictionary* fallback = nullptr
115 );
116
117
118 // Member Functions
119
120 //- Return demand-driven decomposition method
122
123
124 // UpdateableMeshObject Functions
125
126 virtual bool movePoints()
127 {
128 return false;
130
131 virtual void updateMesh(const mapPolyMesh&)
132 {}
133
135 // Housekeeping
136
137 //- Deprecated(2021-04) compatibility constructor
138 // \deprecated(2021-04)
139 FOAM_DEPRECATED_FOR(2021-04, "construct mesh/fileName/dictionary")
141 (
142 const polyMesh& mesh,
143 const dictionary& dict,
144 const fileName& decompDictFile = ""
145 )
147 decompositionModel(mesh, decompDictFile, &dict)
148 {}
149
150 //- Deprecated(2021-04) compatibility selector
151 // \deprecated(2021-04)
152 FOAM_DEPRECATED_FOR(2021-04, "New mesh/fileName/dictionary")
153 static const decompositionModel& New
154 (
155 const polyMesh& mesh,
156 const dictionary& dict,
157 const fileName& decompDictFile = ""
158 )
159 {
160 return Foam::decompositionModel::New(mesh, decompDictFile, &dict);
161 }
163 //- Deprecated(2018-08) compatibility method
164 // \deprecated(2018-08) - use IOobject::selectIO directly
165 FOAM_DEPRECATED_FOR(2018-08, "IOobject::selectIO")
166 static IOobject selectIO
167 (
168 const IOobject& io,
169 const fileName& file,
170 const word& name = ""
171 )
172 {
173 return IOobject::selectIO(io, file, name);
174 }
175};
176
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180} // End namespace Foam
181
182// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183
184#endif
185
186// ************************************************************************* //
IOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Construct given an IOobject and optional fallback dictionary content.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
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
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
Abstract base class for domain decomposition.
MeshObject wrapper of decompositionMethod.
static IOobject selectIO(const IOobject &io, const fileName &file, const word &name="")
Deprecated(2018-08) compatibility method.
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...
ClassName("decompositionModel")
decompositionModel(const polyMesh &mesh, const fileName &decompDictFile="", const dictionary *fallback=nullptr)
Construct from typeName, optional decomposeParDict path/name or with fallback content.
virtual bool movePoints()
Update for mesh motion.
decompositionMethod & decomposer() const
Return demand-driven decomposition method.
static const word canonicalName
The canonical name ("decomposeParDict") under which the MeshObject is registered.
virtual void updateMesh(const mapPolyMesh &)
Update topology using the given map.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A class for handling file names.
Definition fileName.H:75
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A class for handling words, derived from Foam::string.
Definition word.H:66
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition className.H:74
dynamicFvMesh & mesh
const auto & io
const auto & fallback
Namespace for OpenFOAM.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
dictionary dict
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition stdFoam.H:43