def slots(self, model):
        """ The input/output slots for this instance.

        The input slots consist of one float per dimension in the
        simulation. The output slots consist of one float per dimension,
        to store the output position (either the same as the trial, or
        the optimised value) plus the value of the potential at that
        position.

        Parameters
        ----------
        model: :obj:`EggboxPESDataSourceModel`
            the model containing the parameters of the PES.

        Returns
        -------
        A tuple containing a tuple for the input slots, and a tuple for
        the output slots.

        """
        return (
            #: 1 input slot per dimension
            tuple(
                Slot(type=model.cuba_design_space_type,
                     description='element {} of trial vector'.format(i))
                for i in range(model.dimension)),
            #: 1 output slot per dimension + 1 for the value of the potential
            tuple([
                Slot(type=model.cuba_design_space_type,
                     description='element {} of result'.format(i))
                for i in range(model.dimension)
            ] + [
                Slot(type=model.cuba_potential_type,
                     description='value of potential at miminum')
            ]))
    def slots(self, model):

        input_slots = (Slot(description=f"Chemical formulation data",
                            type="FORMULATION"), )

        output_slots = (Slot(description=f"Formulation viscosity",
                             type="VISCOSITY"), )

        return (input_slots, output_slots)
    def slots(self, model):

        return (
            (Slot(description="Simulation results", type="RESULTS"), ),
            (Slot(
                description="Calculated viscosity of surfactant",
                type="VISCOSITY",
            ), ),
        )
Beispiel #4
0
    def slots(self, model):

        input_slots = tuple(
            Slot(description=f"Molecule {index + 1} data", type="MOLECULE")
            for index in range(model.n_molecule_types))

        output_slots = (Slot(description="Gromacs trajectory path",
                             type="TRAJECTORY"), )

        return (input_slots, output_slots)
 def slots(self, model):
     if model.conc_input == 'Parameter':
         input_slots = (Slot(
             type="CONCENTRATION",
             description=f"Concentration by weight (%)",
         ), )
     else:
         input_slots = tuple()
     return (
         input_slots,
         (Slot(type="CHEMICAL", description="Chemical data object"), ),
     )
Beispiel #6
0
    def slots(self, model):

        return (
            (Slot(description="PU foam formulation", type="FORMULATION"), ),
            (
                Slot(description="Cost of experiment", type="COST"),
                Slot(
                    description="Is cost lower than threshold requirement?",
                    type="PASS",
                ),
            ),
        )
    def slots(self, model):

        input_slots = tuple(
                Slot(description=f"Molecular fragment {index + 1} data",
                     type="FRAGMENT") for index in range(model.n_fragments)
            )

        return (
            input_slots,
            (
                Slot(description=f"Molecule for a simulation",
                     type="MOLECULE"),
            )
        )
    def slots(self, model):

        input_slots = tuple()

        for index in range(model.n_chemicals):
            input_slots += (
                Slot(description="Chemical {} data".format(index + 1),
                     type="CHEMICAL"),
            )

        return (
            input_slots,
            (Slot(description="PU foam formulation", type="FORMULATION"),),
        )
    def slots(self, model):

        return (
            (
                Slot(
                    type="SIMULATION_OUTPUT",
                    description="Simulation output",
                ),
                Slot(
                    type="MESH",
                    description="Simulation domain",
                ),
            ),
            (
                Slot(
                    type="FOAM_BSD",
                    description="PU foam bubble size distribution",
                ),
                Slot(
                    type="FILLING_FRACTION",
                    description="PU foam filling fraction trajectory",
                ),
                Slot(
                    type="OVERPACKING_FRACTION",
                    description="PU foam overpacking fraction",
                ),
                Slot(
                    type="FOAM_VISCOSITY",
                    description="PU foam viscosity",
                ),
                Slot(
                    type="FOAM_DENSITY",
                    description="PU foam density",
                ),
                Slot(
                    type="FOAM_THERM_COND",
                    description="PU foam thermal conductivity",
                ),
                Slot(
                    type="FOAM_HEIGHT",
                    description="Height profile of PU foam as time series",
                ),
                Slot(
                    type="FOAM_TEMPERATURE",
                    description="Temperature profile of PU foam as "
                    "time series",
                ),
            ),
        )
    def slots(self, model):

        input_slots = tuple()
        if model.input_mode == 'Parameter':
            input_slots += (Slot(
                description=f"Ingredient name",
                type="NAME"),)

        return (
            input_slots,
            (
                Slot(description=f"Ingredient data",
                     type="INGREDIENT"),
            )
        )
