ENH: improve ensightWrite handling of moving mesh

- now treat all mesh geometries as moving, since we cannot know
  beforehand if this is the case.
This commit is contained in:
Mark Olesen
2018-05-08 12:41:06 +02:00
parent f99880cbea
commit 5c60cbe34d
8 changed files with 105 additions and 71 deletions

View File

@ -335,15 +335,15 @@ void Foam::ensightFile::writeList
const UList<scalar>& field
)
{
forAll(field, i)
for (const scalar& val : field)
{
if (std::isnan(field[i]))
if (std::isnan(val))
{
writeUndef();
}
else
{
write(field[i]);
write(val);
}
newline();
@ -359,15 +359,15 @@ void Foam::ensightFile::writeList
{
if (notNull(idList))
{
forAll(idList, i)
for (const label idx : idList)
{
if (idList[i] >= field.size() || std::isnan(field[idList[i]]))
if (idx >= field.size() || std::isnan(field[idx]))
{
writeUndef();
}
else
{
write(field[idList[i]]);
write(field[idx]);
}
newline();
@ -375,7 +375,7 @@ void Foam::ensightFile::writeList
}
else
{
// no idList => perNode
// No idList => perNode
writeList(field);
}
}