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;
|
is >> tok;
|
||||||
if(tok.good()&& tok.isNumber()&& !is.eof())
|
if(tok.good()&& tok.isNumber()&& !is.eof())
|
||||||
|
{
|
||||||
|
if(tok.isReal())
|
||||||
{
|
{
|
||||||
tempPoint.x() = tok.realToken();
|
tempPoint.x() = tok.realToken();
|
||||||
}
|
}
|
||||||
else
|
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";
|
ioErrorInFile(is.name(), is.lineNumber())<< "Bad char or end of file in reading position x!\n";
|
||||||
return false;
|
return false;
|
||||||
@ -70,10 +77,17 @@ bool pFlow::positionFile::positionPointsFile()
|
|||||||
// read position y
|
// read position y
|
||||||
is >> tok;
|
is >> tok;
|
||||||
if(tok.good()&& tok.isNumber()&& !is.eof())
|
if(tok.good()&& tok.isNumber()&& !is.eof())
|
||||||
|
{
|
||||||
|
if(tok.isReal())
|
||||||
{
|
{
|
||||||
tempPoint.y() = tok.realToken();
|
tempPoint.y() = tok.realToken();
|
||||||
}
|
}
|
||||||
else
|
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";
|
ioErrorInFile(is.name(), is.lineNumber())<< "Bad char or end of file in reading position y!\n";
|
||||||
return false;
|
return false;
|
||||||
@ -92,10 +106,17 @@ bool pFlow::positionFile::positionPointsFile()
|
|||||||
// read position z
|
// read position z
|
||||||
is >> tok;
|
is >> tok;
|
||||||
if(tok.good()&& tok.isNumber()&& !is.eof())
|
if(tok.good()&& tok.isNumber()&& !is.eof())
|
||||||
|
{
|
||||||
|
if(tok.isReal())
|
||||||
{
|
{
|
||||||
tempPoint.z() = tok.realToken();
|
tempPoint.z() = tok.realToken();
|
||||||
}
|
}
|
||||||
else
|
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";
|
ioErrorInFile(is.name(), is.lineNumber())<< "Bad char or end of file in reading position z!\n";
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user