1#ifndef _chi_meshmatrix3x3_h
2#define _chi_meshmatrix3x3_h
42 if (n.
Dot(khat) > 0.9999999)
44 else if (n.
Dot(khat) < -0.9999999)
62 this->vals[k] = inM.
vals[k];
71 oM.
vals[k] = this->vals[k] + inM.
vals[k];
80 oM.
vals[k] = this->vals[k] - inM.
vals[k];
88 for (
int k=0; k<9; k++)
90 oM.
vals[k] = this->vals[k]*value;
98 double i_vec[] = {vec.
x,vec.
y,vec.
z};
99 double o_vec[] = {0.0,0.0,0.0};
101 for (
int i=0;i<3;i++)
103 for (
int j=0;j<3;j++)
105 o_vec[i] += this->
GetIJ(i,j)*i_vec[j];
108 Vector3 oV(o_vec[0], o_vec[1], o_vec[2]);
113 void SetIJ(
int i,
int j,
double value)
120 void AddIJ(
int i,
int j,
double value)
136 vals[0 + 3*i] = vec.
x;
137 vals[1 + 3*i] = vec.
y;
138 vals[2 + 3*i] = vec.
z;
144 vals[j + 3*0] = vec.
x;
145 vals[j + 3*1] = vec.
y;
146 vals[j + 3*2] = vec.
z;
163 for (
int j=0; j<3; j++)
177 double a[] = {0.0,0.0,0.0,0.0};
180 for (
int i=0; i<3; i++)
184 for (
int j=0; j<3; j++)
194 return a[0]*a[3]-a[2]*a[1];
201 for (
int i=0; i<3; i++)
203 for (
int j=0; j<3; j++)
221 for (
int i=0; i<3; i++)
223 for (
int j=0; j<3; j++)
231 for (
int i=0; i<3; i++)
233 for (
int j=0; j<3; j++)
246 return oMT*(1.0/det);
253 for (
int i=0;i<3;i++)
255 for (
int j=0;j<3;j++)
257 out << inM.
GetIJ(i,j) <<
" ";
270 std::stringstream out;
272 for (
int i=0;i<3;i++)
274 for (
int j=0;j<3;j++)
276 out <<
GetIJ(i,j) <<
" ";
void SetColJVec(int j, Vector3 vec)
void SetDiagonalVec(double a00, double a11, double a22)
Matrix3x3 operator*(const double value)
double MinorIJ(int ir, int jr)
friend std::ostream & operator<<(std::ostream &out, Matrix3x3 &inM)
static Matrix3x3 MakeRotationMatrixFromVector(const Vector3 &vec)
void SetIJ(int i, int j, double value)
void AddIJ(int i, int j, double value)
void SetRowIVec(int i, Vector3 vec)
Matrix3x3 & operator=(const Matrix3x3 &inM)
double GetIJ(int i, int j) const
Vector3 operator*(const Vector3 &vec) const
Matrix3x3 operator+(const Matrix3x3 &inM)
Matrix3x3 operator-(const Matrix3x3 &inM)
Vector3 Cross(const Vector3 &that) const
Vector3 Normalized() const
Vector3 Dot(const chi_mesh::TensorRank2Dim3 &that) const