mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Changed the function name "cofactors" to "cof" and propagated the function
through the field algebra.
This commit is contained in:
@ -125,6 +125,17 @@ dimensionedScalar det(const dimensionedSymmTensor& dt)
|
||||
}
|
||||
|
||||
|
||||
dimensionedSymmTensor cof(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
(
|
||||
"cof("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
cof(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedSymmTensor inv(const dimensionedSymmTensor& dt)
|
||||
{
|
||||
return dimensionedSymmTensor
|
||||
|
||||
@ -59,6 +59,7 @@ dimensionedSymmTensor twoSymm(const dimensionedSymmTensor&);
|
||||
dimensionedSymmTensor dev(const dimensionedSymmTensor&);
|
||||
dimensionedSymmTensor dev2(const dimensionedSymmTensor&);
|
||||
dimensionedScalar det(const dimensionedSymmTensor&);
|
||||
dimensionedSymmTensor cof(const dimensionedSymmTensor&);
|
||||
dimensionedSymmTensor inv(const dimensionedSymmTensor&);
|
||||
|
||||
|
||||
|
||||
@ -92,6 +92,17 @@ dimensionedScalar det(const dimensionedTensor& dt)
|
||||
}
|
||||
|
||||
|
||||
dimensionedTensor cof(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedTensor
|
||||
(
|
||||
"cof("+dt.name()+')',
|
||||
dt.dimensions(),
|
||||
cof(dt.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dimensionedTensor inv(const dimensionedTensor& dt)
|
||||
{
|
||||
return dimensionedTensor
|
||||
|
||||
@ -56,6 +56,7 @@ dimensionedScalar tr(const dimensionedTensor&);
|
||||
dimensionedTensor dev(const dimensionedTensor&);
|
||||
dimensionedTensor dev2(const dimensionedTensor&);
|
||||
dimensionedScalar det(const dimensionedTensor&);
|
||||
dimensionedTensor cof(const dimensionedTensor&);
|
||||
dimensionedTensor inv(const dimensionedTensor&);
|
||||
dimensionedSymmTensor symm(const dimensionedTensor&);
|
||||
dimensionedSymmTensor twoSymm(const dimensionedTensor&);
|
||||
|
||||
@ -46,6 +46,7 @@ UNARY_FUNCTION(symmTensor, symmTensor, twoSymm, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev2, transform)
|
||||
UNARY_FUNCTION(scalar, symmTensor, det, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, cof, cof)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, inv, inv)
|
||||
|
||||
|
||||
|
||||
@ -58,6 +58,7 @@ UNARY_FUNCTION(symmTensor, symmTensor, twoSymm, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev2, transform)
|
||||
UNARY_FUNCTION(scalar, symmTensor, det, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, cof, cof)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, inv, inv)
|
||||
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ UNARY_FUNCTION(tensor, tensor, skew, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, dev, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, dev2, transform)
|
||||
UNARY_FUNCTION(scalar, tensor, det, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, cof, cof)
|
||||
UNARY_FUNCTION(tensor, tensor, inv, inv)
|
||||
UNARY_FUNCTION(vector, tensor, eigenValues, sign)
|
||||
UNARY_FUNCTION(tensor, tensor, eigenVectors, transform)
|
||||
|
||||
@ -58,6 +58,7 @@ UNARY_FUNCTION(tensor, tensor, skew, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, dev, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, dev2, transform)
|
||||
UNARY_FUNCTION(scalar, tensor, det, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, cof, cof)
|
||||
UNARY_FUNCTION(tensor, tensor, inv, inv)
|
||||
UNARY_FUNCTION(vector, tensor, eigenValues, sign)
|
||||
UNARY_FUNCTION(tensor, tensor, eigenVectors, transform)
|
||||
|
||||
@ -48,6 +48,7 @@ UNARY_FUNCTION(symmTensor, symmTensor, twoSymm)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev2)
|
||||
UNARY_FUNCTION(scalar, symmTensor, det)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, cof)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, inv)
|
||||
|
||||
|
||||
|
||||
@ -58,6 +58,7 @@ UNARY_FUNCTION(symmTensor, symmTensor, twoSymm)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev2)
|
||||
UNARY_FUNCTION(scalar, symmTensor, det)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, cof)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, inv)
|
||||
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ UNARY_FUNCTION(tensor, tensor, skew)
|
||||
UNARY_FUNCTION(tensor, tensor, dev)
|
||||
UNARY_FUNCTION(tensor, tensor, dev2)
|
||||
UNARY_FUNCTION(scalar, tensor, det)
|
||||
UNARY_FUNCTION(tensor, tensor, cof)
|
||||
UNARY_FUNCTION(tensor, tensor, inv)
|
||||
UNARY_FUNCTION(vector, tensor, eigenValues)
|
||||
UNARY_FUNCTION(tensor, tensor, eigenVectors)
|
||||
|
||||
@ -58,6 +58,7 @@ UNARY_FUNCTION(tensor, tensor, skew)
|
||||
UNARY_FUNCTION(tensor, tensor, dev)
|
||||
UNARY_FUNCTION(tensor, tensor, dev2)
|
||||
UNARY_FUNCTION(scalar, tensor, det)
|
||||
UNARY_FUNCTION(tensor, tensor, cof)
|
||||
UNARY_FUNCTION(tensor, tensor, inv)
|
||||
UNARY_FUNCTION(vector, tensor, eigenValues)
|
||||
UNARY_FUNCTION(tensor, tensor, eigenVectors)
|
||||
|
||||
@ -46,6 +46,7 @@ UNARY_FUNCTION(symmTensor, symmTensor, twoSymm)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev2)
|
||||
UNARY_FUNCTION(scalar, symmTensor, det)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, cof)
|
||||
|
||||
void inv(Field<symmTensor>& tf, const UList<symmTensor>& tf1)
|
||||
{
|
||||
|
||||
@ -62,6 +62,7 @@ UNARY_FUNCTION(symmTensor, symmTensor, twoSymm)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev2)
|
||||
UNARY_FUNCTION(scalar, symmTensor, det)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, cof)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, inv)
|
||||
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ UNARY_FUNCTION(tensor, tensor, skew)
|
||||
UNARY_FUNCTION(tensor, tensor, dev)
|
||||
UNARY_FUNCTION(tensor, tensor, dev2)
|
||||
UNARY_FUNCTION(scalar, tensor, det)
|
||||
UNARY_FUNCTION(tensor, tensor, cof)
|
||||
|
||||
void inv(Field<tensor>& tf, const UList<tensor>& tf1)
|
||||
{
|
||||
|
||||
@ -62,6 +62,7 @@ UNARY_FUNCTION(tensor, tensor, skew)
|
||||
UNARY_FUNCTION(tensor, tensor, dev)
|
||||
UNARY_FUNCTION(tensor, tensor, dev2)
|
||||
UNARY_FUNCTION(scalar, tensor, det)
|
||||
UNARY_FUNCTION(tensor, tensor, cof)
|
||||
UNARY_FUNCTION(tensor, tensor, inv)
|
||||
UNARY_FUNCTION(vector, tensor, eigenValues)
|
||||
UNARY_FUNCTION(tensor, tensor, eigenVectors)
|
||||
|
||||
@ -46,6 +46,7 @@ UNARY_FUNCTION(symmTensor, symmTensor, twoSymm, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev2, transform)
|
||||
UNARY_FUNCTION(scalar, symmTensor, det, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, cof, cof)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, inv, inv)
|
||||
|
||||
|
||||
|
||||
@ -58,6 +58,7 @@ UNARY_FUNCTION(symmTensor, symmTensor, twoSymm, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, dev2, transform)
|
||||
UNARY_FUNCTION(scalar, symmTensor, det, transform)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, cof, cof)
|
||||
UNARY_FUNCTION(symmTensor, symmTensor, inv, inv)
|
||||
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ UNARY_FUNCTION(tensor, tensor, skew, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, dev, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, dev2, transform)
|
||||
UNARY_FUNCTION(scalar, tensor, det, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, cof, cof)
|
||||
UNARY_FUNCTION(tensor, tensor, inv, inv)
|
||||
UNARY_FUNCTION(vector, tensor, eigenValues, sign)
|
||||
UNARY_FUNCTION(tensor, tensor, eigenVectors, transform)
|
||||
|
||||
@ -58,6 +58,7 @@ UNARY_FUNCTION(tensor, tensor, skew, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, dev, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, dev2, transform)
|
||||
UNARY_FUNCTION(scalar, tensor, det, transform)
|
||||
UNARY_FUNCTION(tensor, tensor, cof, cof)
|
||||
UNARY_FUNCTION(tensor, tensor, inv, inv)
|
||||
UNARY_FUNCTION(vector, tensor, eigenValues, sign)
|
||||
UNARY_FUNCTION(tensor, tensor, eigenVectors, transform)
|
||||
|
||||
@ -33,13 +33,11 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
//- Construct null
|
||||
template <class Cmpt>
|
||||
inline SymmTensor<Cmpt>::SymmTensor()
|
||||
{}
|
||||
|
||||
|
||||
//- Construct given VectorSpace
|
||||
template <class Cmpt>
|
||||
inline SymmTensor<Cmpt>::SymmTensor
|
||||
(
|
||||
@ -50,7 +48,6 @@ inline SymmTensor<Cmpt>::SymmTensor
|
||||
{}
|
||||
|
||||
|
||||
//- Construct given SphericalTensor
|
||||
template <class Cmpt>
|
||||
inline SymmTensor<Cmpt>::SymmTensor(const SphericalTensor<Cmpt>& st)
|
||||
{
|
||||
@ -60,7 +57,6 @@ inline SymmTensor<Cmpt>::SymmTensor(const SphericalTensor<Cmpt>& st)
|
||||
}
|
||||
|
||||
|
||||
//- Construct from components
|
||||
template <class Cmpt>
|
||||
inline SymmTensor<Cmpt>::SymmTensor
|
||||
(
|
||||
@ -75,7 +71,6 @@ inline SymmTensor<Cmpt>::SymmTensor
|
||||
}
|
||||
|
||||
|
||||
//- Construct from Istream
|
||||
template <class Cmpt>
|
||||
inline SymmTensor<Cmpt>::SymmTensor(Istream& is)
|
||||
:
|
||||
@ -159,7 +154,6 @@ inline Cmpt& SymmTensor<Cmpt>::zz()
|
||||
}
|
||||
|
||||
|
||||
//- Return symmetric tensor transpose
|
||||
template <class Cmpt>
|
||||
inline const SymmTensor<Cmpt>& SymmTensor<Cmpt>::T() const
|
||||
{
|
||||
@ -323,22 +317,19 @@ inline Cmpt det(const SymmTensor<Cmpt>& st)
|
||||
}
|
||||
|
||||
|
||||
//- Return the cofactor tensor of a symmetric tensor
|
||||
//- Return the cofactor symmetric tensor of a symmetric tensor
|
||||
template <class Cmpt>
|
||||
inline SymmTensor<Cmpt> cofactors(const SymmTensor<Cmpt>& st)
|
||||
inline SymmTensor<Cmpt> cof(const SymmTensor<Cmpt>& st)
|
||||
{
|
||||
return SymmTensor<Cmpt>
|
||||
(
|
||||
st.yy()*st.zz() - st.yz()*st.yz(),
|
||||
st.xz()*st.yz() - st.xy()*st.zz(),
|
||||
st.xy()*st.yz() - st.yy()*st.xz(),
|
||||
st.xy()*st.yz() - st.xz()*st.yy(),
|
||||
|
||||
st.xz()*st.yz() - st.xy()*st.zz(),
|
||||
st.xx()*st.zz() - st.xz()*st.xz(),
|
||||
st.xy()*st.xz() - st.xx()*st.yz(),
|
||||
|
||||
st.xy()*st.yz() - st.xz()*st.yy(),
|
||||
st.xy()*st.xz() - st.xx()*st.yz(),
|
||||
st.xx()*st.yy() - st.xy()*st.xy()
|
||||
);
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ inline Cmpt det(const Tensor<Cmpt>& t)
|
||||
|
||||
//- Return the cofactor tensor of a tensor
|
||||
template <class Cmpt>
|
||||
inline Tensor<Cmpt> cofactors(const Tensor<Cmpt>& t)
|
||||
inline Tensor<Cmpt> cof(const Tensor<Cmpt>& t)
|
||||
{
|
||||
return Tensor<Cmpt>
|
||||
(
|
||||
|
||||
@ -31,13 +31,11 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
//- Construct null
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt>::Tensor2D()
|
||||
{}
|
||||
|
||||
|
||||
//- Construct given VectorSpace
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt>::Tensor2D(const VectorSpace<Tensor2D<Cmpt>, Cmpt, 4>& vs)
|
||||
:
|
||||
@ -45,7 +43,6 @@ inline Tensor2D<Cmpt>::Tensor2D(const VectorSpace<Tensor2D<Cmpt>, Cmpt, 4>& vs)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct given SphericalTensor2D
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt>::Tensor2D(const SphericalTensor2D<Cmpt>& st)
|
||||
{
|
||||
@ -54,7 +51,6 @@ inline Tensor2D<Cmpt>::Tensor2D(const SphericalTensor2D<Cmpt>& st)
|
||||
}
|
||||
|
||||
|
||||
//- Construct from components
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt>::Tensor2D
|
||||
(
|
||||
@ -67,7 +63,6 @@ inline Tensor2D<Cmpt>::Tensor2D
|
||||
}
|
||||
|
||||
|
||||
//- Construct from Istream
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt>::Tensor2D(Istream& is)
|
||||
:
|
||||
@ -153,7 +148,6 @@ inline Cmpt& Tensor2D<Cmpt>::yy()
|
||||
}
|
||||
|
||||
|
||||
//- Return tensor transpose
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt> Tensor2D<Cmpt>::T() const
|
||||
{
|
||||
@ -303,17 +297,27 @@ inline Cmpt det(const Tensor2D<Cmpt>& t)
|
||||
return(t.xx()*t.yy() - t.xy()*t.yx());
|
||||
}
|
||||
|
||||
//- Return the inverse of a tensor give the determinant
|
||||
|
||||
//- Return the cofactor tensor of a tensor
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt> inv(const Tensor2D<Cmpt>& t, const Cmpt dett)
|
||||
inline Tensor2D<Cmpt> cof(const Tensor2D<Cmpt>& t)
|
||||
{
|
||||
return Tensor2D<Cmpt>
|
||||
(
|
||||
t.yy(), -t.xy(),
|
||||
-t.yx(), t.xx()
|
||||
)/dett;
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Return the inverse of a tensor given the determinant
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt> inv(const Tensor2D<Cmpt>& t, const Cmpt dett)
|
||||
{
|
||||
return cof(t)/dett;
|
||||
}
|
||||
|
||||
|
||||
//- Return the inverse of a tensor
|
||||
template <class Cmpt>
|
||||
inline Tensor2D<Cmpt> inv(const Tensor2D<Cmpt>& t)
|
||||
|
||||
Reference in New Issue
Block a user