예제 #1
0
def createReportFromSettings(cs):
    """
    Create BEGINNING reports, given a settings file.

    This will construct a reactor from the given settings and create BOL reports for
    that reactor/settings.
    """
    # not sure if this is necessary, but need to investigate more to understand possible
    # side-effects before removing. Probably better to get rid of all uses of
    # getMasterCs(), then we can remove all setMasterCs() calls without worrying.
    settings.setMasterCs(cs)

    blueprint = blueprints.loadFromCs(cs)
    r = reactors.factory(cs, blueprint)
    report = reports.ReportContent("Overview")
    pm = getPluginManagerOrFail()
    report.title = r.name

    with directoryChangers.ForcedCreationDirectoryChanger("{}-reports".format(
            cs.caseTitle)):
        _ = pm.hook.getReportContents(
            r=r,
            cs=cs,
            report=report,
            stage=reports.ReportStage.Begin,
            blueprint=blueprint,
        )
        site = report.writeReports()

    return site
예제 #2
0
        def setUp(self):
            self.cs = settings.Settings(fName=ARMI_RUN_PATH)
            bp = blueprints.loadFromCs(self.cs)

            settings.setMasterCs(self.cs)
            self.o = OperatorMPI(self.cs)
            self.o.r = reactors.factory(self.cs, bp)
            self.action = DistributeStateAction()
            self.action.o = self.o
            self.action.r = self.o.r
    def _updateBlueprints(self):
        from armi.reactor import blueprints
        from armi.reactor.blueprints import isotopicOptions

        # modify nuclide expansion flags as well b/c the main DRAGON lib only has C12.
        bp = blueprints.loadFromCs(self.cs)
        bp.nuclideFlags = isotopicOptions.genDefaultNucFlags()
        bp.nuclideFlags["C"].expandTo = ["C12"]
        bp.nuclideFlags["W"].expandTo = ["W182", "W183", "W184", "W186"]
        return bp
예제 #4
0
파일: case.py 프로젝트: ntouran/armi
    def bp(self):
        """
        Blueprint object for this case.

        Notes
        -----
        This property allows lazy loading.
        """
        if self._bp is None:
            self._bp = blueprints.loadFromCs(self.cs, roundTrip=True)
        return self._bp
예제 #5
0
    def test_plotCartesianBlock(self):
        from armi import settings
        from armi.reactor import blueprints, reactors

        with TemporaryDirectoryChanger():
            cs = settings.Settings(
                os.path.join(TEST_ROOT, "tutorials", "c5g7-settings.yaml"))

            blueprint = blueprints.loadFromCs(cs)
            r = reactors.factory(cs, blueprint)
            for name, bDesign in blueprint.blockDesigns.items():
                b = bDesign.construct(cs, blueprint, 0, 1, 1, "AA", {})
                plotting.plotBlockDiagram(b, "{}.svg".format(name), True)
            self.assertTrue(os.path.exists("uo2.svg"))
            self.assertTrue(os.path.exists("mox.svg"))