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-2020 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 
69  // Private Data
70 
71  mutable autoPtr<decompositionMethod> decomposerPtr_;
72 
73 
74 public:
75 
76  // Declare name of the class and its debug switch
77  ClassName("decompositionModel");
78 
79  //- The canonical name ("decomposeParDict") under which the
80  //- MeshObject is registered
81  static const word canonicalName;
82 
83 
84  // Selectors
85 
86  //- Read (optionally from absolute path) and register on mesh
87  static const decompositionModel& New
88  (
89  const polyMesh& mesh,
90  const fileName& decompDictFile = ""
91  );
92 
93  //- Read (optionally from supplied dictionary) and register on mesh
94  static const decompositionModel& New
95  (
96  const polyMesh& mesh,
97  const dictionary& dict,
98  const fileName& decompDictFile = ""
99  );
100 
101 
102  // Constructors
103 
104  //- Construct from typeName or optional path to controlDictionary
106  (
107  const polyMesh& mesh,
108  const fileName& decompDictFile = ""
109  );
110 
111 
112  //- Construct from typeName or optional path to controlDictionary
114  (
115  const polyMesh& mesh,
116  const dictionary& dict,
117  const fileName& decompDictFile = ""
118  );
119 
120 
121  // Member Functions
122 
124  {
125  if (!decomposerPtr_)
126  {
127  decomposerPtr_ =
129  (
130  *this,
131  this->mesh().name() // Name of mesh region
132  );
133  }
134  return *decomposerPtr_;
135  }
136 
137 
138  // UpdateableMeshObject
139 
140  virtual bool movePoints()
141  {
142  return false;
143  }
144 
145  virtual void updateMesh(const mapPolyMesh&)
146  {}
147 
148 
149  // Housekeeping
150 
151  //- Deprecated(2018-08) compatibility method
152  // \deprecated(2018-08) - use IOobject::selectIO directly
154  (
155  const IOobject& io,
156  const fileName& altFile,
157  const word& ioName = ""
158  )
159  {
160  return IOobject::selectIO(io, altFile, ioName);
161  }
162 
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
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:104
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
decompositionMethod.H
Foam::baseIOdictionary::name
const word & name() const
Definition: baseIOdictionary.C:82
Foam::decompositionModel::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Definition: decompositionModel.H:144
Foam::decompositionModel
MeshObject wrapper of decompositionMethod.
Definition: decompositionModel.H:57
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::decompositionModel::canonicalName
static const word canonicalName
Definition: decompositionModel.H:80
Foam::MeshObject< polyMesh, UpdateableMeshObject, decompositionModel >::mesh
const polyMesh & mesh() const
Definition: MeshObject.H:122
Foam::decompositionModel::decomposer
decompositionMethod & decomposer() const
Definition: decompositionModel.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:214
Foam::decompositionModel::decompositionModel
decompositionModel(const polyMesh &mesh, const fileName &decompDictFile="")
Construct from typeName or optional path to controlDictionary.
Definition: decompositionModel.C:46
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:121
Foam::decompositionMethod
Abstract base class for domain decomposition.
Definition: decompositionMethod.H:51
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::decompositionModel::New
static const decompositionModel & New(const polyMesh &mesh, const fileName &decompDictFile="")
Read (optionally from absolute path) and register on mesh.
Definition: decompositionModel.C:116
IOdictionary.H
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")
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::selectIO
static IOobject selectIO(const IOobject &io, const fileName &altFile, const word &ioName="")
Deprecated(2018-08) compatibility method.
Definition: decompositionModel.H:153
Foam::decompositionModel::movePoints
virtual bool movePoints()
Definition: decompositionModel.H:139
Foam::decompositionMethod::New
static autoPtr< decompositionMethod > New(const dictionary &decompDict)
Return a reference to the selected decomposition method.
Definition: decompositionMethod.C:359