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 decompositionModel_H
39#define 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;
53
54/*---------------------------------------------------------------------------*\
55 Class decompositionModel Declaration
56\*---------------------------------------------------------------------------*/
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
73public:
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
116 virtual bool movePoints()
117 {
118 return false;
119 }
121 virtual void updateMesh(const mapPolyMesh&)
122 {}
123
124
125 // Housekeeping
126
127 //- Deprecated(2021-04) compatibility constructor
128 // \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)
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// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170} // End namespace Foam
171
172// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173
174#endif
175
176// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
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
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:91
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
const word & name() const
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 word canonicalName
ClassName("decompositionModel")
static const decompositionModel & New(const polyMesh &mesh, const fileName &decompDictFile="", const dictionary *fallback=nullptr)
decompositionMethod & decomposer() const
Return demand-driven decomposition method.
virtual void updateMesh(const mapPolyMesh &)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
dictionary dict
#define FOAM_DEPRECATED(since)
Definition: stdFoam.H:51
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition: stdFoam.H:52