mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use readScalar(std::string) and readInt(std::string) wrappers
This commit is contained in:
@ -1201,7 +1201,7 @@ Foam::Time& Foam::Time::operator++()
|
|||||||
// reinterpretation of the word
|
// reinterpretation of the word
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
readScalar(dimensionedScalar::name().c_str(), timeNameValue)
|
readScalar(dimensionedScalar::name(), timeNameValue)
|
||||||
&& (mag(timeNameValue - oldTimeValue - userDeltaT) > timeTol)
|
&& (mag(timeNameValue - oldTimeValue - userDeltaT) > timeTol)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -1209,7 +1209,7 @@ Foam::Time& Foam::Time::operator++()
|
|||||||
while
|
while
|
||||||
(
|
(
|
||||||
precision_ < maxPrecision_
|
precision_ < maxPrecision_
|
||||||
&& readScalar(dimensionedScalar::name().c_str(), timeNameValue)
|
&& readScalar(dimensionedScalar::name(), timeNameValue)
|
||||||
&& (mag(timeNameValue - oldTimeValue - userDeltaT) > timeTol)
|
&& (mag(timeNameValue - oldTimeValue - userDeltaT) > timeTol)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -1242,7 +1242,7 @@ Foam::Time& Foam::Time::operator++()
|
|||||||
scalar oldTimeNameValue = -VGREAT;
|
scalar oldTimeNameValue = -VGREAT;
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
readScalar(oldTimeName.c_str(), oldTimeNameValue)
|
readScalar(oldTimeName, oldTimeNameValue)
|
||||||
&& (
|
&& (
|
||||||
sign(timeNameValue - oldTimeNameValue)
|
sign(timeNameValue - oldTimeNameValue)
|
||||||
!= sign(deltaT_)
|
!= sign(deltaT_)
|
||||||
|
|||||||
@ -105,12 +105,8 @@ Foam::instantList Foam::fileOperation::sortTimes
|
|||||||
// Read and parse all the entries in the directory
|
// Read and parse all the entries in the directory
|
||||||
forAll(dirEntries, i)
|
forAll(dirEntries, i)
|
||||||
{
|
{
|
||||||
//IStringStream timeStream(dirEntries[i]);
|
|
||||||
//token timeToken(timeStream);
|
|
||||||
|
|
||||||
//if (timeToken.isNumber() && timeStream.eof())
|
|
||||||
scalar timeValue;
|
scalar timeValue;
|
||||||
if (readScalar(dirEntries[i].c_str(), timeValue))
|
if (readScalar(dirEntries[i], timeValue))
|
||||||
{
|
{
|
||||||
Times[nTimes].value() = timeValue;
|
Times[nTimes].value() = timeValue;
|
||||||
Times[nTimes].name() = dirEntries[i];
|
Times[nTimes].name() = dirEntries[i];
|
||||||
|
|||||||
@ -291,25 +291,24 @@ Foam::fileOperations::masterUncollatedFileOperation::splitProcessorPath
|
|||||||
local = objectPath.substr(pos+9);
|
local = objectPath.substr(pos+9);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label proci;
|
||||||
|
|
||||||
pos = local.find('/');
|
pos = local.find('/');
|
||||||
if (pos == string::npos)
|
if (pos == string::npos)
|
||||||
{
|
{
|
||||||
// processorXXX without local
|
// processorXXX without local
|
||||||
label proci;
|
if (Foam::read(local, proci))
|
||||||
if (Foam::read(local.c_str(), proci))
|
|
||||||
{
|
{
|
||||||
local.clear();
|
local.clear();
|
||||||
return proci;
|
return proci;
|
||||||
}
|
}
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
string procName(local.substr(0, pos));
|
else if (Foam::read(local.substr(0, pos), proci))
|
||||||
label proci;
|
|
||||||
if (Foam::read(procName.c_str(), proci))
|
|
||||||
{
|
{
|
||||||
local = local.substr(pos+1);
|
local = local.substr(pos+1);
|
||||||
return proci;
|
return proci;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -176,7 +176,7 @@ bool Foam::UPstream::init(int& argc, char**& argv)
|
|||||||
int bufSize = 0;
|
int bufSize = 0;
|
||||||
|
|
||||||
const std::string str = Foam::getEnv("MPI_BUFFER_SIZE");
|
const std::string str = Foam::getEnv("MPI_BUFFER_SIZE");
|
||||||
if (str.empty() || !Foam::read(str.c_str(), bufSize) || bufSize <= 0)
|
if (str.empty() || !Foam::read(str, bufSize) || bufSize <= 0)
|
||||||
{
|
{
|
||||||
bufSize = mpiBufferSize;
|
bufSize = mpiBufferSize;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user