Skip to content
Snippets Groups Projects
Commit 82fdeb27 authored by Andrew Heather's avatar Andrew Heather
Browse files

bug fix - previously exited after first command as error flag was used instead...

bug fix - previously exited after first command as error flag was used instead of ok flag in main while loop
parent b2b5ace2
No related branches found
No related tags found
No related merge requests found
...@@ -405,64 +405,71 @@ bool doCommand ...@@ -405,64 +405,71 @@ bool doCommand
backup(mesh, setName, currentSet, setName + "_old"); backup(mesh, setName, currentSet, setName + "_old");
} }
if (action == topoSetSource::CLEAR) switch (action)
{ {
// Already handled above by not reading case topoSetSource::CLEAR:
}
else if (action == topoSetSource::INVERT)
{
currentSet.invert(currentSet.maxSize(mesh));
}
else if (action == topoSetSource::LIST)
{
currentSet.writeDebug(Pout, mesh, 100);
Pout<< endl;
}
else if (action == topoSetSource::SUBSET)
{
if (is >> sourceType)
{ {
autoPtr<topoSetSource> setSource // Already handled above by not reading
( break;
topoSetSource::New }
case topoSetSource::INVERT:
{
currentSet.invert(currentSet.maxSize(mesh));
break;
}
case topoSetSource::LIST:
{
currentSet.writeDebug(Pout, mesh, 100);
Pout<< endl;
break;
}
case topoSetSource::SUBSET:
{
if (is >> sourceType)
{
autoPtr<topoSetSource> setSource
(
topoSetSource::New
(
sourceType,
mesh,
is
)
);
// Backup current set.
topoSet oldSet
( (
sourceType,
mesh, mesh,
is currentSet.name() + "_old2",
) currentSet
); );
// Backup current set. currentSet.clear();
topoSet oldSet currentSet.resize(oldSet.size());
( setSource().applyToSet(topoSetSource::NEW, currentSet);
mesh,
currentSet.name() + "_old2",
currentSet
);
currentSet.clear(); // Combine new value of currentSet with old one.
currentSet.resize(oldSet.size()); currentSet.subset(oldSet);
setSource().applyToSet(topoSetSource::NEW, currentSet); }
break;
// Combine new value of currentSet with old one.
currentSet.subset(oldSet);
} }
} default:
else
{
if (is >> sourceType)
{ {
autoPtr<topoSetSource> setSource if (is >> sourceType)
( {
topoSetSource::New autoPtr<topoSetSource> setSource
( (
sourceType, topoSetSource::New
mesh, (
is sourceType,
) mesh,
); is
)
setSource().applyToSet(action, currentSet); );
setSource().applyToSet(action, currentSet);
}
} }
} }
...@@ -532,7 +539,7 @@ bool doCommand ...@@ -532,7 +539,7 @@ bool doCommand
} }
} }
return error; return !error;
} }
...@@ -612,31 +619,36 @@ commandStatus parseType ...@@ -612,31 +619,36 @@ commandStatus parseType
switch(stat) switch(stat)
{ {
case polyMesh::UNCHANGED: case polyMesh::UNCHANGED:
{
Pout<< " mesh not changed." << endl; Pout<< " mesh not changed." << endl;
break; break;
}
case polyMesh::POINTS_MOVED: case polyMesh::POINTS_MOVED:
{
Pout<< " points moved; topology unchanged." << endl; Pout<< " points moved; topology unchanged." << endl;
break; break;
}
case polyMesh::TOPO_CHANGE: case polyMesh::TOPO_CHANGE:
{
Pout<< " topology changed; patches unchanged." << nl Pout<< " topology changed; patches unchanged." << nl
<< " "; << " ";
printMesh(runTime, mesh); printMesh(runTime, mesh);
break;
break; }
case polyMesh::TOPO_PATCH_CHANGE: case polyMesh::TOPO_PATCH_CHANGE:
{
Pout<< " topology changed and patches changed." << nl Pout<< " topology changed and patches changed." << nl
<< " "; << " ";
printMesh(runTime, mesh); printMesh(runTime, mesh);
break; break;
}
default: default:
{
FatalErrorIn("parseType") << "Illegal mesh update state " FatalErrorIn("parseType") << "Illegal mesh update state "
<< stat << abort(FatalError); << stat << abort(FatalError);
break; break;
}
} }
return INVALID; return INVALID;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment