-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NodalScalarKernel not working with boundary name starting with numbers #23776
Comments
@dogrady2 FYI |
Thanks for reporting the problem! @lingzou are you working on a fix? If not, |
@GiudGiud No, I am not working a fix. I should be able to fix the |
@roystgnr I read over https://en.cppreference.com/w/cpp/locale/num_get/get and frankly don't understand why a fail bit is not set when parsing A new check we could implement is https://stackoverflow.com/a/8889045 but what sucks is that we are then iterating over the string twice if the check passes |
We're using I'm not actually sure why I can't find an "official" C++ method to do this check ... even |
I wouldn't stress about iterating over short strings twice, though. It'll already be in L1 cache for the first iteration and at that point futzing around more with it is cheap. |
Bug Description
NodalScalarKernel
(and its derived classes) acceptsboundary
(vector ofBoundaryName
) as one of its inputs. From the boundary name, the code accesses thenodelist
via moose mesh API call:in turn, which calls a function from MooseMeshUtils
If, in a moose mesh, a boundary name starts with number, e.g.,
123_xyz
, this lineif (!(ss >> id))
incorrectly detects that123
is the boundary id, returns the incorrect id to_mesh.getNodeList
, which in turn triggers the following error:Steps to Reproduce
The zip file includes an input file and a mesh file to reproduce the error.
2d.zip
(Note that this might not be the best test case, since
NodalEqualValueConstraint
does not really work with boundaries, but it is enough to trigger the error as described above. FYI, if the boundary bug is fixed, this input will still error out becauseNodalEqualValueConstraint
wants to see two nodes).Impact
This bug can be avoided by not using boundary names starting with numbers.
The text was updated successfully, but these errors were encountered: