mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-07-18 03:17:04 +00:00
fixed the error when insert particles from file with integer number
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user