ENH: add readContiguous detail (#1378)

- allows some internal handling for reading dissimilar storage types.
  Eg, scalars written as float (WM_SP), but read as double (WM_DP)

- reading binary parcel coordinates with dissimilar storage types is
  still pending
This commit is contained in:
Mark Olesen
2019-07-29 12:01:34 +02:00
committed by Andrew Heather
parent 1d79c0452c
commit 39834d8f45
10 changed files with 88 additions and 19 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011 OpenFOAM Foundation
@ -61,8 +61,9 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::refinementData& wDist)
}
else
{
is.read
Detail::readContiguous<refinementData>
(
is,
reinterpret_cast<char*>(&wDist.refinementCount_),
sizeof(refinementData)
);