mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: solution: moved debug printing
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -112,6 +112,15 @@ public:
|
||||
//- Return true if the given field should be cached
|
||||
bool cache(const word& name) const;
|
||||
|
||||
//- Helper for printing cache message
|
||||
template<class FieldType>
|
||||
static void cachePrintMessage
|
||||
(
|
||||
const char* message,
|
||||
const word& name,
|
||||
const FieldType& vf
|
||||
);
|
||||
|
||||
//- Return true if the relaxation factor is given for the field
|
||||
bool relaxField(const word& name) const;
|
||||
|
||||
@ -148,6 +157,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "solutionTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
52
src/OpenFOAM/matrices/solution/solutionTemplates.C
Normal file
52
src/OpenFOAM/matrices/solution/solutionTemplates.C
Normal file
@ -0,0 +1,52 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "solution.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class FieldType>
|
||||
void Foam::solution::cachePrintMessage
|
||||
(
|
||||
const char* message,
|
||||
const word& name,
|
||||
const FieldType& vf
|
||||
)
|
||||
{
|
||||
if (solution::debug)
|
||||
{
|
||||
Info<< "Cache: " << message << token::SPACE << name
|
||||
<< ", originating from " << vf.name()
|
||||
<< " event No. " << vf.eventNo()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -87,25 +87,6 @@ Foam::fv::gradScheme<Type>::~gradScheme()
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
template<class Type>
|
||||
inline void cachePrintMessage
|
||||
(
|
||||
const char* message,
|
||||
const word& name,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
)
|
||||
{
|
||||
if (solution::debug)
|
||||
{
|
||||
Info<< "Cache: " << message << token::SPACE << name
|
||||
<< ", " << vf.name() << " event No. " << vf.eventNo()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp
|
||||
<
|
||||
@ -129,12 +110,12 @@ Foam::fv::gradScheme<Type>::grad
|
||||
{
|
||||
if (!mesh().objectRegistry::template foundObject<GradFieldType>(name))
|
||||
{
|
||||
cachePrintMessage("Calculating and caching", name, vsf);
|
||||
solution::cachePrintMessage("Calculating and caching", name, vsf);
|
||||
tmp<GradFieldType> tgGrad = calcGrad(vsf, name);
|
||||
regIOobject::store(tgGrad.ptr());
|
||||
}
|
||||
|
||||
cachePrintMessage("Retrieving", name, vsf);
|
||||
solution::cachePrintMessage("Retrieving", name, vsf);
|
||||
GradFieldType& gGrad = const_cast<GradFieldType&>
|
||||
(
|
||||
mesh().objectRegistry::template lookupObject<GradFieldType>(name)
|
||||
@ -146,14 +127,14 @@ Foam::fv::gradScheme<Type>::grad
|
||||
}
|
||||
else
|
||||
{
|
||||
cachePrintMessage("Deleting", name, vsf);
|
||||
solution::cachePrintMessage("Deleting", name, vsf);
|
||||
gGrad.release();
|
||||
delete &gGrad;
|
||||
|
||||
cachePrintMessage("Recalculating", name, vsf);
|
||||
solution::cachePrintMessage("Recalculating", name, vsf);
|
||||
tmp<GradFieldType> tgGrad = calcGrad(vsf, name);
|
||||
|
||||
cachePrintMessage("Storing", name, vsf);
|
||||
solution::cachePrintMessage("Storing", name, vsf);
|
||||
regIOobject::store(tgGrad.ptr());
|
||||
GradFieldType& gGrad = const_cast<GradFieldType&>
|
||||
(
|
||||
@ -180,13 +161,13 @@ Foam::fv::gradScheme<Type>::grad
|
||||
|
||||
if (gGrad.ownedByRegistry())
|
||||
{
|
||||
cachePrintMessage("Deleting", name, vsf);
|
||||
solution::cachePrintMessage("Deleting", name, vsf);
|
||||
gGrad.release();
|
||||
delete &gGrad;
|
||||
}
|
||||
}
|
||||
|
||||
cachePrintMessage("Calculating", name, vsf);
|
||||
solution::cachePrintMessage("Calculating", name, vsf);
|
||||
return calcGrad(vsf, name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user