Skip to content

Commit

Permalink
Update the uniform mesher to check if the lower and upper mesh (#869)
Browse files Browse the repository at this point in the history
* Update the uniform mesher to check if the lower and upper bounds of the provided mesh are similar and then skip if they are too close. This comes into play.
  • Loading branch information
jakehader committed Sep 7, 2022
1 parent 9cb79cf commit 2606fa7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions armi/reactor/converters/uniformMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,14 @@ def setAssemblyStateFromOverlaps(
# within the lower and upper bounds of the destination block.
sourceBlocksInfo = sourceAssembly.getBlocksBetweenElevations(zLower, zUpper)

if not sourceBlocksInfo:
if abs(zUpper - zLower) < 1e-6 and not sourceBlocksInfo:
continue
elif not sourceBlocksInfo:
raise ValueError(
f"An error occurred when attempting to map to the "
f"results from {sourceAssembly} to {destinationAssembly}. "
f"No blocks in {sourceAssembly} exist between the axial "
f"elevations of {zLower:<8.3e} cm and {zUpper:<8.3e} cm. "
f"elevations of {zLower:<12.5f} cm and {zUpper:<12.5f} cm. "
f"This a major bug in the uniform mesh converter that should "
f"be reported to the developers."
)
Expand All @@ -411,9 +413,7 @@ def setAssemblyStateFromOverlaps(
# source assembly within the lower and upper bounds of the destination
# block and perform the parameter mapping.
updatedDestVals = collections.defaultdict(float)

_setNumberDensitiesFromOverlaps(destBlock, sourceBlocksInfo)

for setter, getter, paramNames in [
(
BlockParamMapper.scalarParamSetter,
Expand Down

0 comments on commit 2606fa7

Please sign in to comment.