Skip to content
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

Cell lattice, fill, and universe aren't where I expect them to be. #699

Closed
MicahGale opened this issue Mar 16, 2025 · 2 comments · Fixed by #608
Closed

Cell lattice, fill, and universe aren't where I expect them to be. #699

MicahGale opened this issue Mar 16, 2025 · 2 comments · Fixed by #608
Assignees
Labels
alpha testing Issues that came up during alpha testing bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".
Milestone

Comments

@MicahGale
Copy link
Collaborator

MicahGale commented Mar 16, 2025

Describe the bug

If a cell's modifier (lat, fill, u) are manually set after parsing (or ab initio creation) it does not export properly.

To Reproduce

import montepy

problem = montepy.read_input("demo/pin_cell.imcnp")

surfs = problem.surfaces
right_surf = surfs[104]
left_surf = surfs[103]
y_top_surf = surfs[106]
y_bot_surf = surfs[105]
z_top_surf = surfs[102]
z_bot_surf = surfs[101]

universe = montepy.Universe(1)

unit_cell = montepy.Cell()
unit_cell.number = problem.cells.request_number()
problem.cells.append(unit_cell)
unit_cell.geometry = -right_surf & +left_surf
unit_cell.geometry &= -y_top_surf & +y_bot_surf
unit_cell.geometry &= -z_top_surf & +z_bot_surf
unit_cell.importance.neutron = 1.0

# TODO promote top level
unit_cell.lattice = montepy.data_inputs.lattice.Lattice.HEXAHEDRA
unit_cell.fill.universe = universe

# assign to own universe
lat_universe = montepy.Universe(5)
problem.universes.append(lat_universe)
unit_cell.universe = lat_universe
print(unit_cell.format_for_mcnp_input((6,2,0)))

Prints:

['7 0 -104 103 -106 105 -102 101 IMP:n=1.0 ']

Version

  • Version 1.0.0a3
@MicahGale MicahGale added the bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error". label Mar 16, 2025
@MicahGale MicahGale added this to the M&C workshop milestone Mar 16, 2025
@MicahGale MicahGale self-assigned this Mar 16, 2025
@MicahGale
Copy link
Collaborator Author

MicahGale commented Mar 16, 2025

Update: this is because problem.print_in_data_block["u"] == True 🤦🏻.

I think we should change the default behavior. Thoughts @tjlaboss?

@MicahGale MicahGale changed the title Cell lattice, fill, and universe don't export when manually updated Cell lattice, fill, and universe aren't where I expect them to be. Mar 17, 2025
@tjlaboss
Copy link
Collaborator

I agree that the default for all parameters should be on the cell card.

MicahGale added a commit that referenced this issue Mar 17, 2025
@MicahGale MicahGale added the alpha testing Issues that came up during alpha testing label Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha testing Issues that came up during alpha testing bugs A deviation from expected behavior that does not reach the level of being reportable as an "Error".
Projects
None yet
2 participants