ENH: handle some miscellaneous mixed input types (#1378)

This commit is contained in:
Mark Olesen
2019-08-06 16:57:29 +02:00
committed by Andrew Heather
parent 39834d8f45
commit b86f9944d7
7 changed files with 77 additions and 3 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,6 +61,21 @@ Foam::DTRMParticle::DTRMParticle
{
is >> p0_ >> p1_ >> I0_ >> I_ >> dA_ >> transmissiveId_;
}
else if (!is.checkLabelSize<>() || !is.checkScalarSize<>())
{
// Non-native label or scalar size
is.beginRawRead();
readRawScalar(is, p0_.data(), vector::nComponents);
readRawScalar(is, p1_.data(), vector::nComponents);
readRawScalar(is, &I0_);
readRawScalar(is, &I_);
readRawScalar(is, &dA_);
readRawLabel(is, &transmissiveId_);
is.endRawRead();
}
else
{
is.read(reinterpret_cast<char*>(&p0_), sizeofFields_);