diff --git a/applications/test/complex/Test-complex.C b/applications/test/complex/Test-complex.C index 8a4442335b32b12b0da5ddeadb1b66488e97f700..9f26407fd18ae6a34898cdda7524977c29c17030 100644 --- a/applications/test/complex/Test-complex.C +++ b/applications/test/complex/Test-complex.C @@ -48,8 +48,8 @@ int main(int argc, char *argv[]) { Info<< "complex() : " << complex() << nl << "complex(zero) : " << complex(Zero) << nl - << "complex::zero : " << complex::zero << nl - << "complex::one : " << complex::one << nl + << "pTraits<complex>::zero : " << pTraits<complex>::zero << nl + << "pTraits<complex>::one : " << pTraits<complex>::one << nl << "complex(scalar) : " << complex(3.14519) << nl << nl; @@ -57,7 +57,6 @@ int main(int argc, char *argv[]) Info<< "std::complex : " << c1 << nl; Info<< "sin: " << std::sin(c1) << nl; - Info<< "complexVector::zero : " << complexVector::zero << nl << "complexVector::one : " << complexVector::one << nl << nl; @@ -120,7 +119,7 @@ int main(int argc, char *argv[]) Info<< nl << "Elementary complex arithmetic operations:" << nl; { - complex a (6, 1); + complex a(6, 1); complex b = a; Info << "Compound assignment operations:" << nl; @@ -160,13 +159,12 @@ int main(int argc, char *argv[]) // Scalar division b = 1.0/b; Info<< "1/b (elementwise division):" << tab << b << nl; - - } + } Info<< nl << "Other mathematical expressions:" << nl; { - complex a (4.3, -3.14); - complex b (0, -4.3); + complex a(4.3, -3.14); + complex b(0, -4.3); Info<< "a=" << a << tab << "b=" << b << nl; diff --git a/src/OpenFOAM/primitives/Vector/complexVector/complexVector.C b/src/OpenFOAM/primitives/Vector/complexVector/complexVector.C index f2da82e7da1eb45fde09b5e0611265409d15a8cb..22a4413f07468541f3231838940b484b60881ec1 100644 --- a/src/OpenFOAM/primitives/Vector/complexVector/complexVector.C +++ b/src/OpenFOAM/primitives/Vector/complexVector/complexVector.C @@ -44,37 +44,37 @@ const char* const Foam::complexVector::vsType::componentNames[] = template<> const Foam::complexVector Foam::complexVector::vsType::zero ( - complexVector::uniform(complex::zero) + complexVector::uniform(pTraits<complex>::zero) ); template<> const Foam::complexVector Foam::complexVector::vsType::one ( - complexVector::uniform(complex::one) + complexVector::uniform(pTraits<complex>::one) ); template<> const Foam::complexVector Foam::complexVector::vsType::max ( - complexVector::uniform(complex(VGREAT, VGREAT)) + complexVector::uniform(pTraits<complex>::max) ); template<> const Foam::complexVector Foam::complexVector::vsType::min ( - complexVector::uniform(complex(-VGREAT, -VGREAT)) + complexVector::uniform(pTraits<complex>::min) ); template<> const Foam::complexVector Foam::complexVector::vsType::rootMax ( - complexVector::uniform(complex(ROOTVGREAT, ROOTVGREAT)) + complexVector::uniform(pTraits<complex>::rootMax) ); template<> const Foam::complexVector Foam::complexVector::vsType::rootMin ( - complexVector::uniform(complex(-ROOTVGREAT, -ROOTVGREAT)) + complexVector::uniform(pTraits<complex>::rootMin) ); diff --git a/src/OpenFOAM/primitives/complex/complex.C b/src/OpenFOAM/primitives/complex/complex.C index df3c0ca872623a7e60357395c4f86d2ab6d09a36..0d7a1b218663dd6222c3c171c718e38cd21cb486 100644 --- a/src/OpenFOAM/primitives/complex/complex.C +++ b/src/OpenFOAM/primitives/complex/complex.C @@ -30,12 +30,6 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -const Foam::complex Foam::complex::zero(0, 0); -const Foam::complex Foam::complex::one(1, 0); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - const char* const Foam::pTraits<Foam::complex>::typeName = "complex"; const char* const Foam::pTraits<Foam::complex>::componentNames[] = {"re", "im"}; diff --git a/src/OpenFOAM/primitives/complex/complex.H b/src/OpenFOAM/primitives/complex/complex.H index c765813a1ce6d73924dfb2b9c798a5a8a0486cc2..d72556be9da4543ca30d3a09095b003a00d7df89 100644 --- a/src/OpenFOAM/primitives/complex/complex.H +++ b/src/OpenFOAM/primitives/complex/complex.H @@ -85,22 +85,6 @@ class complex public: - //- Component type - typedef complex cmptType; - - - // Static Data Members - - //- The type name is "complex" - static constexpr const char* const typeName = "complex"; - - //- A complex zero (0,0) - static const complex zero; - - //- A complex one (1,0) - static const complex one; - - // Constructors //- Construct null as zero-initialized @@ -273,12 +257,13 @@ public: static const char* const typeName; static const char* const componentNames[]; - static const complex zero; - static const complex one; - static const complex max; - static const complex min; - static const complex rootMax; - static const complex rootMin; + + static const complex zero; //!< complex (0,0) + static const complex one; //!< complex (1,0) + static const complex min; //!< complex (-VGREAT,-VGREAT) + static const complex max; //!< complex (VGREAT,VGREAT) + static const complex rootMin; //!< complex (-ROOTVGREAT, -ROOTVGREAT) + static const complex rootMax; //!< complex (ROOTVGREAT, ROOTVGREAT) // Constructors