mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Added atan2
This commit is contained in:
@ -430,6 +430,20 @@ Foam::dimensionSet Foam::trans(const dimensionSet& ds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::dimensionSet Foam::atan2(const dimensionSet& ds1, const dimensionSet& ds2)
|
||||||
|
{
|
||||||
|
if (dimensionSet::debug && ds1 != ds2)
|
||||||
|
{
|
||||||
|
FatalErrorIn("atan2(const dimensionSet&, const dimensionSet&)")
|
||||||
|
<< "Arguments of atan2 have different dimensions" << endl
|
||||||
|
<< " dimensions : " << ds1 << " and " << ds2 << endl
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dimless;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::transform(const dimensionSet& ds)
|
Foam::dimensionSet Foam::transform(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return ds;
|
return ds;
|
||||||
|
|||||||
@ -354,6 +354,8 @@ public:
|
|||||||
// for transcendental functions
|
// for transcendental functions
|
||||||
friend dimensionSet trans(const dimensionSet&);
|
friend dimensionSet trans(const dimensionSet&);
|
||||||
|
|
||||||
|
friend dimensionSet atan2(const dimensionSet&, const dimensionSet&);
|
||||||
|
|
||||||
//- Return the argument; transformations do not change the dimensions
|
//- Return the argument; transformations do not change the dimensions
|
||||||
friend dimensionSet transform(const dimensionSet&);
|
friend dimensionSet transform(const dimensionSet&);
|
||||||
|
|
||||||
|
|||||||
@ -277,6 +277,21 @@ transFunc(yn)
|
|||||||
#undef transFunc
|
#undef transFunc
|
||||||
|
|
||||||
|
|
||||||
|
dimensionedScalar atan2
|
||||||
|
(
|
||||||
|
const dimensionedScalar& x,
|
||||||
|
const dimensionedScalar& y
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return dimensionedScalar
|
||||||
|
(
|
||||||
|
"atan2(" + x.name() + ',' + y.name() + ')',
|
||||||
|
atan2(x.dimensions(), y.dimensions()),
|
||||||
|
::atan2(x.value(), y.value())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -79,6 +79,7 @@ dimensionedScalar tan(const dimensionedScalar&);
|
|||||||
dimensionedScalar asin(const dimensionedScalar&);
|
dimensionedScalar asin(const dimensionedScalar&);
|
||||||
dimensionedScalar acos(const dimensionedScalar&);
|
dimensionedScalar acos(const dimensionedScalar&);
|
||||||
dimensionedScalar atan(const dimensionedScalar&);
|
dimensionedScalar atan(const dimensionedScalar&);
|
||||||
|
dimensionedScalar atan2(const dimensionedScalar&, const dimensionedScalar&);
|
||||||
dimensionedScalar sinh(const dimensionedScalar&);
|
dimensionedScalar sinh(const dimensionedScalar&);
|
||||||
dimensionedScalar cosh(const dimensionedScalar&);
|
dimensionedScalar cosh(const dimensionedScalar&);
|
||||||
dimensionedScalar tanh(const dimensionedScalar&);
|
dimensionedScalar tanh(const dimensionedScalar&);
|
||||||
|
|||||||
@ -369,6 +369,263 @@ tmp<DimensionedField<scalar, GeoMesh> > pow
|
|||||||
return pow(dimensionedScalar(s), tdsf);
|
return pow(dimensionedScalar(s), tdsf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf1,
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
new DimensionedField<scalar, GeoMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"atan2(" + dsf1.name() + ',' + dsf2.name() + ')',
|
||||||
|
dsf1.instance(),
|
||||||
|
dsf1.db()
|
||||||
|
),
|
||||||
|
dsf1.mesh(),
|
||||||
|
atan2(dsf1.dimensions(), dsf2.dimensions())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2().field(), dsf1.field(), dsf2.field());
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const tmp<DimensionedField<scalar, GeoMesh> >& tdsf1,
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf1 = tdsf1();
|
||||||
|
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > tAtan2 =
|
||||||
|
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New
|
||||||
|
(
|
||||||
|
tdsf1,
|
||||||
|
"atan2(" + dsf1.name() + ',' + dsf2.name() + ')',
|
||||||
|
atan2(dsf1.dimensions(), dsf2.dimensions())
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2().field(), dsf1.field(), dsf2.field());
|
||||||
|
|
||||||
|
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf1);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf1,
|
||||||
|
const tmp<DimensionedField<scalar, GeoMesh> >& tdsf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf2 = tdsf2();
|
||||||
|
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > tAtan2 =
|
||||||
|
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New
|
||||||
|
(
|
||||||
|
tdsf2,
|
||||||
|
"atan2(" + dsf1.name() + ',' + dsf2.name() + ')',
|
||||||
|
atan2(dsf1.dimensions(), dsf2.dimensions())
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2().field(), dsf1.field(), dsf2.field());
|
||||||
|
|
||||||
|
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf2);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const tmp<DimensionedField<scalar, GeoMesh> >& tdsf1,
|
||||||
|
const tmp<DimensionedField<scalar, GeoMesh> >& tdsf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf1 = tdsf1();
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf2 = tdsf2();
|
||||||
|
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > tAtan2 =
|
||||||
|
reuseTmpTmpDimensionedField<scalar, scalar, scalar, scalar, GeoMesh>::
|
||||||
|
New
|
||||||
|
(
|
||||||
|
tdsf1,
|
||||||
|
tdsf2,
|
||||||
|
"atan2(" + dsf1.name() + ',' + dsf2.name() + ')',
|
||||||
|
atan2(dsf1.dimensions(), dsf2.dimensions())
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2().field(), dsf1.field(), dsf2.field());
|
||||||
|
|
||||||
|
reuseTmpTmpDimensionedField<scalar, scalar, scalar, scalar, GeoMesh>::clear
|
||||||
|
(
|
||||||
|
tdsf1,
|
||||||
|
tdsf2
|
||||||
|
);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf,
|
||||||
|
const dimensionedScalar& ds
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
new DimensionedField<scalar, GeoMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"atan2(" + dsf.name() + ',' + ds.name() + ')',
|
||||||
|
dsf.instance(),
|
||||||
|
dsf.db()
|
||||||
|
),
|
||||||
|
dsf.mesh(),
|
||||||
|
atan2(dsf.dimensions(), ds)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2().field(), dsf.field(), ds.value());
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const tmp<DimensionedField<scalar, GeoMesh> >& tdsf,
|
||||||
|
const dimensionedScalar& ds
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf = tdsf();
|
||||||
|
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > tAtan2 =
|
||||||
|
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New
|
||||||
|
(
|
||||||
|
tdsf,
|
||||||
|
"atan2(" + dsf.name() + ',' + ds.name() + ')',
|
||||||
|
atan2(dsf.dimensions(), ds)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2().field(), dsf.field(), ds.value());
|
||||||
|
|
||||||
|
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf,
|
||||||
|
const scalar& s
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return atan2(dsf, dimensionedScalar(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const tmp<DimensionedField<scalar, GeoMesh> >& tdsf,
|
||||||
|
const scalar& s
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return atan2(tdsf, dimensionedScalar(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const dimensionedScalar& ds,
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
new DimensionedField<scalar, GeoMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"atan2(" + ds.name() + ',' + dsf.name() + ')',
|
||||||
|
dsf.instance(),
|
||||||
|
dsf.db()
|
||||||
|
),
|
||||||
|
dsf.mesh(),
|
||||||
|
atan2(ds, dsf.dimensions())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2().field(), ds.value(), dsf.field());
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const dimensionedScalar& ds,
|
||||||
|
const tmp<DimensionedField<scalar, GeoMesh> >& tdsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf = tdsf();
|
||||||
|
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > tAtan2 =
|
||||||
|
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New
|
||||||
|
(
|
||||||
|
tdsf,
|
||||||
|
"atan2(" + ds.name() + ',' + dsf.name() + ')',
|
||||||
|
atan2(ds, dsf.dimensions())
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2().field(), ds.value(), dsf.field());
|
||||||
|
|
||||||
|
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const scalar& s,
|
||||||
|
const DimensionedField<scalar, GeoMesh>& dsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return atan2(dimensionedScalar(s), dsf);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class GeoMesh>
|
||||||
|
tmp<DimensionedField<scalar, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const scalar& s,
|
||||||
|
const tmp<DimensionedField<scalar, GeoMesh> >& tdsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return atan2(dimensionedScalar(s), tdsf);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
UNARY_FUNCTION(scalar, scalar, pow3, pow3)
|
UNARY_FUNCTION(scalar, scalar, pow3, pow3)
|
||||||
|
|||||||
@ -76,6 +76,9 @@ BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide)
|
|||||||
BINARY_FUNCTION(scalar, scalar, scalar, pow)
|
BINARY_FUNCTION(scalar, scalar, scalar, pow)
|
||||||
BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
|
BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
|
||||||
|
|
||||||
|
BINARY_FUNCTION(scalar, scalar, scalar, atan2)
|
||||||
|
BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -115,6 +115,7 @@ BINARY_OPERATOR(scalar, scalar, scalar, /, '|', divide)
|
|||||||
|
|
||||||
BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide)
|
BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide)
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<template<class> class PatchField, class GeoMesh>
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
@ -440,6 +441,315 @@ tmp<GeometricField<scalar, PatchField, GeoMesh> > pow
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
void atan2
|
||||||
|
(
|
||||||
|
GeometricField<scalar, PatchField, GeoMesh>& Atan2,
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf1,
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
atan2(Atan2.internalField(), gsf1.internalField(), gsf2.internalField());
|
||||||
|
atan2(Atan2.boundaryField(), gsf1.boundaryField(), gsf2.boundaryField());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf1,
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
new GeometricField<scalar, PatchField, GeoMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"atan2(" + gsf1.name() + ',' + gsf2.name() + ')',
|
||||||
|
gsf1.instance(),
|
||||||
|
gsf1.db(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
gsf1.mesh(),
|
||||||
|
atan2(gsf1.dimensions(), gsf2.dimensions())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2(), gsf1, gsf2);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf1,
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf1 = tgsf1();
|
||||||
|
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New
|
||||||
|
(
|
||||||
|
tgsf1,
|
||||||
|
"atan2(" + gsf1.name() + ',' + gsf2.name() + ')',
|
||||||
|
atan2(gsf1.dimensions(), gsf2.dimensions())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2(), gsf1, gsf2);
|
||||||
|
|
||||||
|
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf1);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf1,
|
||||||
|
const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf2 = tgsf2();
|
||||||
|
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New
|
||||||
|
(
|
||||||
|
tgsf2,
|
||||||
|
"atan2(" + gsf1.name() + ',' + gsf2.name() + ')',
|
||||||
|
atan2( gsf1.dimensions(), gsf2.dimensions())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2(), gsf1, gsf2);
|
||||||
|
|
||||||
|
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf2);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf1,
|
||||||
|
const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf1 = tgsf1();
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf2 = tgsf2();
|
||||||
|
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
reuseTmpTmpGeometricField
|
||||||
|
<scalar, scalar, scalar, scalar, PatchField, GeoMesh>::New
|
||||||
|
(
|
||||||
|
tgsf1,
|
||||||
|
tgsf2,
|
||||||
|
"atan2(" + gsf1.name() + ',' + gsf2.name() + ')',
|
||||||
|
atan2(gsf1.dimensions(), gsf2.dimensions())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2(), gsf1, gsf2);
|
||||||
|
|
||||||
|
reuseTmpTmpGeometricField
|
||||||
|
<scalar, scalar, scalar, scalar, PatchField, GeoMesh>
|
||||||
|
::clear(tgsf1, tgsf2);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
void atan2
|
||||||
|
(
|
||||||
|
GeometricField<scalar, PatchField, GeoMesh>& tAtan2,
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf,
|
||||||
|
const dimensioned<scalar>& ds
|
||||||
|
)
|
||||||
|
{
|
||||||
|
atan2(tAtan2.internalField(), gsf.internalField(), ds.value());
|
||||||
|
atan2(tAtan2.boundaryField(), gsf.boundaryField(), ds.value());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf,
|
||||||
|
const dimensionedScalar& ds
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
new GeometricField<scalar, PatchField, GeoMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"atan2(" + gsf.name() + ',' + ds.name() + ')',
|
||||||
|
gsf.instance(),
|
||||||
|
gsf.db(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
gsf.mesh(),
|
||||||
|
atan2(gsf.dimensions(), ds)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2(), gsf, ds);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf,
|
||||||
|
const dimensionedScalar& ds
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf();
|
||||||
|
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New
|
||||||
|
(
|
||||||
|
tgsf,
|
||||||
|
"atan2(" + gsf.name() + ',' + ds.name() + ')',
|
||||||
|
atan2(gsf.dimensions(), ds)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2(), gsf, ds);
|
||||||
|
|
||||||
|
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf,
|
||||||
|
const scalar& s
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return atan2(gsf, dimensionedScalar(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf,
|
||||||
|
const scalar& s
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return atan2(tgsf, dimensionedScalar(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
void atan2
|
||||||
|
(
|
||||||
|
GeometricField<scalar, PatchField, GeoMesh>& tAtan2,
|
||||||
|
const dimensioned<scalar>& ds,
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
atan2(tAtan2.internalField(), ds.value(), gsf.internalField());
|
||||||
|
atan2(tAtan2.boundaryField(), ds.value(), gsf.boundaryField());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const dimensionedScalar& ds,
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
new GeometricField<scalar, PatchField, GeoMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"atan2(" + ds.name() + ',' + gsf.name() + ')',
|
||||||
|
gsf.instance(),
|
||||||
|
gsf.db(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
gsf.mesh(),
|
||||||
|
atan2(ds, gsf.dimensions())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2(), ds, gsf);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const dimensionedScalar& ds,
|
||||||
|
const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf();
|
||||||
|
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2
|
||||||
|
(
|
||||||
|
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New
|
||||||
|
(
|
||||||
|
tgsf,
|
||||||
|
"atan2(" + ds.name() + ',' + gsf.name() + ')',
|
||||||
|
atan2(ds, gsf.dimensions())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
atan2(tAtan2(), ds, gsf);
|
||||||
|
|
||||||
|
reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf);
|
||||||
|
|
||||||
|
return tAtan2;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const scalar& s,
|
||||||
|
const GeometricField<scalar, PatchField, GeoMesh>& gsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return atan2(dimensionedScalar(s), gsf);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2
|
||||||
|
(
|
||||||
|
const scalar& s,
|
||||||
|
const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return atan2(dimensionedScalar(s), tgsf);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
UNARY_FUNCTION(scalar, scalar, pow3, pow3)
|
UNARY_FUNCTION(scalar, scalar, pow3, pow3)
|
||||||
|
|||||||
@ -84,6 +84,9 @@ BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide)
|
|||||||
BINARY_FUNCTION(scalar, scalar, scalar, pow)
|
BINARY_FUNCTION(scalar, scalar, scalar, pow)
|
||||||
BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
|
BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
|
||||||
|
|
||||||
|
BINARY_FUNCTION(scalar, scalar, scalar, atan2)
|
||||||
|
BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user