mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
WIP: removed initialisation to zero - not applicable to all use cases
This commit is contained in:
@ -115,7 +115,10 @@ void Foam::AMIInterpolation::interpolate
|
|||||||
const UList<Type>& defaultValues
|
const UList<Type>& defaultValues
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Note: behaves as old AMIInterpolation::interpolateToSource if toSource=true
|
// Note
|
||||||
|
// - behaves as old AMIInterpolation::interpolateToSource if toSource=true
|
||||||
|
// - `result` should be preallocated to correct size and initialized to
|
||||||
|
// an appropriate value (e.g. Zero)
|
||||||
|
|
||||||
// Get data locally and do a weighted sum
|
// Get data locally and do a weighted sum
|
||||||
|
|
||||||
@ -187,10 +190,10 @@ void Foam::AMIInterpolation::interpolate
|
|||||||
map.distribute(work);
|
map.distribute(work);
|
||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (is_contiguous_scalar<Type>::value)
|
// if constexpr (is_contiguous_scalar<Type>::value)
|
||||||
{
|
// {
|
||||||
result0 = Zero;
|
// result0 = Zero;
|
||||||
}
|
// }
|
||||||
|
|
||||||
weightedSum
|
weightedSum
|
||||||
(
|
(
|
||||||
@ -231,10 +234,10 @@ void Foam::AMIInterpolation::interpolate
|
|||||||
map.distribute(work);
|
map.distribute(work);
|
||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (is_contiguous_scalar<Type>::value)
|
// if constexpr (is_contiguous_scalar<Type>::value)
|
||||||
{
|
// {
|
||||||
result1 = Zero;
|
// result1 = Zero;
|
||||||
}
|
// }
|
||||||
|
|
||||||
weightedSum
|
weightedSum
|
||||||
(
|
(
|
||||||
@ -295,12 +298,12 @@ void Foam::AMIInterpolation::interpolate
|
|||||||
map.distribute(work);
|
map.distribute(work);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.resize_nocopy(srcAddress.size());
|
// result.resize_nocopy(srcAddress.size());
|
||||||
|
|
||||||
if constexpr (is_contiguous_scalar<Type>::value)
|
// if constexpr (is_contiguous_scalar<Type>::value)
|
||||||
{
|
// {
|
||||||
result = Zero;
|
// result = Zero;
|
||||||
}
|
// }
|
||||||
|
|
||||||
weightedSum
|
weightedSum
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user