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

@ -49,7 +49,14 @@ bool pFlow::positionFile::positionPointsFile()
is >> tok; is >> tok;
if(tok.good()&& tok.isNumber()&& !is.eof()) if(tok.good()&& tok.isNumber()&& !is.eof())
{ {
tempPoint.x() = tok.realToken(); if(tok.isReal())
{
tempPoint.x() = tok.realToken();
}
else
{
tempPoint.x() = static_cast<real>(tok.int64Token());
}
} }
else else
{ {
@ -71,7 +78,14 @@ bool pFlow::positionFile::positionPointsFile()
is >> tok; is >> tok;
if(tok.good()&& tok.isNumber()&& !is.eof()) if(tok.good()&& tok.isNumber()&& !is.eof())
{ {
tempPoint.y() = tok.realToken(); if(tok.isReal())
{
tempPoint.y() = tok.realToken();
}
else
{
tempPoint.y() = static_cast<real>(tok.int64Token());
}
} }
else else
{ {
@ -93,7 +107,14 @@ bool pFlow::positionFile::positionPointsFile()
is >> tok; is >> tok;
if(tok.good()&& tok.isNumber()&& !is.eof()) if(tok.good()&& tok.isNumber()&& !is.eof())
{ {
tempPoint.z() = tok.realToken(); if(tok.isReal())
{
tempPoint.z() = tok.realToken();
}
else
{
tempPoint.z() = static_cast<real>(tok.int64Token());
}
} }
else else
{ {