Beispiel #11
0
    def slots(self, model):

        return (
            (
                Slot(description="Chemical formulation data",
                     type="FORMULATION"),
                Slot(description="Simulation trajectory file",
                     type="TRAJECTORY"),
            ),
            (Slot(
                description="Calculated micelle aggregation number"
                " of surfactant",
                type="AGGREGATION",
            ), ),
        )
 def slots(self, model):
     return ((), (
         Slot(type="ARRHENIUS_NU",
              description="Arrhenius nu parameter "
              "for the main reaction"),
         Slot(type="ARRHENIUS_DELTA_H",
              description="Arrhenius delta H parameter "
              "for the main reaction"),
         Slot(type="ARRHENIUS_NU",
              description="Arrhenius nu parameter "
              "for the secondary reaction"),
         Slot(type="ARRHENIUS_DELTA_H",
              description="Arrhenius delta H parameter "
              "for the secondary reaction"),
     ))
    def slots(self, model):
        """ These slots are placeholders and need to be updated"""
        chemical_slots = (Slot(
            description="PU formulation for a simulation",
            type="FORMULATION",
        ), )

        reaction_parameter_slots = (
            Slot(description="Gelling reaction parameters", type="REACTION"),
            Slot(description="Blowing reaction parameters", type="REACTION"),
        )

        mesh_slot = (Slot(description="Simulation domain", type="MESH"), )

        if model.input_method == 'Parameter':
            if model.use_mass:
                mesh_slot += (Slot(description="Initial foam mass",
                                   type="MASS"), )
            else:
                mesh_slot += (Slot(description="Initial foam filling fraction",
                                   type="FILLING_FRACTION"), )

        return (
            chemical_slots + reaction_parameter_slots + mesh_slot,
            (Slot(
                description="Simulation output data",
                type="SIMULATION_OUTPUT",
            ), ),
        )
Beispiel #14
0
    def slots(self, model):

        if model.input_method == 'Parameter':
            input_slots = (
                Slot(type='VECTOR',
                     description='Vector of Gelling reaction parameters'),
                Slot(type='VECTOR',
                     description='Vector of Blowing reaction parameters'),
            )
        else:
            input_slots = tuple()

        return (input_slots, (Slot(type="REACTION",
                                   description="Parameters "
                                   "for the gelling reaction"),
                              Slot(type="REACTION",
                                   description="Parameters "
                                   "for the blowing reaction")))
 def slots(self, model):
     return (
         (
             Slot(
                 description="Temperature",
                 type="TEMPERATURE"
             ),
             Slot(
                 description="Reaction time",
                 type="TIME"
             ),
         ),
         (
             Slot(description="Cost of the process",
                  type="COST"),
             Slot(description="Gradient of the cost of the process",
                  type="COST_GRADIENT"),
         )
     )
    def slots(self, model):
        """Overloads method on parent class to provide Ingredient
        objects as input slots"""

        _, output_slots = super(SurfactantSimulationDataSource,
                                self).slots(model)

        input_slots = (Slot(description=f"Chemical formulation data",
                            type="FORMULATION"), )

        return (input_slots, output_slots)
    def slots(self, model):
        """ These slots are placeholders and need to be updated"""
        chemical_slots = (Slot(
            description="PU formulation for a simulation",
            type="FORMULATION",
        ), )

        reaction_parameter_slots = (
            Slot(description="Gelling reaction parameters", type="REACTION"),
            Slot(description="Blowing reaction parameters", type="REACTION"),
        )

        mesh_slot = (Slot(description="Simulation domain", type="MESH"), )

        return (
            chemical_slots + reaction_parameter_slots + mesh_slot,
            (Slot(
                description="Simulation output data",
                type="SIMULATION_OUTPUT",
            ), ),
        )
Beispiel #18
0
 def slots(self, model):
     return (
         (
             (
                 Slot(type="METER", description="ray")
             ),
             (
                 Slot(type="METER", description="heigth")
             )
         ),
         (
             (
                 Slot(type="S", description="Lateral surface")
             ),
             (
                 Slot(type="T", description="Cone surface")
             ),
             (
                 Slot(type="V", description="Volume")
             )
         )
     )
