Exemplo n.º 1
0
 def exposeInterfaces(cs):
     kernels = [
         interfaces.InterfaceInfo(ORDER.FLUX, fluxSolver.FluxInterface, {}),
         interfaces.InterfaceInfo(
             ORDER.THERMAL_HYDRAULICS, thermalSolver.ThermalInterface, {}
         ),
     ]
     return kernels
Exemplo n.º 2
0
 def exposeInterfaces(cs):
     """Function for exposing interface(s) to other code"""
     from . import dragonInterface
     if (cs[nSettings.CONF_XS_KERNEL] == "DRAGON"
             and "Neutron" in cs[nSettings.CONF_GEN_XS]):
         klass = dragonInterface.DragonInterface
         return [interfaces.InterfaceInfo(ORDER, klass, {})]
     return []
Exemplo n.º 3
0
    def exposeInterfaces(cs):
        """Function for exposing interface(s) to other code"""
        nk = cs["neutronicsKernel"]
        kwargs = {"enabled": bool(cs["globalFluxActive"]), "bolForce": True}

        if nk in settings.KERNELS:
            return [
                interfaces.InterfaceInfo(globalFluxInterface.ORDER,
                                         schedulers.Dif3dInterface, kwargs)
            ]
Exemplo n.º 4
0
def collectInterfaceDescriptions(mod, cs):
    """
    Adapt old-style describeInterfaces to the new plugin interface

    Old describeInterfaces implementations would return an interface class and kwargs
    for adding to an operator. Now we expect an ORDER as well. This takes a module and
    case settings and staples the module's ORDER attribute to the tuple and checks to
    make sure that a None is replaced by an empty list.
    """
    from armi import interfaces

    val = mod.describeInterfaces(cs)

    if val is None:
        return []
    if isinstance(val, list):
        return [
            interfaces.InterfaceInfo(mod.ORDER, klass, kwargs) for klass, kwargs in val
        ]

    klass, kwargs = val
    return [interfaces.InterfaceInfo(mod.ORDER, klass, kwargs)]
Exemplo n.º 5
0
    def exposeInterfaces(cs):
        """
        Implementation of the exposeInterfaces plugin hookspec

        Notes
        -----
        The interface may import user input modules to customize the actual
        fuel management.
        """

        fuelHandlerNeedsToBeActive = cs["fuelHandlerName"] or (
            cs["eqDirect"]
            and cs["runType"].lower() == RunTypes.STANDARD.lower())
        if not fuelHandlerNeedsToBeActive or "MCNP" in cs["neutronicsKernel"]:
            return []
        else:

            enabled = cs["runType"] != operators.RunTypes.SNAPSHOTS
            return [
                interfaces.InterfaceInfo(ORDER,
                                         fuelHandlers.FuelHandlerInterface,
                                         {"enabled": enabled})
            ]