mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: SPDP mode: guaranteeing initial value. Fixes #1590.
In differing precisions the PrecisionAdaptor will copy the input array element by element and this can trigger NaN detection.
This commit is contained in:
@ -82,15 +82,18 @@ void Foam::primitiveMesh::makeCellCentresAndVols
|
||||
{
|
||||
typedef Vector<solveScalar> solveVector;
|
||||
|
||||
// Clear the fields for accumulation. Note1: we're doing this before
|
||||
// any precision conversion since this might complain about illegal numbers.
|
||||
// Note2: zero is a special value which is perfectly converted into zero
|
||||
// in the new precision
|
||||
cellCtrs_s = Zero;
|
||||
cellVols_s = 0.0;
|
||||
|
||||
PrecisionAdaptor<solveVector, vector> tcellCtrs(cellCtrs_s);
|
||||
Field<solveVector>& cellCtrs = tcellCtrs.ref();
|
||||
PrecisionAdaptor<solveScalar, scalar> tcellVols(cellVols_s);
|
||||
Field<solveScalar>& cellVols = tcellVols.ref();
|
||||
|
||||
// Clear the fields for accumulation
|
||||
cellCtrs = Zero;
|
||||
cellVols = 0.0;
|
||||
|
||||
const labelList& own = faceOwner();
|
||||
const labelList& nei = faceNeighbour();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user