src/OpenFOAM/primitives: Moved the standard static data members for vector and tensor types into VectorSpace

This simplifies the code easing maintenance and the addition of other
VectorSpace types.
This commit is contained in:
Henry Weller
2016-03-08 10:57:41 +00:00
parent 8a93701ef2
commit 93285d5fe1
49 changed files with 771 additions and 649 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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,37 +28,52 @@ Description
#include "complexVector.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<>
const char* const complexVector::typeName = "complexVector";
const char* const Foam::complexVector::vsType::typeName = "complexVector";
template<>
const char* complexVector::componentNames[] = {"x", "y", "z"};
const char* const Foam::complexVector::vsType::componentNames[] =
{
"x", "y", "z"
};
template<>
const complexVector complexVector::zero
const Foam::complexVector Foam::complexVector::vsType::zero
(
complex(0, 0),
complex(0, 0),
complex(0, 0)
complexVector::uniform(complex(0, 0))
);
template<>
const complexVector complexVector::one
const Foam::complexVector Foam::complexVector::vsType::one
(
complex(1, 1),
complex(1, 1),
complex(1, 1)
complexVector::uniform(complex(1, 1))
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<>
const Foam::complexVector Foam::complexVector::vsType::max
(
complexVector::uniform(complex(VGREAT, VGREAT))
);
template<>
const Foam::complexVector Foam::complexVector::vsType::min
(
complexVector::uniform(complex(-VGREAT, -VGREAT))
);
template<>
const Foam::complexVector Foam::complexVector::vsType::rootMax
(
complexVector::uniform(complex(ROOTVGREAT, ROOTVGREAT))
);
template<>
const Foam::complexVector Foam::complexVector::vsType::rootMin
(
complexVector::uniform(complex(-ROOTVGREAT, -ROOTVGREAT))
);
} // End namespace Foam
// ************************************************************************* //