Function1: Improved error messages when evaluation or integration are undefined
This commit is contained in:
@ -67,7 +67,9 @@ void Foam::Function1<Type>::convertTimeBase(const Time&)
|
||||
template<class Type>
|
||||
Type Foam::Function1<Type>::value(const scalar x) const
|
||||
{
|
||||
NotImplemented;
|
||||
FatalErrorInFunction
|
||||
<< "Evaluation is not defined for " << type() << " functions"
|
||||
<< exit(FatalError);
|
||||
|
||||
return Zero;
|
||||
}
|
||||
@ -76,7 +78,9 @@ Type Foam::Function1<Type>::value(const scalar x) const
|
||||
template<class Type>
|
||||
Type Foam::Function1<Type>::integrate(const scalar x1, const scalar x2) const
|
||||
{
|
||||
NotImplemented;
|
||||
FatalErrorInFunction
|
||||
<< "Integration is not defined for " << type() << " functions"
|
||||
<< exit(FatalError);
|
||||
|
||||
return Zero;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -74,7 +74,10 @@ Foam::Function1Types::Constant<Foam::label>::integrate
|
||||
const scalarField& x2
|
||||
) const
|
||||
{
|
||||
NotImplemented;
|
||||
FatalErrorInFunction
|
||||
<< "Evaluation is not defined for " << type() << " functions"
|
||||
<< exit(FatalError);
|
||||
|
||||
return tmp<Field<label>>(new Field<label>(x1.size()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user