OpenFOAM
dev
The OpenFOAM Foundation
solidBodyMotionFunctionNew.C
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration | Website: https://openfoam.org
5
\\ / A nd | Copyright (C) 2011-2026 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
\*---------------------------------------------------------------------------*/
25
26
#include "
solidBodyMotionFunction.H
"
27
28
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
29
30
Foam::autoPtr<Foam::solidBodyMotionFunction>
Foam::solidBodyMotionFunction::New
31
(
32
const
dictionary
&
dict
,
33
const
Time
& runTime,
34
const
word
&
name
35
)
36
{
37
const
dictionary
& coeffDict
38
(
39
dict
.isDict(
name
)
40
?
dict
.subDict(
name
)
41
:
dict
42
);
43
44
const
word
motionType
45
(
46
dict
.isDict(
name
)
47
? coeffDict.
lookup
(
"type"
)
48
:
dict
.lookup(
name
)
49
);
50
51
Info
<<
indentOrNl
52
<<
"Selecting solid-body motion function "
<< motionType <<
endl
;
53
54
dictionaryConstructorTable::iterator cstrIter =
55
dictionaryConstructorTablePtr_->find(motionType);
56
57
if
(cstrIter == dictionaryConstructorTablePtr_->end())
58
{
59
FatalIOErrorInFunction
(coeffDict)
60
<<
"Unknown solidBodyMotionFunction type "
61
<< motionType <<
nl
<<
nl
62
<<
"Valid solidBodyMotionFunctions are : "
<<
endl
63
<< dictionaryConstructorTablePtr_->sortedToc()
64
<<
exit
(
FatalIOError
);
65
}
66
67
return
autoPtr<solidBodyMotionFunction>
68
(
69
cstrIter()(
name
, coeffDict, runTime)
70
);
71
}
72
73
74
// ************************************************************************* //
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition:
Time.H:76
Foam::autoPtr< Foam::solidBodyMotionFunction >
Foam::dictionary
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition:
dictionary.H:162
Foam::dictionary::lookup
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition:
dictionary.C:669
Foam::solidBodyMotionFunction::name
const word & name() const
Definition:
solidBodyMotionFunction.H:126
Foam::solidBodyMotionFunction::New
static autoPtr< solidBodyMotionFunction > New(const dictionary &SBMFCoeffs, const Time &runTime, const word &name="solidBodyMotionFunction")
Select constructed from the SBMFCoeffs dictionary and Time.
Definition:
solidBodyMotionFunctionNew.C:31
Foam::word
A class for handling words, derived from string.
Definition:
word.H:63
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition:
error.H:346
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition:
errorManip.H:124
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:288
Foam::Info
messageStream Info
Foam::FatalIOError
IOerror FatalIOError
Foam::name
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Definition:
LagrangianState.C:30
Foam::indentOrNl
Ostream & indentOrNl(Ostream &os)
Indent stream or add newline if indent level == 0.
Definition:
Ostream.H:250
Foam::nl
static const char nl
Definition:
Ostream.H:297
dict
dictionary dict
Definition:
searchingEngine.H:14
solidBodyMotionFunction.H
src
pointMeshMovers
solidBodyMotionFunctions
solidBodyMotionFunction
solidBodyMotionFunctionNew.C
Generated by
1.9.1