Commit 2aba2a5a authored by Gurecky, William's avatar Gurecky, William
Browse files

update z_power_grid doc string and increase sigfigs in card 11.4

parent 89551d92
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
@@ -128,17 +128,6 @@ class Core(object):
      z_center_grid = np.average(me.z_bounds_pairs, axis=1)
      return z_center_grid

   @property
   def z_power_grid(me):
      """ Adjust z center endpoints to span entire axial core height """
      z_pwr_grid = me.z_bounds_pairs
      # slightly adjust the upper bounds of each axial edit zone
      z_pwr_grid[:, 1] -= 1e-8
      # flatten and return
      z_pwr_grid = z_pwr_grid.flatten()
      z_pwr_grid[-1] = np.cumsum(me.dz)[-1] + 1e-8
      return z_pwr_grid

   @property
   def z_bounds(me):
      """ Axial level z boundaries """
@@ -158,6 +147,24 @@ class Core(object):
      z_pairs = np.asarray((me.z_bounds[:-1], me.z_bounds[1:])).T
      return z_pairs

   @property
   def z_power_grid(me):
      """
      Returns a flattened view of z_bounds_pairs with small adjustments
      made to the cell boundaries.  This is for use only when
      specifying a CTF power factor table.  The flattened array has
      the form:
      [z_0, z_1-eps, z_1, z_2-eps, z_2, z_3-eps, ...]
      where eps is a small value (eps=1e-6).
      """
      z_pwr_grid = me.z_bounds_pairs
      # slightly adjust the upper bounds of each axial edit zone
      z_pwr_grid[:, 1] -= 1e-6
      # flatten and return
      z_pwr_grid = z_pwr_grid.flatten()
      z_pwr_grid[-1] = np.cumsum(me.dz)[-1] + 1e-6
      return z_pwr_grid

   # === Delegate to me.model ===
   def __getattr__(me, attr):
      """
+1 −1
Original line number Diff line number Diff line
@@ -508,7 +508,7 @@ def writeDeck(model, filename):
         group11Data.append("**Card 11.4\n")
         group11Data.append("*             Y         AXIALZ\n")
         for i, z in enumerate(model.axialPowerShapeAxial[time][powID]):
            group11Data.append("{0:15.5e}{1:15.5e}\n".format(z, model.axialPowerShapePower[time][powID][i]))
            group11Data.append("{0:15.6e}{1:15.6e}\n".format(z, model.axialPowerShapePower[time][powID][i]))
   if nq>0:
      group11Data.append("**Card 11.5                                                                                     \n")
      group11Data.append("*{0:>14s}{1:>15s}\n".format('YQ', 'FQ'))
+75660 −75660

File changed.

Preview size limit exceeded, changes collapsed.