-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] - renumbering universes not working properly #103
Comments
weird for it to be a random cell... have you done any other manipulation of the input before trying to renumber? (maybe acting on that specific cell?) because in that case we may have a numjuggler problem where when you are modifying something in a cell the attribute is not reflected correctly everywhere |
The problem is indeed related to numjuggler and how it writes a card. Here an example on how to reproduce the error: from numjuggler.parser import Card
definition = ['600177 400 -1.00000e+00 $ WATER_LEFT\n', ' 600003 -600421 601230 -600013 600011\n', ' Vol=1.335972e+01\n', ' imp:n=1.0 imp:p=1.0 U=5972 \n']
cell2 = Card(definition, ctype=3, pos=1)
cell2.get_values()
cell2._set_value_by_type("u", 30)
print(cell2.card()) |
Definitively an important bug that needs to be solved :) |
The thing is that we still do not have a minimum example of this that can reproduce the error |
@dodu94 actually I posted an example |
There is a difference betweeen a screenshot of a much more complex model where the thing did not work and finding a minimum working example attached to this issue that can be parsed and used for debugging :D |
But look at the comments of the issue, I posted a python code |
mu bad, I did not realize that without the output and I forgot that we discussed this in the past |
Additional details: it seems that there is something specific with the number 5972 from numjuggler.parser import Card
definition = [
'600177 400 -1.00000e+00 $ WATER_LEFT\n',
' 600003 -600421 601230 -600013 600011\n',
' Vol=1.335972e+01\n',
' imp:n=1.0 imp:p=1.0 U=5972 \n']
cell2 = Card(definition, ctype=3, pos=1)
cell2.get_values()
print(cell2.card())
cell2._set_value_by_type("u", 30)
print(cell2.card())
print(cell2.input[-1])
Using another number the universe field is correctly recognized from numjuggler.parser import Card
definition = [
'600177 400 -1.00000e+00 $ WATER_LEFT\n',
' 600003 -600421 601230 -600013 600011\n',
' Vol=1.335972e+01\n',
' imp:n=1.0 imp:p=1.0 U=5973 \n']
cell2 = Card(definition, ctype=3, pos=1)
cell2.get_values()
print(cell2.card())
cell2._set_value_by_type("u", 30)
print(cell2.card())
print(cell2.input[-1])
|
here you have the problematic numbers in the range from 0 to 10000 for num in range(10000):
definition = [
'600177 400 -1.00000e+00 $ WATER_LEFT\n',
' 600003 -600421 601230 -600013 600011\n',
' Vol=1.335972e+01\n',
f' imp:n=1.0 imp:p=1.0 U={num} \n']
cell2 = Card(definition, ctype=3, pos=1)
cell2.get_values()
cell2._set_value_by_type("u", 30)
if not 'U=30' in cell2.card():
print(num)
|
Why are these problematic numbers? Have been already preallocated someway? |
Do not now yet |
Describe the bug
the renumber() method of Input class is not renumbering universes correctly. in particular, one cell is left non-renumbered after the usage of the method.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All cells U= flag is renumbered correctly
Screenshots

Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: