diff --git a/Geo/STensor3.h b/Geo/STensor3.h index 63413901cef327dcc0ff03d642478676a6caa12a..26ed1893dc170632f9d246f858b5668863ac5b25 100644 --- a/Geo/STensor3.h +++ b/Geo/STensor3.h @@ -191,7 +191,7 @@ class STensor3 { { for (int i = 0; i < 3; i++){ for (int j = 0; j < 3; j++){ - mat(i,j) = _val[getIndex(i, j)]; + mat(i,j) = _val[getIndex(i, j)]; } } } @@ -205,8 +205,8 @@ class STensor3 { { for (int i = 0; i < 9; i++) _val[i] = other._val[i]; } - // default constructor, identity - STensor3(const double v = 1.0) + // default constructor, null tensor + STensor3(const double v = 0.0) { _val[0] = _val[4] = _val[8] = v; _val[1] = _val[2] = _val[3] = 0.0; @@ -275,5 +275,15 @@ inline double dot(const STensor3 &a, const STensor3 &b) return prod; } +inline STensor3 operator*(const STensor3 &t, double m) +{ STensor3 val(t); + val*=m; + return val; } + +inline STensor3 operator*(double m,const STensor3 &t) +{ STensor3 val(t); + val*=m; + return val; } + #endif diff --git a/Geo/SVector3.h b/Geo/SVector3.h index da0c486a1b3d467925026bc2a9365b1b36d32092..31e4aa7d6be2de2a1b1098642ebbf0ff36cb2ab4 100644 --- a/Geo/SVector3.h +++ b/Geo/SVector3.h @@ -15,7 +15,7 @@ class SVector3 { protected: SPoint3 P; public: - SVector3() {} + SVector3():P() {} // Construct from 2 SPoints, vector from p1 to p2 SVector3(const SPoint3 &p1, const SPoint3 &p2) : P(p2 - p1) {} // Construct from a single SPoint, vector from origin to p1