Beispiel #19
0
    def slots(self, model):
        all_slots = super(IngredientDataSource, self).slots(model)

        input_slots = all_slots[0]

        return (
            input_slots,
            (
                Slot(
                    description=f"{model.role} ingredient for a simulation",
                    type="INGREDIENT",
                ),
            ),
        )
Beispiel #20
0
 def slots(self, model):
     return ((
         Slot(description="Volume of contaminated A", type="VOLUME"),
         Slot(description="Concentration of contaminant",
              type="CONCENTRATION"),
         Slot(description="Reactor Volume", type="VOLUME"),
         Slot(description="Density of contaminant", type="DENSITY"),
     ), (
         Slot(description="Material cost", type="COST"),
         Slot(description="Material cost gradient", type="COST_GRADIENT"),
     ))
Beispiel #21
0
    def slots(self, model):

        input_slots = tuple()

        for index in range(model.n_surfactants):
            input_slots += (
                Slot(description=f"Surfactant {index + 1} data",
                     type="INGREDIENT"),
                Slot(description=f"Surfactant {index + 1} concentration",
                     type="CONCENTRATION"))

        input_slots += (Slot(description=f"Salt data", type="INGREDIENT"),
                        Slot(description=f"Salt concentration",
                             type="CONCENTRATION"),
                        Slot(description=f"Solvent data", type="INGREDIENT"))

        return (input_slots, (Slot(description=f"Chemical formulation",
                                   type="FORMULATION"), ))
    def slots(self, model):

        input_slots = (
            Slot(
                type="FOAM_HEIGHT",
                description="Simulated height profile of PU foam as "
                            "time series",
            ),
            Slot(
                type="FOAM_TEMPERATURE",
                description="Simulated temperature profile of PU foam as "
                            "time series",
            ),
        )

        if model.input_method == 'Parameter':
            input_slots += (
                Slot(
                    type="FOAM_HEIGHT",
                    description="Reference height profile of PU foam as "
                                "time series",
                ),
                Slot(
                    type="FOAM_TEMPERATURE",
                    description="Reference temperature profile of PU foam as "
                                "time series",
                )
            )

        return (
            input_slots,
            (
                Slot(
                    type="RESIDUALS",
                    description="Residuals from height "
                                "reference data"
                ),
                Slot(
                    type="RESIDUALS",
                    description="Residuals from temperature "
                                "reference data"
                ),
            ),
        )
 def slots(self, model):
     return ((),
             (Slot(type="FRAGMENT",
                   description="Gromacs GromacsFragment data object"), ))
 def slots(self, model):
     return ((Slot(description=f"Chemical formulation data",
                   type="FORMULATION"), ),
             (Slot(description="Cost of simulation", type="COST"), ))
 def slots(self, model):
     return ((), (
         Slot(type="DENSITY", description="A pure density"),
         Slot(type="DENSITY", description="B pure density"),
         Slot(type="DENSITY", description="C pure density"),
     ))
Beispiel #26
0
 def slots(self, model):
     return ((
         Slot(description="x", type="COORDINATE"),
         Slot(description="y", type="COORDINATE"),
     ), (Slot(description="a", type="AMPLITUDE"), ))
Beispiel #27
0
 def slots(self, model):
     return ((
         Slot(description="V_A_tilde", type="VOLUME"),
         Slot(description="C_e concentration", type="CONCENTRATION"),
         Slot(description="Temperature", type="TEMPERATURE"),
         Slot(description="Reaction time", type="TIME"),
         Slot(description="Arrhenius nu main reaction",
              type="ARRHENIUS_NU"),
         Slot(description="Arrhenius delta H main reaction",
              type="ARRHENIUS_DELTA_H"),
         Slot(description="Arrhenius nu secondary reaction",
              type="ARRHENIUS_NU"),
         Slot(description="Arrhenius delta H secondary reaction",
              type="ARRHENIUS_DELTA_H"),
         Slot(description="Reactor volume", type="VOLUME"),
         Slot(description="A pure density", type="DENSITY"),
         Slot(description="B pure density", type="DENSITY"),
         Slot(description="C pure density", type="DENSITY"),
     ), (Slot(description="Impurity concentration", type="CONCENTRATION"),
         Slot(description="Impurity concentration gradient",
              type="CONCENTRATION_GRADIENT")))
 def slots(self, model):
     return ((), (Slot(type="MESH", description="OpenFOAM Domain mesh"), ))
Beispiel #29
0
 def slots(self, model):
     return ((Slot(type=model.cuba_type_in), ),
             (Slot(type=model.cuba_type_out), ))