Commit 088c96ee authored by Andrew Heather's avatar Andrew Heather Committed by graham
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 c1fb1539
......@@ -405,64 +405,71 @@ bool doCommand
backup(mesh, setName, currentSet, setName + "_old");
}
if (action == topoSetSource::CLEAR)
switch (action)
{
// Already handled above by not reading
}
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)
case topoSetSource::CLEAR:
{
autoPtr<topoSetSource> setSource
(
topoSetSource::New
// Already handled above by not reading
break;
}
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,
is
)
);
currentSet.name() + "_old2",
currentSet
);
// Backup current set.
topoSet oldSet
(
mesh,
currentSet.name() + "_old2",
currentSet
);
currentSet.clear();
currentSet.resize(oldSet.size());
setSource().applyToSet(topoSetSource::NEW, currentSet);
currentSet.clear();
currentSet.resize(oldSet.size());
setSource().applyToSet(topoSetSource::NEW, currentSet);
// Combine new value of currentSet with old one.
currentSet.subset(oldSet);
// Combine new value of currentSet with old one.
currentSet.subset(oldSet);
}
break;
}
}
else
{
if (is >> sourceType)
default:
{
autoPtr<topoSetSource> setSource
(
topoSetSource::New
if (is >> sourceType)
{
autoPtr<topoSetSource> setSource
(
sourceType,
mesh,
is
)
);
setSource().applyToSet(action, currentSet);
topoSetSource::New
(
sourceType,
mesh,
is
)
);
setSource().applyToSet(action, currentSet);
}
}
}
......@@ -532,7 +539,7 @@ bool doCommand
}
}
return error;
return !error;
}
......@@ -612,31 +619,36 @@ commandStatus parseType
switch(stat)
{
case polyMesh::UNCHANGED:
{
Pout<< " mesh not changed." << endl;
break;
break;
}
case polyMesh::POINTS_MOVED:
{
Pout<< " points moved; topology unchanged." << endl;
break;
break;
}
case polyMesh::TOPO_CHANGE:
{
Pout<< " topology changed; patches unchanged." << nl
<< " ";
printMesh(runTime, mesh);
break;
break;
}
case polyMesh::TOPO_PATCH_CHANGE:
{
Pout<< " topology changed and patches changed." << nl
<< " ";
printMesh(runTime, mesh);
break;
break;
}
default:
{
FatalErrorIn("parseType") << "Illegal mesh update state "
<< stat << abort(FatalError);
break;
break;
}
}
return INVALID;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment