Esempio n. 1
0
    def fetch(self):
        """Creates a motion calculator object.

        Returns:
           An ensemble object of the appropriate mode and with the appropriate
           objects given the attributes of the InputEnsemble object.
        """

        super(InputMotionBase, self).fetch()

        if self.mode.fetch() == "replay":
            sc = Replay(fixcom=self.fixcom.fetch(), fixatoms=self.fixatoms.fetch(), intraj=self.file.fetch())
        elif self.mode.fetch() == "minimize":
            sc = GeopMotion(fixcom=self.fixcom.fetch(), fixatoms=self.fixatoms.fetch(), **self.optimizer.fetch())
        elif self.mode.fetch() == "neb":
            sc = NEBMover(fixcom=self.fixcom.fetch(), fixatoms=self.fixatoms.fetch(), **self.neb_optimizer.fetch())
        elif self.mode.fetch() == "dynamics":
            sc = Dynamics(fixcom=self.fixcom.fetch(), fixatoms=self.fixatoms.fetch(), **self.dynamics.fetch())
        elif self.mode.fetch() == "vibrations":
            sc = DynMatrixMover(fixcom=self.fixcom.fetch(), fixatoms=self.fixatoms.fetch(), **self.vibrations.fetch())
        elif self.mode.fetch() == "alchemy":
            sc = AlchemyMC(fixcom=self.fixcom.fetch(), fixatoms=self.fixatoms.fetch(), **self.alchemy.fetch())
        elif self.mode.fetch() == "instanton":
            sc = InstantonMotion(fixcom=self.fixcom.fetch(), fixatoms=self.fixatoms.fetch(), **self.instanton.fetch())
        elif self.mode.fetch() == "t_ramp":
            sc = TemperatureRamp(**self.t_ramp.fetch())
        elif self.mode.fetch() == "p_ramp":
            sc = PressureRamp(**self.p_ramp.fetch())
        else:
            sc = Motion()
            # raise ValueError("'" + self.mode.fetch() + "' is not a supported motion calculation mode.")

        return sc
Esempio n. 2
0
    def fetch(self):
        """Creates a motion calculator object.

        Returns:
           An ensemble object of the appropriate mode and with the appropriate
           objects given the attributes of the InputEnsemble object.
        """

        super(InputMotionBase, self).fetch()

        if self.mode.fetch() == "replay":
            sc = Replay(
                fixcom=self.fixcom.fetch(),
                fixatoms=self.fixatoms.fetch(),
                intraj=self.file.fetch(),
            )
        elif self.mode.fetch() == "minimize":
            sc = GeopMotion(fixcom=self.fixcom.fetch(),
                            fixatoms=self.fixatoms.fetch(),
                            **self.optimizer.fetch())
        elif self.mode.fetch() == "neb":

            raise ValueError(
                "The nudged elastic band calculation has been temporarily disabled until further bug-fixes."
            )
        #            sc = NEBMover(
        #                fixcom=self.fixcom.fetch(),
        #                fixatoms=self.fixatoms.fetch(),
        #                **self.neb_optimizer.fetch()
        #            )
        elif self.mode.fetch() == "dynamics":
            sc = Dynamics(fixcom=self.fixcom.fetch(),
                          fixatoms=self.fixatoms.fetch(),
                          **self.dynamics.fetch())
        elif self.mode.fetch() == "constrained_dynamics":
            sc = ConstrainedDynamics(fixcom=self.fixcom.fetch(),
                                     fixatoms=self.fixatoms.fetch(),
                                     **self.constrained_dynamics.fetch())
        elif self.mode.fetch() == "vibrations":
            sc = DynMatrixMover(fixcom=self.fixcom.fetch(),
                                fixatoms=self.fixatoms.fetch(),
                                **self.vibrations.fetch())
        elif self.mode.fetch() == "normalmodes":
            sc = NormalModeMover(fixcom=self.fixcom.fetch(),
                                 fixatoms=self.fixatoms.fetch(),
                                 **self.normalmodes.fetch())
        elif self.mode.fetch() == "scp":
            sc = SCPhononsMover(fixcom=self.fixcom.fetch(),
                                fixatoms=self.fixatoms.fetch(),
                                **self.scp.fetch())
        elif self.mode.fetch() == "alchemy":
            sc = AlchemyMC(fixcom=self.fixcom.fetch(),
                           fixatoms=self.fixatoms.fetch(),
                           **self.alchemy.fetch())
        elif self.mode.fetch() == "atomswap":
            sc = AtomSwap(fixcom=self.fixcom.fetch(),
                          fixatoms=self.fixatoms.fetch(),
                          **self.atomswap.fetch())
        elif self.mode.fetch() == "instanton":
            sc = InstantonMotion(fixcom=self.fixcom.fetch(),
                                 fixatoms=self.fixatoms.fetch(),
                                 **self.instanton.fetch())
        elif self.mode.fetch() == "planetary":
            sc = Planetary(fixcom=self.fixcom.fetch(),
                           fixatoms=self.fixatoms.fetch(),
                           **self.planetary.fetch())
        elif self.mode.fetch() == "t_ramp":
            sc = TemperatureRamp(**self.t_ramp.fetch())
        elif self.mode.fetch() == "p_ramp":
            sc = PressureRamp(**self.p_ramp.fetch())
        elif self.mode.fetch() == "al-kmc":
            sc = AlKMC(fixcom=self.fixcom.fetch(),
                       fixatoms=self.fixatoms.fetch(),
                       **self.al6xxx_kmc.fetch())
        else:
            sc = Motion()
            # raise ValueError("'" + self.mode.fetch() + "' is not a supported motion calculation mode.")

        return sc