Exemplo n.º 1
0
class System:
    cell_neighbour_list = None

    # Test Positions are same dimension

    def __init__(self, particles, parameters):
        self.particles = particles
        self.energy = Energy()

        particle_positions = self.get_particle_position_array()

        self.neighbourlist = Neighbourlist(particles=particle_positions,
                                           Box=parameters.box,
                                           rc=parameters.cutoff_radius)

        if System.cell_neighbour_list is None:
            System.cell_neighbour_list = self.neighbourlist.calc_cell_neighbours(
            )

    def get_particle_position_array(self):

        x = []
        for i in range(len(self.particles)):
            x.append(self.particles[i].position)
        y = np.array(x)

        return y
Exemplo n.º 2
0
class System:
    cell_neighbour_list = None

    def __init__(self, particles, parameters):
        self.particles = particles
        self.energy = Energy()
        self.k_vectors = [1, 1, 1]

        x = []
        for i in range(len(particles)):
            x.append(particles[i].position)
        y = np.array(x)

        self.neighbourlist = Neighbourlist(particles=y,
                                           Box=parameters.box,
                                           rc=parameters.cutoff_radius)

        if System.cell_neighbour_list is None:
            System.cell_neighbour_list = self.neighbourlist.calc_cell_neighbours(
            )