Example #1
0
def _perform_common_init_tasks():
    from hoomd_script import update
    from hoomd_script import group
    from hoomd_script import compute

    # create the sorter
    globals.sorter = update.sort()

    # create the default compute.thermo on the all group
    util._disable_status_lines = True
    all = group.all()
    compute._get_unique_thermo(group=all)
    util._disable_status_lines = False

    # set up Communicator, and register it with the System
    if hoomd.is_MPI_available():
        cpp_decomposition = globals.system_definition.getParticleData(
        ).getDomainDecomposition()
        if cpp_decomposition is not None:
            # create the c++ Communicator
            if not globals.exec_conf.isCUDAEnabled():
                cpp_communicator = hoomd.Communicator(
                    globals.system_definition, cpp_decomposition)
            else:
                cpp_communicator = hoomd.CommunicatorGPU(
                    globals.system_definition, cpp_decomposition)

            # set Communicator in C++ System
            globals.system.setCommunicator(cpp_communicator)
Example #2
0
def _perform_common_init_tasks():
    from hoomd_script import update
    from hoomd_script import group
    from hoomd_script import compute

    # create the sorter
    globals.sorter = update.sort()

    # create the default compute.thermo on the all group
    util._disable_status_lines = True
    all = group.all()
    compute._get_unique_thermo(group=all)
    util._disable_status_lines = False

    # set up Communicator, and register it with the System
    if hoomd.is_MPI_available():
        cpp_decomposition = globals.system_definition.getParticleData().getDomainDecomposition()
        if cpp_decomposition is not None:
            # create the c++ Communicator
            if not globals.exec_conf.isCUDAEnabled():
                cpp_communicator = hoomd.Communicator(globals.system_definition, cpp_decomposition)
            else:
                cpp_communicator = hoomd.CommunicatorGPU(globals.system_definition, cpp_decomposition)

            # set Communicator in C++ System
            globals.system.setCommunicator(cpp_communicator)
Example #3
0
def _perform_common_init_tasks():
    from hoomd_script import update;
    from hoomd_script import group;
    from hoomd_script import compute;

    # create the sorter, using the evil import __main__ trick to provide the user with a default variable
    import __main__;
    __main__.sorter = update.sort();
    
    # create the default compute.thermo on the all group
    util._disable_status_lines = True;
    all = group.all();
    compute._get_unique_thermo(group=all);
    util._disable_status_lines = False;

    # set up Communicator, and register it with the System 
    if hoomd.is_MPI_available():
        cpp_decomposition = globals.system_definition.getParticleData().getDomainDecomposition();
        if cpp_decomposition is not None:
            # create the c++ Communicator
            if not globals.exec_conf.isCUDAEnabled():
                cpp_communicator = hoomd.Communicator(globals.system_definition, cpp_decomposition)
            else:
                cpp_communicator = hoomd.CommunicatorGPU(globals.system_definition, cpp_decomposition)

            # set Communicator in C++ System
            globals.system.setCommunicator(cpp_communicator)
Example #4
0
    def __init__(self, T, period=1):
        util.print_status_line();

        # initialize base class
        _updater.__init__(self);

        # setup the variant inputs
        T = variant._setup_variant_input(T);

        # create the compute thermo
        thermo = compute._get_unique_thermo(group=globals.group_all);

        # create the c++ mirror class
        self.cpp_updater = hoomd.TempRescaleUpdater(globals.system_definition, thermo.cpp_compute, T.cpp_variant);
        self.setupUpdater(period);
Example #5
0
    def __init__(self, group, P, tau, bk, mode, dt, period=1):
        util.print_status_line();
    
        # initialize base class
        _updater.__init__(self);
        
		# setup the variant inputs
        P = variant._setup_variant_input(P);
		
        # create the compute thermo
        thermo_all = compute._get_unique_thermo(group=globals.group_all);
        
		# Get deltaT
        deltaT = dt;

        # initialize the reflected c++ class
        if not globals.exec_conf.isCUDAEnabled():
            if (mode == "isotropic"):
                cpp_mode = _custom_updaters.PressBerendsenUpdater.integrationMode.isotropic;
            elif (mode == "anisotropic"):
                cpp_mode = _custom_updaters.PressBerendsenUpdater.integrationMode.anisotropic;
            elif (mode == "semi-isotropic"):
                cpp_mode = _custom_updaters.PressBerendsenUpdater.integrationMode.semi_isotropic;
            elif (mode == "uniaxial"):
                cpp_mode = _custom_updaters.PressBerendsenUpdater.integrationMode.one_dimensional;
            else:
                print >> sys.stderr, "\n***Error! Invalid mode\n";
                raise RuntimeError("Error changing parameters in update.press_berendsen");
            self.cpp_updater = _custom_updaters.PressBerendsenUpdater(globals.system_definition, group.cpp_group, thermo_all.cpp_compute, tau, P.cpp_variant, bk, deltaT, cpp_mode);
        else:
            if (mode == "isotropic"):
                cpp_mode = _custom_updaters.PressBerendsenUpdaterGPU.integrationMode.isotropic;
            elif (mode == "anisotropic"):
                cpp_mode = _custom_updaters.PressBerendsenUpdaterGPU.integrationMode.anisotropic;
            elif (mode == "semi-isotropic"):
                cpp_mode = _custom_updaters.PressBerendsenUpdaterGPU.integrationMode.semi_isotropic;
            elif (mode == "uniaxial"):
                cpp_mode = _custom_updaters.PressBerendsenUpdaterGPU.integrationMode.one_dimensional;
            else:
                print >> sys.stderr, "\n***Error! Invalid mode\n";
                raise RuntimeError("Error changing parameters in update.press_berendsen");
            self.cpp_updater = _custom_updaters.PressBerendsenUpdaterGPU(globals.system_definition, group.cpp_group, thermo_all.cpp_compute, tau, P.cpp_variant, bk, deltaT, cpp_mode);
        self.setupUpdater(period);
Example #6
0
    def __init__(self, T, period=1):
        util.print_status_line()

        # Error out in MPI simulations
        if hoomd.is_MPI_available():
            if globals.system_definition.getParticleData().getDomainDecomposition():
                globals.msg.error("update.rescale_temp not supported in multi-processor simulations.\n\n")
                raise RuntimeError("Error setting up updater.")

        # initialize base class
        _updater.__init__(self)

        # setup the variant inputs
        T = variant._setup_variant_input(T)

        # create the compute thermo
        thermo = compute._get_unique_thermo(group=globals.group_all)

        # create the c++ mirror class
        self.cpp_updater = hoomd.TempRescaleUpdater(globals.system_definition, thermo.cpp_compute, T.cpp_variant)
        self.setupUpdater(period)
Example #7
0
    def __init__(self, T, period=1):
        util.print_status_line();

        # Error out in MPI simulations
        if (hoomd.is_MPI_available()):
            if globals.system_definition.getParticleData().getDomainDecomposition():
                globals.msg.error("update.rescale_temp not supported in multi-processor simulations.\n\n")
                raise RuntimeError("Error setting up updater.")
 
        # initialize base class
        _updater.__init__(self);
        
        # setup the variant inputs
        T = variant._setup_variant_input(T);
        
        # create the compute thermo
        thermo = compute._get_unique_thermo(group=globals.group_all);
        
        # create the c++ mirror class
        self.cpp_updater = hoomd.TempRescaleUpdater(globals.system_definition, thermo.cpp_compute, T.cpp_variant);
        self.setupUpdater(period);
Example #8
0
    def __init__(self, group, T, tau, dt, period=1):
        util.print_status_line();
    
        # initialize base class
        _updater.__init__(self);
        
		# setup the variant inputs
        T = variant._setup_variant_input(T);
		
        # create the compute thermo
        thermo = compute._get_unique_thermo(group = group);
		
		# Get deltaT
        deltaT = dt;

        # initialize the reflected c++ class
        if not globals.exec_conf.isCUDAEnabled():
            self.cpp_updater = _custom_updaters.TempBerendsenUpdater(globals.system_definition,group.cpp_group,thermo.cpp_compute,tau,T.cpp_variant,deltaT);
        else:
            self.cpp_updater = _custom_updaters.TempBerendsenUpdaterGPU(globals.system_definition,group.cpp_group,thermo.cpp_compute,tau,T.cpp_variant,deltaT);

        self.setupUpdater(period);
Example #9
0
    def __init__(self, T, period=1, phase=-1):
        util.print_status_line()

        # initialize base class
        _updater.__init__(self)

        # setup the variant inputs
        T = variant._setup_variant_input(T)

        # create the compute thermo
        thermo = compute._get_unique_thermo(group=globals.group_all)

        # create the c++ mirror class
        self.cpp_updater = hoomd.TempRescaleUpdater(globals.system_definition,
                                                    thermo.cpp_compute,
                                                    T.cpp_variant)
        self.setupUpdater(period, phase)

        # store metadta
        self.T = T
        self.period = period
        self.metadata_fields = ['T', 'period']