Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
12d9a159
Commit
12d9a159
authored
Feb 11, 2019
by
mattijs
Committed by
Andrew Heather
Feb 11, 2019
Browse files
ENH: Function1: better error message. Fixes
#1200
.
parent
9580a0e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/primitives/functions/Function1/Function1/Function1New.C
View file @
12d9a159
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018
-2019
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
...
...
@@ -52,13 +52,13 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New
if
(
!
cstrIter
.
found
())
{
FatalErrorInFunction
Fatal
IO
ErrorInFunction
(
dict
)
<<
"Unknown Function1 type "
<<
Function1Type
<<
" for Function1 "
<<
entryName
<<
nl
<<
nl
<<
"Valid Function1 types :"
<<
nl
<<
dictionaryConstructorTablePtr_
->
sortedToc
()
<<
nl
<<
exit
(
FatalError
);
<<
exit
(
Fatal
IO
Error
);
}
return
cstrIter
()(
entryName
,
coeffsDict
);
...
...
@@ -90,23 +90,31 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New
Function1Type
=
firstToken
.
wordToken
();
}
}
else
else
if
(
redirectType
!=
word
::
null
)
{
Function1Type
=
redirectType
;
}
else
{
FatalIOErrorInFunction
(
dict
)
<<
"Cannot find specification for Function1 "
<<
entryName
<<
nl
<<
nl
<<
"Valid Function1 types :"
<<
nl
<<
dictionaryConstructorTablePtr_
->
sortedToc
()
<<
nl
<<
exit
(
FatalIOError
);
}
auto
cstrIter
=
dictionaryConstructorTablePtr_
->
cfind
(
Function1Type
);
if
(
!
cstrIter
.
found
())
{
FatalErrorInFunction
Fatal
IO
ErrorInFunction
(
dict
)
<<
"Unknown Function1 type "
<<
Function1Type
<<
" for Function1 "
<<
entryName
<<
nl
<<
nl
<<
"Valid Function1 types :"
<<
nl
<<
dictionaryConstructorTablePtr_
->
sortedToc
()
<<
nl
<<
exit
(
FatalError
);
<<
exit
(
Fatal
IO
Error
);
}
return
cstrIter
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment