dimensionedType: Corrected order of dimensions and value in lookupOrDefault and lookupOrAddToDict
Deprecated old versions.
This commit is contained in:
@ -173,6 +173,26 @@ Foam::dimensioned<Type>::dimensioned
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::dimensioned<Type> Foam::dimensioned<Type>::lookupOrDefault
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const dimensionSet& dims,
|
||||
const Type& defaultValue
|
||||
)
|
||||
{
|
||||
if (dict.found(name))
|
||||
{
|
||||
return dimensioned<Type>(name, dims, dict.lookup(name));
|
||||
}
|
||||
else
|
||||
{
|
||||
return dimensioned<Type>(name, dims, defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::dimensioned<Type> Foam::dimensioned<Type>::lookupOrDefault
|
||||
(
|
||||
@ -193,6 +213,20 @@ Foam::dimensioned<Type> Foam::dimensioned<Type>::lookupOrDefault
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::dimensioned<Type> Foam::dimensioned<Type>::lookupOrAddToDict
|
||||
(
|
||||
const word& name,
|
||||
dictionary& dict,
|
||||
const dimensionSet& dims,
|
||||
const Type& defaultValue
|
||||
)
|
||||
{
|
||||
Type value = dict.lookupOrAddDefault<Type>(name, defaultValue);
|
||||
return dimensioned<Type>(name, dims, value);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::dimensioned<Type> Foam::dimensioned<Type>::lookupOrAddToDict
|
||||
(
|
||||
|
||||
@ -123,7 +123,17 @@ public:
|
||||
|
||||
// Static member functions
|
||||
|
||||
//- Construct from dictionary, with default value.
|
||||
//- Construct from dictionary, with default dimensions and value.
|
||||
static dimensioned<Type> lookupOrDefault
|
||||
(
|
||||
const word&,
|
||||
const dictionary&,
|
||||
const dimensionSet& dims = dimless,
|
||||
const Type& defaultValue = pTraits<Type>::zero
|
||||
);
|
||||
|
||||
//- Construct from dictionary, with default value and dimensions.
|
||||
// Deprecated, use form with dimensions before value.
|
||||
static dimensioned<Type> lookupOrDefault
|
||||
(
|
||||
const word&,
|
||||
@ -135,6 +145,17 @@ public:
|
||||
//- Construct from dictionary, with default value.
|
||||
// If the value is not found, it is added into the dictionary.
|
||||
static dimensioned<Type> lookupOrAddToDict
|
||||
(
|
||||
const word&,
|
||||
dictionary&,
|
||||
const dimensionSet& dims = dimless,
|
||||
const Type& defaultValue = pTraits<Type>::zero
|
||||
);
|
||||
|
||||
//- Construct from dictionary, with default value.
|
||||
// If the value is not found, it is added into the dictionary.
|
||||
// Deprecated, use form with dimensions before value.
|
||||
static dimensioned<Type> lookupOrAddToDict
|
||||
(
|
||||
const word&,
|
||||
dictionary&,
|
||||
|
||||
Reference in New Issue
Block a user