OpenFOAM: API Guide
v2112
The open source CFD toolbox
engineMeshNew.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) 2011-2015 OpenFOAM Foundation
9
Copyright (C) 2019-2021 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 "
engineMesh.H
"
30
#include "
Time.H
"
31
32
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
33
34
Foam::autoPtr<Foam::engineMesh>
Foam::engineMesh::New
(
const
IOobject
&
io
)
35
{
36
const
IOdictionary
dict
37
(
38
IOobject
39
(
40
"engineGeometry"
,
41
io
.
time
().
constant
(),
42
io
.
db
(),
43
IOobject::MUST_READ_IF_MODIFIED
,
44
IOobject::NO_WRITE
,
45
false
// Do not register
46
)
47
);
48
49
const
word
modelType(
dict
.
get
<
word
>(
"engineMesh"
));
50
51
Info
<<
"Selecting engineMesh "
<< modelType <<
endl
;
52
53
auto
* ctorPtr = IOobjectConstructorTable(modelType);
54
55
if
(!ctorPtr)
56
{
57
FatalIOErrorInLookup
58
(
59
dict
,
60
"engineMesh"
,
61
modelType,
62
*IOobjectConstructorTablePtr_
63
) <<
exit
(
FatalIOError
);
64
}
65
66
return
autoPtr<engineMesh>
(ctorPtr(
io
));
67
}
68
69
70
// ************************************************************************* //
Time.H
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition:
IOdictionary.H:57
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition:
IOobject.H:170
Foam::IOobject::time
const Time & time() const
Return Time associated with the objectRegistry.
Definition:
IOobject.C:506
Foam::IOobject::db
const objectRegistry & db() const noexcept
Return the local objectRegistry.
Definition:
IOobject.C:500
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition:
IOobject.H:187
Foam::IOobject::MUST_READ_IF_MODIFIED
@ MUST_READ_IF_MODIFIED
Definition:
IOobject.H:180
Foam::TimePaths::constant
const word & constant() const
Return constant name.
Definition:
TimePathsI.H:96
Foam::Time::New
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition:
Time.C:717
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition:
autoPtr.H:66
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition:
dictionaryTemplates.C:107
Foam::word
A class for handling words, derived from Foam::string.
Definition:
word.H:68
engineMesh.H
FatalIOErrorInLookup
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition:
error.H:478
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:372
Foam::FatalIOError
IOerror FatalIOError
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition:
errorManip.H:130
dict
dictionary dict
Definition:
searchingEngine.H:14
src
engine
engineMesh
engineMesh
engineMeshNew.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.