From 27599ec5361da9ecd0b607b88f8b6969b8097708 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 18 Nov 2013 13:59:18 +0000 Subject: [PATCH] ENH: Updated comment --- src/OpenFOAM/primitives/Tensor/TensorI.H | 37 ++++++++++++++++-------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/src/OpenFOAM/primitives/Tensor/TensorI.H b/src/OpenFOAM/primitives/Tensor/TensorI.H index 8ba9d24a12..03b0594f1d 100644 --- a/src/OpenFOAM/primitives/Tensor/TensorI.H +++ b/src/OpenFOAM/primitives/Tensor/TensorI.H @@ -123,12 +123,14 @@ inline Vector Tensor::x() const return Vector(this->v_[XX], this->v_[XY], this->v_[XZ]); } + template inline Vector Tensor::y() const { return Vector(this->v_[YX], this->v_[YY], this->v_[YZ]); } + template inline Vector Tensor::z() const { @@ -160,12 +162,14 @@ inline const Cmpt& Tensor::xx() const return this->v_[XX]; } + template inline const Cmpt& Tensor::xy() const { return this->v_[XY]; } + template inline const Cmpt& Tensor::xz() const { @@ -179,12 +183,14 @@ inline const Cmpt& Tensor::yx() const return this->v_[YX]; } + template inline const Cmpt& Tensor::yy() const { return this->v_[YY]; } + template inline const Cmpt& Tensor::yz() const { @@ -198,12 +204,14 @@ inline const Cmpt& Tensor::zx() const return this->v_[ZX]; } + template inline const Cmpt& Tensor::zy() const { return this->v_[ZY]; } + template inline const Cmpt& Tensor::zz() const { @@ -217,12 +225,14 @@ inline Cmpt& Tensor::xx() return this->v_[XX]; } + template inline Cmpt& Tensor::xy() { return this->v_[XY]; } + template inline Cmpt& Tensor::xz() { @@ -236,12 +246,14 @@ inline Cmpt& Tensor::yx() return this->v_[YX]; } + template inline Cmpt& Tensor::yy() { return this->v_[YY]; } + template inline Cmpt& Tensor::yz() { @@ -255,12 +267,14 @@ inline Cmpt& Tensor::zx() return this->v_[ZX]; } + template inline Cmpt& Tensor::zy() { return this->v_[ZY]; } + template inline Cmpt& Tensor::zz() { @@ -268,7 +282,6 @@ inline Cmpt& Tensor::zz() } -//- Return tensor transpose template inline Tensor Tensor::T() const { @@ -320,7 +333,6 @@ inline void Tensor::operator=(const Vector >& tr) // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * // -//- Hodge Dual operator (tensor -> vector) template inline Vector operator*(const Tensor& t) { @@ -328,7 +340,6 @@ inline Vector operator*(const Tensor& t) } -//- Hodge Dual operator (vector -> tensor) template inline Tensor operator*(const Vector& v) { @@ -341,7 +352,6 @@ inline Tensor operator*(const Vector& v) } -//- Inner-product between two tensors template inline typename innerProduct, Tensor >::type operator&(const Tensor& t1, const Tensor& t2) @@ -363,7 +373,6 @@ operator&(const Tensor& t1, const Tensor& t2) } -//- Inner-product between a tensor and a vector template inline typename innerProduct, Vector >::type operator&(const Tensor& t, const Vector& v) @@ -377,7 +386,6 @@ operator&(const Tensor& t, const Vector& v) } -//- Inner-product between a vector and a tensor template inline typename innerProduct, Tensor >::type operator&(const Vector& v, const Tensor& t) @@ -391,7 +399,6 @@ operator&(const Vector& v, const Tensor& t) } -//- Outer-product between two vectors template inline typename outerProduct, Vector >::type operator*(const Vector& v1, const Vector& v2) @@ -405,7 +412,6 @@ operator*(const Vector& v1, const Vector& v2) } -//- Division of a vector by a tensor, i.e. dot-product with the tensor inverse template inline typename innerProduct, Tensor >::type operator/(const Vector& v, const Tensor& t) @@ -690,6 +696,7 @@ operator&&(const Tensor& t1, const SphericalTensor& st2) return(t1.xx()*st2.ii() + t1.yy()*st2.ii() + t1.zz()*st2.ii()); } + template class typeOfSum, Tensor > { @@ -698,6 +705,7 @@ public: typedef Tensor type; }; + template class typeOfSum, SphericalTensor > { @@ -706,6 +714,7 @@ public: typedef Tensor type; }; + template class innerProduct, Tensor > { @@ -714,6 +723,7 @@ public: typedef Tensor type; }; + template class innerProduct, SphericalTensor > { @@ -777,7 +787,7 @@ operator-(const Tensor& t1, const SymmTensor& st2) } -//- Inner-product between a spherical tensor and a tensor +//- Inner-product between a symmetric tensor and a tensor template inline Tensor operator&(const SymmTensor& st1, const Tensor& t2) @@ -799,7 +809,7 @@ operator&(const SymmTensor& st1, const Tensor& t2) } -//- Inner-product between a tensor and a spherical tensor +//- Inner-product between a tensor and a symmetric tensor template inline Tensor operator&(const Tensor& t1, const SymmTensor& st2) @@ -821,7 +831,7 @@ operator&(const Tensor& t1, const SymmTensor& st2) } -//- Double-dot-product between a spherical tensor and a tensor +//- Double-dot-product between a symmetric tensor and a tensor template inline Cmpt operator&&(const SymmTensor& st1, const Tensor& t2) @@ -835,7 +845,7 @@ operator&&(const SymmTensor& st1, const Tensor& t2) } -//- Double-dot-product between a tensor and a spherical tensor +//- Double-dot-product between a tensor and a symmetric tensor template inline Cmpt operator&&(const Tensor& t1, const SymmTensor& st2) @@ -848,6 +858,7 @@ operator&&(const Tensor& t1, const SymmTensor& st2) ); } + template class typeOfSum, Tensor > { @@ -856,6 +867,7 @@ public: typedef Tensor type; }; + template class typeOfSum, SymmTensor > { @@ -873,6 +885,7 @@ public: typedef Tensor type; }; + template class innerProduct, SymmTensor > {