Merge pull request #238 from wanqing0421/main

fixed the error when insert particles from file with integer number
This commit is contained in:
PhasicFlow
2025-07-17 20:52:19 +03:30
committed by GitHub

View File

@ -48,10 +48,17 @@ bool pFlow::positionFile::positionPointsFile()
is >> tok;
if(tok.good()&& tok.isNumber()&& !is.eof())
{
if(tok.isReal())
{
tempPoint.x() = tok.realToken();
}
else
{
tempPoint.x() = static_cast<real>(tok.int64Token());
}
}
else
{
ioErrorInFile(is.name(), is.lineNumber())<< "Bad char or end of file in reading position x!\n";
return false;
@ -70,10 +77,17 @@ bool pFlow::positionFile::positionPointsFile()
// read position y
is >> tok;
if(tok.good()&& tok.isNumber()&& !is.eof())
{
if(tok.isReal())
{
tempPoint.y() = tok.realToken();
}
else
{
tempPoint.y() = static_cast<real>(tok.int64Token());
}
}
else
{
ioErrorInFile(is.name(), is.lineNumber())<< "Bad char or end of file in reading position y!\n";
return false;
@ -92,10 +106,17 @@ bool pFlow::positionFile::positionPointsFile()
// read position z
is >> tok;
if(tok.good()&& tok.isNumber()&& !is.eof())
{
if(tok.isReal())
{
tempPoint.z() = tok.realToken();
}
else
{
tempPoint.z() = static_cast<real>(tok.int64Token());
}
}
else
{
ioErrorInFile(is.name(), is.lineNumber())<< "Bad char or end of file in reading position z!\n";
return false;