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 | Copyright (C) 2014 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::decompositionModel
26 
27 Description
28  MeshObject wrapper of decompositionMethod
29 
30 SourceFiles
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef decompositionModel_H
35 #define decompositionModel_H
36 
37 #include "IOdictionary.H"
38 #include "MeshObject.H"
39 #include "decompositionMethod.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 class mapPolyMesh;
48 class polyMesh;
49 
50 /*---------------------------------------------------------------------------*\
51  Class decompositionModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public MeshObject
57  <
58  polyMesh,
59  UpdateableMeshObject,
60  decompositionModel
61  >,
62  public IOdictionary
63 {
64 
65  // Private data
66 
68 
69 
70 public:
71 
72  // Declare name of the class and its debug switch
73  ClassName("decompositionModel");
74 
75 
76  // Selectors
77 
78  //- Read (optionallly from absolute path) & register on mesh
79  static const decompositionModel& New
80  (
81  const polyMesh& mesh,
82  const fileName& decompDictFile = ""
83  );
84 
85  //- Read (optionallly from supplied dictionary) & register on mesh
86  static const decompositionModel& New
87  (
88  const polyMesh& mesh,
89  const dictionary& dict,
90  const fileName& decompDictFile = ""
91  );
92 
93 
94  // Constructors
95 
96  //- Construct from typeName or optional path to controlDictionary
97  decompositionModel(const polyMesh&, const fileName& = "");
98 
99 
100  //- Construct from typeName or optional path to controlDictionary
102  (
103  const polyMesh&,
104  const dictionary& dict,
105  const fileName& = ""
106  );
107 
108 
109  // Member functions
110 
112  {
113  if (!decomposerPtr_.valid())
114  {
116  }
117  return decomposerPtr_();
118  }
119 
120  //- Helper: return IOobject with optionally absolute path provided
121  static IOobject selectIO(const IOobject&, const fileName&);
122 
123 
124  // UpdateableMeshObject
125 
126  virtual bool movePoints()
127  {
128  return false;
129  }
130 
131  virtual void updateMesh(const mapPolyMesh&)
132  {}
133 
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::decompositionMethod::New
static autoPtr< decompositionMethod > New(const dictionary &decompositionDict)
Return a reference to the selected decomposition method.
Definition: decompositionMethod.C:179
Foam::decompositionModel::selectIO
static IOobject selectIO(const IOobject &, const fileName &)
Helper: return IOobject with optionally absolute path provided.
Definition: decompositionModel.C:143
decompositionMethod.H
Foam::decompositionModel::decomposerPtr_
autoPtr< decompositionMethod > decomposerPtr_
Definition: decompositionModel.H:66
Foam::decompositionModel::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Definition: decompositionModel.H:130
Foam::decompositionModel
MeshObject wrapper of decompositionMethod.
Definition: decompositionModel.H:53
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::decompositionModel::decompositionModel
decompositionModel(const polyMesh &, const fileName &="")
Construct from typeName or optional path to controlDictionary.
Definition: decompositionModel.C:40
Foam::MeshObject< polyMesh, UpdateableMeshObject, decompositionModel >::mesh
const polyMesh & mesh() const
Definition: MeshObject.H:144
Foam::decompositionModel::decomposer
decompositionMethod & decomposer() const
Definition: decompositionModel.H:110
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::decompositionMethod
Abstract base class for decomposition.
Definition: decompositionMethod.H:48
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::decompositionModel::New
static const decompositionModel & New(const polyMesh &mesh, const fileName &decompDictFile="")
Read (optionallly from absolute path) & register on mesh.
Definition: decompositionModel.C:108
IOdictionary.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
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:158
Foam::MeshObject
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:81
Foam::decompositionModel::movePoints
virtual bool movePoints()
Definition: decompositionModel.H:125