decompositionModel.C
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) 2015-2018 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 \*---------------------------------------------------------------------------*/
28 
29 #include "decompositionModel.H"
30 #include "polyMesh.H"
31 #include "Time.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37  defineTypeNameAndDebug(decompositionModel, 0);
38 }
39 
40 const Foam::word Foam::decompositionModel::canonicalName("decomposeParDict");
41 
42 
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 
46 (
47  const polyMesh& mesh,
48  const fileName& decompDictFile
49 )
50 :
52  <
53  polyMesh,
56  >(mesh),
58  (
59  IOobject::selectIO
60  (
61  IOobject
62  (
63  canonicalName,
64  mesh.time().system(),
65  mesh.local(),
66  mesh.thisDb(),
67  IOobject::MUST_READ,
68  IOobject::NO_WRITE,
69  false, //io.registerObject(),
70  true //io.globalObject()
71  ),
72  decompDictFile
73  )
74  )
75 {}
76 
77 
79 (
80  const polyMesh& mesh,
81  const dictionary& dict,
82  const fileName& decompDictFile
83 )
84 :
86  <
87  polyMesh,
90  >(mesh),
92  (
93  IOobject::selectIO
94  (
95  IOobject
96  (
97  canonicalName,
98  mesh.time().system(),
99  mesh.local(),
100  mesh.thisDb(),
101  (dict.size() ? IOobject::NO_READ : IOobject::MUST_READ),
102  IOobject::NO_WRITE,
103  false, //io.registerObject(),
104  true //io.globalObject()
105  ),
106  decompDictFile
107  ),
108  dict
109  )
110 {}
111 
112 
113 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
114 
116 (
117  const polyMesh& mesh,
118  const fileName& decompDictFile
119 )
120 {
121  return
122  MeshObject
123  <
124  polyMesh,
127  >::New(mesh, decompDictFile);
128 }
129 
130 
132 (
133  const polyMesh& mesh,
134  const dictionary& dict,
135  const fileName& decompDictFile
136 )
137 {
138  return
139  MeshObject
140  <
141  polyMesh,
144  >::New(mesh, dict, decompDictFile);
145 }
146 
147 
148 // ************************************************************************* //
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
polyMesh.H
Foam::UpdateableMeshObject
Definition: MeshObject.H:241
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::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
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
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
Time.H
Foam::MeshObject
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:88
decompositionModel.H
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)