mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: dictionary: allow transfer of empty dictionary
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -102,7 +102,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
|
||||
myComm.above(),
|
||||
0,
|
||||
Pstream::msgType(),
|
||||
IOstream::ASCII
|
||||
IOstream::BINARY
|
||||
);
|
||||
IOdictionary::readData(fromAbove);
|
||||
}
|
||||
@ -121,7 +121,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
|
||||
myComm.below()[belowI],
|
||||
0,
|
||||
Pstream::msgType(),
|
||||
IOstream::ASCII
|
||||
IOstream::BINARY
|
||||
);
|
||||
IOdictionary::writeData(toBelow);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -80,6 +80,12 @@ Foam::autoPtr<Foam::dictionary> Foam::dictionary::New(Istream& is)
|
||||
|
||||
bool Foam::dictionary::read(Istream& is, const bool keepHeader)
|
||||
{
|
||||
// Check for empty dictionary
|
||||
if (is.eof())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!is.good())
|
||||
{
|
||||
FatalIOErrorIn("dictionary::read(Istream&, bool)", is)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -107,12 +107,7 @@ Foam::UIPstream::UIPstream
|
||||
|
||||
if (!messageSize_)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"UIPstream::UIPstream(const commsTypes, const int, "
|
||||
"DynamicList<char>&, streamFormat, versionNumber)"
|
||||
) << "read failed"
|
||||
<< Foam::abort(FatalError);
|
||||
setEof();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -199,11 +194,7 @@ Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers)
|
||||
|
||||
if (!messageSize_)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"UIPstream::UIPstream(const int, PstreamBuffers&)"
|
||||
) << "read failed"
|
||||
<< Foam::abort(FatalError);
|
||||
setEof();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user