diff --git a/src/OpenFOAM/coordinateSystems/coordinateRotation/coordinateRotation.H b/src/OpenFOAM/coordinateSystems/coordinateRotation/coordinateRotation.H index d758d49ad..098355901 100644 --- a/src/OpenFOAM/coordinateSystems/coordinateRotation/coordinateRotation.H +++ b/src/OpenFOAM/coordinateSystems/coordinateRotation/coordinateRotation.H @@ -185,19 +185,19 @@ public: } //- Return local Cartesian x-axis - const vector e1() const + vector e1() const { return tensor::T().x(); } //- Return local Cartesian y-axis - const vector e2() const + vector e2() const { return tensor::T().y(); } //- Return local Cartesian z-axis - const vector e3() const + vector e3() const { return tensor::T().z(); } diff --git a/src/OpenFOAM/coordinateSystems/coordinateSystem.H b/src/OpenFOAM/coordinateSystems/coordinateSystem.H index 9cbe20f94..fc3a3985f 100644 --- a/src/OpenFOAM/coordinateSystems/coordinateSystem.H +++ b/src/OpenFOAM/coordinateSystems/coordinateSystem.H @@ -348,26 +348,26 @@ public: } //- Return local Cartesian x-axis - const vector e1() const + vector e1() const { return Rtr_.x(); } //- Return local Cartesian y-axis - const vector e2() const + vector e2() const { return Rtr_.y(); } //- Return local Cartesian z-axis - const vector e3() const + vector e3() const { return Rtr_.z(); } //- Return axis (e3: local Cartesian z-axis) // @deprecated method e3 is preferred - const vector axis() const + vector axis() const { return Rtr_.z(); } diff --git a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C index adcde4bf2..5f466159c 100644 --- a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C +++ b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C @@ -269,6 +269,9 @@ tensor eigenVectors(const tensor& t) // Modification for strict-aliasing compliance. // Sandeep Menon, 01/Dec/2010 + + // Test for null eigen values to return a not null eigen vector + // Jovani Favero, 18/Nov/2009 tensor evs ( (mag(evals.x()) < SMALL) ? vector(0, 0, 1) : eigenVector(t, evals.x()), @@ -276,37 +279,6 @@ tensor eigenVectors(const tensor& t) (mag(evals.z()) < SMALL) ? vector(1, 0, 0) : eigenVector(t, evals.z()) ); - /* - // Test for null eigen values to return a not null eigen vector - // Jovani Favero, 18/Nov/2009 - if (mag(evals.x()) < SMALL) - { - evs.x() = vector(0, 0, 1); - } - else - { - evs.x() = eigenVector(t, evals.x()); - } - - if (mag(evals.y()) < SMALL) - { - evs.y() = vector(0, 1, 0); - } - else - { - evs.y() = eigenVector(t, evals.y()); - } - - if (mag(evals.z()) < SMALL) - { - evs.z() = vector(1, 0, 0); - } - else - { - evs.z() = eigenVector(t, evals.z()); - } - */ - return evs; } diff --git a/src/OpenFOAM/primitives/Tensor2D/Tensor2D.H b/src/OpenFOAM/primitives/Tensor2D/Tensor2D.H index a9f0f593a..0f124cc41 100644 --- a/src/OpenFOAM/primitives/Tensor2D/Tensor2D.H +++ b/src/OpenFOAM/primitives/Tensor2D/Tensor2D.H @@ -126,10 +126,9 @@ public: inline Cmpt& yy(); // Access vector components. - // Note: returning const only to find out lhs usage - inline const Vector2D x() const; - inline const Vector2D y() const; + inline Vector2D x() const; + inline Vector2D y() const; //- Transpose inline Tensor2D T() const; diff --git a/src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H b/src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H index 556eae234..3c111cfbb 100644 --- a/src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H +++ b/src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H @@ -85,13 +85,13 @@ inline Tensor2D::Tensor2D(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -inline const Vector2D Tensor2D::x() const +inline Vector2D Tensor2D::x() const { return Vector2D(this->v_[XX], this->v_[XY]); } template -inline const Vector2D Tensor2D::y() const +inline Vector2D Tensor2D::y() const { return Vector2D(this->v_[YX], this->v_[YY]); }