Example #1
0
    def __init__(self, group, nlist):

        # initialize the base class
        force._force.__init__(self)

        # create the c++ mirror class

        # PPPM itself doesn't really need a neighbor list, so subscribe call back as None
        self.nlist = nlist
        self.nlist.subscribe(lambda: None)
        self.nlist.update_rcut()

        if not hoomd.context.current.device.cpp_exec_conf.isCUDAEnabled():
            self.cpp_force = _md.PPPMForceCompute(
                hoomd.context.current.system_definition, self.nlist.cpp_nlist,
                group.cpp_group)
        else:
            self.cpp_force = _md.PPPMForceComputeGPU(
                hoomd.context.current.system_definition, self.nlist.cpp_nlist,
                group.cpp_group)

        hoomd.context.current.system.addCompute(self.cpp_force,
                                                self.force_name)

        # error check flag - must be set to true by set_params in order for the run() to commence
        self.params_set = False

        # initialize the short range part of electrostatics
        self.ewald = pair.ewald(r_cut=False, nlist=self.nlist)
Example #2
0
    def __init__(self, group, nlist):
        hoomd.util.print_status_line()

        # initialize the base class
        force._force.__init__(self)

        # register the citation
        c = hoomd.cite.article(
            cite_key='dnlebard2012',
            author=[
                'D N LeBard', 'B G Levine', 'S A Barr', 'A Jusufi',
                'S Sanders', 'M L Klein', 'A Z Panagiotopoulos'
            ],
            title=
            'Self-assembly of coarse-grained ionic surfactants accelerated by graphics processing units',
            journal='Journal of Computational Physics',
            volume=8,
            number=8,
            pages='2385-2397',
            month='',
            year='2012',
            doi='10.1039/c1sm06787g',
            feature='PPPM')
        hoomd.cite._ensure_global_bib().add(c)

        # create the c++ mirror class

        # PPPM itself doesn't really need a neighbor list, so subscribe call back as None
        self.nlist = nlist
        self.nlist.subscribe(lambda: None)
        self.nlist.update_rcut()

        if not hoomd.context.exec_conf.isCUDAEnabled():
            self.cpp_force = _md.PPPMForceCompute(
                hoomd.context.current.system_definition, self.nlist.cpp_nlist,
                group.cpp_group)
        else:
            self.cpp_force = _md.PPPMForceComputeGPU(
                hoomd.context.current.system_definition, self.nlist.cpp_nlist,
                group.cpp_group)

        hoomd.context.current.system.addCompute(self.cpp_force,
                                                self.force_name)

        # error check flag - must be set to true by set_params in order for the run() to commence
        self.params_set = False

        # initialize the short range part of electrostatics
        hoomd.util.quiet_status()
        self.ewald = pair.ewald(r_cut=False, nlist=self.nlist)
        hoomd.util.unquiet_status()