Skip to content
Snippets Groups Projects
Commit 11a4a659 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

STYLE: avoid spurious ddt warning about unknown field (#1643)

parent 89c21888
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -53,15 +54,14 @@ bool Foam::functionObjects::ddt::calc() ...@@ -53,15 +54,14 @@ bool Foam::functionObjects::ddt::calc()
return false; return false;
} }
bool processed = false; return
(
processed = processed || calcDdt<scalar>(); calcDdt<scalar>()
processed = processed || calcDdt<vector>(); || calcDdt<vector>()
processed = processed || calcDdt<sphericalTensor>(); || calcDdt<sphericalTensor>()
processed = processed || calcDdt<symmTensor>(); || calcDdt<symmTensor>()
processed = processed || calcDdt<tensor>(); || calcDdt<tensor>()
);
return processed;
} }
...@@ -80,10 +80,4 @@ Foam::functionObjects::ddt::ddt ...@@ -80,10 +80,4 @@ Foam::functionObjects::ddt::ddt
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::ddt::~ddt()
{}
// ************************************************************************* // // ************************************************************************* //
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -40,6 +41,7 @@ See also ...@@ -40,6 +41,7 @@ See also
SourceFiles SourceFiles
ddt.C ddt.C
ddtTemplates.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
...@@ -65,12 +67,13 @@ class ddt ...@@ -65,12 +67,13 @@ class ddt
{ {
// Private Member Functions // Private Member Functions
//- Calculate the magnitude of the field and register the result //- Calculate and store the result
// \return true if fieldName_ was known and had the correct type
template<class Type> template<class Type>
bool calcDdt(); bool calcDdt();
//- Calculate the time derivative of the field and return //- Calculate time derivative of the field
// true if successful // \return true on success
virtual bool calc(); virtual bool calc();
...@@ -92,7 +95,7 @@ public: ...@@ -92,7 +95,7 @@ public:
//- Destructor //- Destructor
virtual ~ddt(); virtual ~ddt() = default;
}; };
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -35,7 +35,7 @@ bool Foam::functionObjects::ddt::calcDdt() ...@@ -35,7 +35,7 @@ bool Foam::functionObjects::ddt::calcDdt()
{ {
typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType; typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
if (foundObject<VolFieldType>(fieldName_)) if (foundObject<VolFieldType>(fieldName_, false))
{ {
return store return store
( (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment