34Foam::scalar Foam::readScalar(Istream& is)
43Foam::scalar Foam::readRawScalar(Istream& is)
46 readRawScalar(is, &val, 1);
51void Foam::readRawScalar(Istream& is, scalar* data,
size_t nElem)
55 #if defined(WM_SP) || defined(WM_SPDP)
60 typedef double nonNative;
62 if (is.checkScalarSize<nonNative>())
66 for (
const scalar* endData = data + nElem; data != endData; ++data)
68 is.readRaw(
reinterpret_cast<char*
>(&other),
sizeof(nonNative));
77 else if (other > VGREAT)
81 else if (other > -VSMALL && other < VSMALL)
88 *data = scalar(other);
95 is.readRaw(
reinterpret_cast<char*
>(data), nElem*
sizeof(scalar));
102 typedef float nonNative;
104 if (is.checkScalarSize<nonNative>())
108 for (
const scalar* endData = data + nElem; data != endData; ++data)
110 is.readRaw(
reinterpret_cast<char*
>(&other),
sizeof(nonNative));
112 *data = scalar(other);
118 is.readRaw(
reinterpret_cast<char*
>(data), nElem*
sizeof(scalar));
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...