def _get_results(self, hash_output=False): """Digest info in the statepoint and return as a string.""" # Read the statepoint file. statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0] sp = StatePoint(statepoint) sp.read_results() # Write out k-combined. outstr = 'k-combined:\n' form = '{0:12.6E} {1:12.6E}\n' outstr += form.format(sp.k_combined[0], sp.k_combined[1]) # Write out tally data. if self._tallies: tally_num = 1 for tally_ind in sp._tallies: tally = sp._tallies[tally_ind] results = np.zeros((tally._sum.size*2, )) results[0::2] = tally._sum.ravel() results[1::2] = tally._sum_sq.ravel() results = ['{0:12.6E}'.format(x) for x in results] outstr += 'tally ' + str(tally_num) + ':\n' outstr += '\n'.join(results) + '\n' tally_num += 1 # Hash the results if necessary. if hash_output: sha512 = hashlib.sha512() sha512.update(outstr.encode('utf-8')) outstr = sha512.hexdigest() return outstr
def _get_results(self): """Digest info in the statepoint and return as a string.""" # Read the statepoint file. statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0] sp = StatePoint(statepoint) sp.read_results() # Write out the eigenvalue and tallies. outstr = TestHarness._get_results(self) # Write out CMFD data. outstr += 'cmfd indices\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._cmfd_indices]) outstr += '\nk cmfd\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._k_cmfd]) outstr += '\ncmfd entropy\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._cmfd_entropy]) outstr += '\ncmfd balance\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._cmfd_balance]) outstr += '\ncmfd dominance ratio\n' outstr += '\n'.join(['{0:10.3E}'.format(x) for x in sp._cmfd_dominance]) outstr += '\ncmfd openmc source comparison\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._cmfd_srccmp]) outstr += '\ncmfd source\n' cmfdsrc = np.reshape(sp._cmfd_src, np.product(sp._cmfd_indices), order='F') outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfdsrc]) outstr += '\n' return outstr
def _get_results(self, hash_output=False): """Digest info in the statepoint and return as a string.""" # Read the statepoint file. statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0] sp = StatePoint(statepoint) sp.read_results() # Write out k-combined. outstr = 'k-combined:\n' form = '{0:12.6E} {1:12.6E}\n' outstr += form.format(sp.k_combined[0], sp.k_combined[1]) # Write out tally data. if self._tallies: tally_num = 1 for tally_ind in sp._tallies: tally = sp._tallies[tally_ind] results = np.zeros((tally._sum.size * 2, )) results[0::2] = tally._sum.ravel() results[1::2] = tally._sum_sq.ravel() results = ['{0:12.6E}'.format(x) for x in results] outstr += 'tally ' + str(tally_num) + ':\n' outstr += '\n'.join(results) + '\n' tally_num += 1 # Hash the results if necessary. if hash_output: sha512 = hashlib.sha512() sha512.update(outstr.encode('utf-8')) outstr = sha512.hexdigest() return outstr
def _get_results(self): """Digest info in the statepoint and return as a string.""" # Read the statepoint file. statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0] sp = StatePoint(statepoint) sp.read_results() # Write out the eigenvalue and tallies. outstr = TestHarness._get_results(self) # Write out CMFD data. outstr += 'cmfd indices\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._cmfd_indices]) outstr += '\nk cmfd\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._k_cmfd]) outstr += '\ncmfd entropy\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._cmfd_entropy]) outstr += '\ncmfd balance\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._cmfd_balance]) outstr += '\ncmfd dominance ratio\n' outstr += '\n'.join( ['{0:10.3E}'.format(x) for x in sp._cmfd_dominance]) outstr += '\ncmfd openmc source comparison\n' outstr += '\n'.join(['{0:12.6E}'.format(x) for x in sp._cmfd_srccmp]) outstr += '\ncmfd source\n' cmfdsrc = np.reshape(sp._cmfd_src, np.product(sp._cmfd_indices), order='F') outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfdsrc]) outstr += '\n' return outstr
def _get_results(self): """Digest info in the statepoint and return as a string.""" # Read the statepoint file. statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0] sp = StatePoint(statepoint) # Write out tally data. outstr = '' if self._tallies: tally_num = 1 for tally_ind in sp.tallies: tally = sp.tallies[tally_ind] results = np.zeros((tally.sum.size * 2, )) results[0::2] = tally.sum.ravel() results[1::2] = tally.sum_sq.ravel() results = ['{0:12.6E}'.format(x) for x in results] outstr += 'tally ' + str(tally_num) + ':\n' outstr += '\n'.join(results) + '\n' tally_num += 1 gt = sp.global_tallies outstr += 'leakage:\n' outstr += '{0:12.6E}'.format( gt[gt['name'] == b'leakage'][0]['sum']) + '\n' outstr += '{0:12.6E}'.format( gt[gt['name'] == b'leakage'][0]['sum_sq']) + '\n' return outstr
def _get_results(self): """Digest info in the statepoint and return as a string.""" # Read the statepoint file. statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0] sp = StatePoint(statepoint) # Get the eigenvalue information. outstr = TestHarness._get_results(self) # Add the source information. xyz = sp.source[0]['xyz'] outstr += ' '.join(['{0:12.6E}'.format(x) for x in xyz]) outstr += "\n" return outstr
def _get_results(self): """Digest info in the statepoint and return as a string.""" # Read the statepoint file. statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0] sp = StatePoint(statepoint) # Write out k-combined. outstr = 'k-combined:\n' form = '{0:12.6E} {1:12.6E}\n' outstr += form.format(sp.k_combined[0], sp.k_combined[1]) # Write out entropy data. outstr += 'entropy:\n' results = ['{0:12.6E}'.format(x) for x in sp.entropy] outstr += '\n'.join(results) + '\n' return outstr