コード例 #1
0
    def growToFullCore(self):
        """
        Convert geometry input to full core.

        Notes
        -----
        This only works for Hex 1/3rd core geometry inputs.
        """
        if self.symmetry == FULL_CORE:
            # already full core from geometry file. No need to copy symmetry over.
            runLog.important(
                "Detected that full core geometry already exists. Cannot expand."
            )
            return
        elif self.symmetry != THIRD_CORE + PERIODIC:
            raise ValueError(
                "Cannot convert symmetry `{}` to full core, must be {}".format(
                    self.symmetry, THIRD_CORE + PERIODIC
                )
            )

        grid = grids.hexGridFromPitch(1.0)

        # need to cast to a list because we will modify during iteration
        for (ring, pos), specifierID in list(self.assemTypeByIndices.items()):
            indices = grids.getIndicesFromRingAndPos(ring, pos)
            for symmetricI, symmetricJ in grid.getSymmetricIdenticalsThird(indices):
                symmetricRingPos = grids.indicesToRingPos(symmetricI, symmetricJ)
                self.assemTypeByIndices[symmetricRingPos] = specifierID

        self.symmetry = FULL_CORE
コード例 #2
0
 def _read_yaml_lattice(self, system):
     """Read a ascii map string into this object."""
     mapTxt = system[INP_LATTICE]
     if self.geomType == HEX and THIRD_CORE in self.symmetry:
         geomMap = asciimaps.AsciiMapHexThird()
         geomMap.readMap(mapTxt)
         for (i, j), spec in geomMap.lattice.items():
             if spec == "-":
                 # skip whitespace placeholders
                 continue
             ring, pos = grids.indicesToRingPos(i, j)
             self.assemTypeByIndices[(ring, pos)] = spec
             self.maxRings = max(ring, self.maxRings)
     else:
         raise ValueError(
             f"ASCII map reading from geom/symmetry: {self.geomType}/"
             f"{self.symmetry} not supported.")