Skip to content
Snippets Groups Projects
Commit 94e617c5 authored by Van Dung Nguyen's avatar Van Dung Nguyen
Browse files

No commit message

No commit message
parent 847ce8c9
No related branches found
No related tags found
No related merge requests found
...@@ -316,6 +316,7 @@ inline void tensprod(const SVector3 &a, const SVector3 &b, STensor3 &c) ...@@ -316,6 +316,7 @@ inline void tensprod(const SVector3 &a, const SVector3 &b, STensor3 &c)
c(i,j)=a(i)*b(j); c(i,j)=a(i)*b(j);
} }
inline double dot(const STensor3 &a, const STensor3 &b) inline double dot(const STensor3 &a, const STensor3 &b)
{ {
double prod=0; double prod=0;
...@@ -325,6 +326,23 @@ inline double dot(const STensor3 &a, const STensor3 &b) ...@@ -325,6 +326,23 @@ inline double dot(const STensor3 &a, const STensor3 &b)
return prod; return prod;
} }
inline SVector3 operator* (const STensor3& t, const SVector3& v){
SVector3 temp(0.,0.,0.);
for (int i=0; i<3; i++)
for (int j=0; j<3; j++)
temp[i]+= t(i,j)*v[j];
return temp;
};
inline SVector3 operator* (const SVector3& v, const STensor3& t){
SVector3 temp(0.,0.,0.);
for (int i=0; i<3; i++)
for (int j=0; j<3; j++)
temp[j]+= v[i]*t(i,j);
return temp;
};
inline STensor3 operator*(const STensor3 &t, double m) inline STensor3 operator*(const STensor3 &t, double m)
{ {
STensor3 val(t); STensor3 val(t);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment