mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP/ENH: Update assignments to constructors to compile with clang. Add tensor->triad conversion.
This commit is contained in:
@ -103,6 +103,9 @@ public:
|
||||
//- Construct given SymmTensor
|
||||
inline Tensor(const SymmTensor<Cmpt>&);
|
||||
|
||||
//- Construct given triad
|
||||
inline Tensor(const Vector<Vector<Cmpt> >&);
|
||||
|
||||
//- Construct given the three vector components
|
||||
inline Tensor
|
||||
(
|
||||
@ -165,6 +168,9 @@ public:
|
||||
|
||||
//- Assign to a SymmTensor
|
||||
inline void operator=(const SymmTensor<Cmpt>&);
|
||||
|
||||
//- Assign to a triad
|
||||
inline void operator=(const Vector<Vector<Cmpt> >&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -66,6 +66,24 @@ inline Tensor<Cmpt>::Tensor(const SymmTensor<Cmpt>& st)
|
||||
}
|
||||
|
||||
|
||||
//- Construct given triad
|
||||
template <class Cmpt>
|
||||
inline Tensor<Cmpt>::Tensor(const Vector<Vector<Cmpt> >& tr)
|
||||
{
|
||||
this->v_[XX] = tr.x().x();
|
||||
this->v_[XY] = tr.x().y();
|
||||
this->v_[XZ] = tr.x().z();
|
||||
|
||||
this->v_[YX] = tr.y().x();
|
||||
this->v_[YY] = tr.y().y();
|
||||
this->v_[YZ] = tr.y().z();
|
||||
|
||||
this->v_[ZX] = tr.z().x();
|
||||
this->v_[ZY] = tr.z().y();
|
||||
this->v_[ZZ] = tr.z().z();
|
||||
}
|
||||
|
||||
|
||||
//- Construct given the three vector components
|
||||
template <class Cmpt>
|
||||
inline Tensor<Cmpt>::Tensor
|
||||
@ -272,6 +290,23 @@ inline void Tensor<Cmpt>::operator=(const SymmTensor<Cmpt>& st)
|
||||
}
|
||||
|
||||
|
||||
template <class Cmpt>
|
||||
inline void Tensor<Cmpt>::operator=(const Vector<Vector<Cmpt> >& tr)
|
||||
{
|
||||
this->v_[XX] = tr.x().x();
|
||||
this->v_[XY] = tr.x().y();
|
||||
this->v_[XZ] = tr.x().z();
|
||||
|
||||
this->v_[YX] = tr.y().x();
|
||||
this->v_[YY] = tr.y().y();
|
||||
this->v_[YZ] = tr.y().z();
|
||||
|
||||
this->v_[ZX] = tr.z().x();
|
||||
this->v_[ZY] = tr.z().y();
|
||||
this->v_[ZZ] = tr.z().z();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
|
||||
|
||||
//- Hodge Dual operator (tensor -> vector)
|
||||
|
||||
Reference in New Issue
Block a user