improveMeshQuality: error in constrainedCellsSet command-line flag handling
Summary
The constrainedCellSet
command line option does nothing.
Quite early in the main() method, the option for constrained cells is added to the list of options as shown below:
argList::addOption("constrainedCellsSet", "word");
Later, the passed arguments are checked for the option of constrained cells, as shown below:
word constrainedCellSet;
if (!args.readIfPresent("constrainedCellSet", constrainedCellSet))
{
Info<< "No constraints applied on the smoothing procedure" << endl;
}
Unfortunately, there's a typo such that the option "constrainedCellsSet" is added to the command line options, however, later "constrainedCellSet" is checked against. Notice "constrainedCellsSet" vs. "constrainedCellSet".
Thus, the option to constrain cells currently does nothing, respectively can not be used.
Steps to reproduce
Example case
Even, when fixing the mis-matched strings, such that the option is actually checked, it still seems to do nothing. Here's a mesh, where I created a boundary layer using snappyHexMesh, which created a cellSet named addedCells.
When I run improveMeshQuality -constrainedCellSet addedCells
the cells of the boundary layer are still part of the mesh smoothing.
Only the faces at the boundaries are unaffected.
Maybe, this feature wasn't intended to protect whole cells from being smoothed.
What is the current bug behaviour?
Running improveMeshQuality -constrainedCellsSet addedCells
does nothing
Terminal output
...
Default number of surface iterations is 2
Using default quality threshold 0.1
No constraints applied on the smoothing procedure
Resizing points!
Starting creating cells
...
Running improveMeshQuality -constrainedCellSet addedCells
leads to an error, since it's no valid option. However, that's what would later be checked in the case as it is now.
What is the expected correct behavior?
I would expect that the cells of the passed cellSet are not affected by the smoothing operation, which is currently the case.
Relevant logs and/or images
Environment information
- OpenFOAM version : v2306
- Operating system : ubuntu
- Hardware info :
- Compiler : gcc
Possible fixes
Match the strings in lines 59 and 96 in improveMeshQuality.C
argList::addOption("constrainedCellsSet", "word");
if (!args.readIfPresent("constrainedCellSet", constrainedCellSet))