diff --git a/Geo/STensor3.h b/Geo/STensor3.h index f4afda115f676d4c6239650f03ad6fc5af71a9a8..2be7571fa02879748f52a74f66ec925263eb5a9d 100644 --- a/Geo/STensor3.h +++ b/Geo/STensor3.h @@ -339,6 +339,15 @@ class STensor3 { val = fabs(_val[i]); return val; }; + double norm2()const{ + double sqr = 0; + for (int i=0; i<3; i++){ + for (int j =0; j<3; j++){ + sqr += this->operator()(i,j)*this->operator()(i,j); + } + } + return sqrt(sqr); + } }; // tensor product