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
|
||||
if
|
||||
(
|
||||
readScalar(dimensionedScalar::name().c_str(), timeNameValue)
|
||||
readScalar(dimensionedScalar::name(), timeNameValue)
|
||||
&& (mag(timeNameValue - oldTimeValue - userDeltaT) > timeTol)
|
||||
)
|
||||
{
|
||||
@ -1209,7 +1209,7 @@ Foam::Time& Foam::Time::operator++()
|
||||
while
|
||||
(
|
||||
precision_ < maxPrecision_
|
||||
&& readScalar(dimensionedScalar::name().c_str(), timeNameValue)
|
||||
&& readScalar(dimensionedScalar::name(), timeNameValue)
|
||||
&& (mag(timeNameValue - oldTimeValue - userDeltaT) > timeTol)
|
||||
)
|
||||
{
|
||||
@ -1242,7 +1242,7 @@ Foam::Time& Foam::Time::operator++()
|
||||
scalar oldTimeNameValue = -VGREAT;
|
||||
if
|
||||
(
|
||||
readScalar(oldTimeName.c_str(), oldTimeNameValue)
|
||||
readScalar(oldTimeName, oldTimeNameValue)
|
||||
&& (
|
||||
sign(timeNameValue - oldTimeNameValue)
|
||||
!= sign(deltaT_)
|
||||
|
||||
@ -105,12 +105,8 @@ Foam::instantList Foam::fileOperation::sortTimes
|
||||
// Read and parse all the entries in the directory
|
||||
forAll(dirEntries, i)
|
||||
{
|
||||
//IStringStream timeStream(dirEntries[i]);
|
||||
//token timeToken(timeStream);
|
||||
|
||||
//if (timeToken.isNumber() && timeStream.eof())
|
||||
scalar timeValue;
|
||||
if (readScalar(dirEntries[i].c_str(), timeValue))
|
||||
if (readScalar(dirEntries[i], timeValue))
|
||||
{
|
||||
Times[nTimes].value() = timeValue;
|
||||
Times[nTimes].name() = dirEntries[i];
|
||||
|
||||
@ -291,25 +291,24 @@ Foam::fileOperations::masterUncollatedFileOperation::splitProcessorPath
|
||||
local = objectPath.substr(pos+9);
|
||||
}
|
||||
|
||||
label proci;
|
||||
|
||||
pos = local.find('/');
|
||||
if (pos == string::npos)
|
||||
{
|
||||
// processorXXX without local
|
||||
label proci;
|
||||
if (Foam::read(local.c_str(), proci))
|
||||
if (Foam::read(local, proci))
|
||||
{
|
||||
local.clear();
|
||||
return proci;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
string procName(local.substr(0, pos));
|
||||
label proci;
|
||||
if (Foam::read(procName.c_str(), proci))
|
||||
else if (Foam::read(local.substr(0, pos), proci))
|
||||
{
|
||||
local = local.substr(pos+1);
|
||||
return proci;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -176,7 +176,7 @@ bool Foam::UPstream::init(int& argc, char**& argv)
|
||||
int bufSize = 0;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user