geometricOneField: add support for * and / of two geometricOneFields

This commit is contained in:
Henry 2013-07-04 17:21:15 +01:00
parent 144a2b232e
commit fc3883d14b
3 changed files with 45 additions and 2 deletions

View File

@ -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
@ -75,6 +75,19 @@ public:
};
inline const geometricOneField& operator*
(
const geometricOneField&,
const geometricOneField&
);
inline const geometricOneField& operator/
(
const geometricOneField&,
const geometricOneField&
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -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
@ -48,4 +48,23 @@ inline Foam::oneFieldField Foam::geometricOneField::boundaryField() const
}
inline const Foam::geometricOneField& Foam::operator*
(
const geometricOneField& gof,
const geometricOneField&
)
{
return gof;
}
inline const Foam::geometricOneField& Foam::operator/
(
const geometricOneField& gof,
const geometricOneField&
)
{
return gof;
}
// ************************************************************************* //

View File

@ -32,6 +32,11 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const one& operator*(const one& o, const one&)
{
return o;
}
template<class Type>
inline const Type& operator*(const Type& t, const one&)
{
@ -44,6 +49,12 @@ inline const Type& operator*(const one&, const Type& t)
return t;
}
inline const one& operator/(const one& o, const one&)
{
return o;
}
template<class Type>
inline Type operator/(const one&, const Type& t)
{