10.1.1.1.1. armicontrib.dif3d.binaryIO.dif3dFile module

Read/write the DIF3D binary interface file.

This is a DIF3D-specific file with format defined in the DIF3D manual.

To be clear, this is a file called DIF3D that is made for/by the DIF3D code. It is used as input to a DIF3D run and is modified during the run to contain information about convergence, keff, dominance ratio, coarse-mesh rebalancing, optimum overrelaxation factors, etc.

Most things defined in the A.DIF3D input card end up in this file. This file is required by DIF3D for initial runs and restarts.

This reads/writes version 10/31/00 (1.3) of the file from the REBUS manual https://digital.library.unt.edu/ark:/67531/metadc735151/m1/141/

class armicontrib.dif3d.binaryIO.dif3dFile.Convergence(value)[source]

Bases: enum.Enum

Convergence flags for DIF3D outers.

NO_ITERATIONS = 0
CONVERGED = 1
OUTERS_LIMIT_REACHED = 2
TIME_LIMIT_REACHED = 3
class armicontrib.dif3d.binaryIO.dif3dFile.Dif3dData[source]

Bases: armi.nuclearDataIO.cccc.cccc.DataContainer

Data representation that can be read from or written to a DIF3D file.

This exposes several useful items from the data structure as properties for convenience.

makeSummary()[source]

Make a short summary of info contained in this file.

property problemType
property solutionType

Get the read/adjoint solution type.

Warning

If you run a DIF3D run in REAL_AND_ADJOINT mode, the DIF3D file that remains just has the ADJOINT flag.

property convergence
property keff
class armicontrib.dif3d.binaryIO.dif3dFile.Dif3dStream(data: armi.nuclearDataIO.cccc.cccc.DataContainer, fileName: str, fileMode: str)[source]

Bases: armi.nuclearDataIO.cccc.cccc.StreamWithDataContainer

Stream for reading to/writing from with DIF3D data.

Parameters
  • data (Dif3dData) – Data structure

  • fileName (str) – path to DIF3D file

  • fileMode (str) – string indicating if fileName is being read or written, and in ascii or binary format

Create an instance of a Stream.

Parameters
  • fileName (str) – name of the file to be read

  • fileMode (str) – the file mode, i.e. ‘w’ for writing ASCII, ‘r’ for reading ASCII, ‘wb’ for writing binary, and ‘rb’ for reading binary.

readWrite()[source]

Step through the structure of the file and read/write it.