예제 #1
0
    def setUp(self):
        self.cell = Cell(
            Basis.triclinic((2.5 * angstrom, 2.5 * angstrom, 10 * angstrom),
                            (0, 0, .5)),
            (
                (1. / 3, 1. / 3, .5),
                (2. / 3, 2. / 3, .5),
            ),
            ['C'] * 2,
        ).repeated(2, 2, 2)

        self.cell2 = Cell(
            Basis.triclinic(
                (3.9 * angstrom / 2, 3.9 * angstrom / 2, 3.9 * angstrom / 2),
                (.5, .5, .5)),
            (0, 0, 0),
            ['Si'],
        )
예제 #2
0
    def setUp(self):
        self.cell = Cell(
            Basis.triclinic((2.5 * angstrom, 2.5 * angstrom, 10 * angstrom), (0, 0, .5)),
            (
                (1. / 3, 1. / 3, .5),
                (2. / 3, 2. / 3, .5),
            ),
            ['C'] * 2,
        )

        coords = (numpy.linspace(0, 1, 11, endpoint=False), numpy.linspace(0, 1, 13, endpoint=False),
                  numpy.linspace(0, 1, 17, endpoint=False))

        self.grid = Grid(
            self.cell,
            coords,
            numpy.zeros((11, 13, 17)),
        )
        self.grid = self.grid.copy(values=numpy.prod(numpy.sin(self.grid.explicit_coordinates * 2 * numpy.pi), axis=-1))