mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: dimensionedScalar: add stabilise function
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -518,6 +518,21 @@ Foam::dimensionSet Foam::hypot(const dimensionSet& ds1, const dimensionSet& ds2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::dimensionSet Foam::stabilise
|
||||||
|
(
|
||||||
|
const dimensionSet& ds1,
|
||||||
|
const dimensionSet& ds2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (dimensionSet::checking())
|
||||||
|
{
|
||||||
|
checkDims("stabilise(a, b)", ds1, ds2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ds1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dimensionSet Foam::transform(const dimensionSet& ds)
|
Foam::dimensionSet Foam::transform(const dimensionSet& ds)
|
||||||
{
|
{
|
||||||
return ds;
|
return ds;
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -397,6 +397,9 @@ dimensionSet atan2(const dimensionSet& ds1, const dimensionSet& ds2);
|
|||||||
//- Arguments need the same dimensions. Does not change the dimension.
|
//- Arguments need the same dimensions. Does not change the dimension.
|
||||||
dimensionSet hypot(const dimensionSet& ds1, const dimensionSet& ds2);
|
dimensionSet hypot(const dimensionSet& ds1, const dimensionSet& ds2);
|
||||||
|
|
||||||
|
//- Arguments need the same dimensions. Does not change the dimension.
|
||||||
|
dimensionSet stabilise(const dimensionSet& ds1, const dimensionSet& ds2);
|
||||||
|
|
||||||
//- Return the argument; transformations do not change the dimensions
|
//- Return the argument; transformations do not change the dimensions
|
||||||
dimensionSet transform(const dimensionSet& ds);
|
dimensionSet transform(const dimensionSet& ds);
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -338,6 +338,21 @@ dimensionedScalar hypot
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dimensionedScalar stabilise
|
||||||
|
(
|
||||||
|
const dimensionedScalar& x,
|
||||||
|
const dimensionedScalar& y
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return dimensionedScalar
|
||||||
|
(
|
||||||
|
"stabilise(" + x.name() + ',' + y.name() + ')',
|
||||||
|
stabilise(x.dimensions(), y.dimensions()),
|
||||||
|
stabilise(x.value(), y.value())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -102,6 +102,7 @@ dimensionedScalar jn(const int, const dimensionedScalar&);
|
|||||||
dimensionedScalar y0(const dimensionedScalar&);
|
dimensionedScalar y0(const dimensionedScalar&);
|
||||||
dimensionedScalar y1(const dimensionedScalar&);
|
dimensionedScalar y1(const dimensionedScalar&);
|
||||||
dimensionedScalar yn(const int, const dimensionedScalar&);
|
dimensionedScalar yn(const int, const dimensionedScalar&);
|
||||||
|
dimensionedScalar stabilise(const dimensionedScalar&, const dimensionedScalar&);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
Reference in New Issue
Block a user