Exemple #1
0
    def from_cube(cls, filename, spin='total'):
        """
        Read real space density to CUBE file ``filename``.
        Return new :class:`Density` instance.
        """
        if spin != 'total':
            raise ValueError('Argument "spin" should be "total"')

        structure, mesh, datar = cube.cube_read_structure_mesh_data(file=filename)
        return cls(nspinor=1, nsppol=1, nspden=1, datar=datar, structure=structure, iorder="c")
Exemple #2
0
 def __init__(self, filepath):
     from abipy.iotools.cube import cube_read_structure_mesh_data
     super(CubeFile, self).__init__(filepath)
     self.structure, self.mesh, self.data = cube_read_structure_mesh_data(
         self.filepath)
Exemple #3
0
 def from_cube(cls, filename, spin='total'):
     if spin != 'total':
         raise ValueError('Argument "spin" should be "total"')
     structure, mesh, data = cube.cube_read_structure_mesh_data(file=filename)
     return cls(nspinor=1, nsppol=1, nspden=1, rhor=data, structure=structure, iorder="c")
Exemple #4
0
 def from_cube(cls, filename, spin='total'):
     if spin != 'total':
         raise ValueError('Argument "spin" should be "total"')
     structure, mesh, data = cube.cube_read_structure_mesh_data(file=filename)
     return cls(nspinor=1, nsppol=1, nspden=1, rhor=data, structure=structure, iorder="c")
Exemple #5
0
 def __init__(self, filepath):
     from abipy.iotools.cube import cube_read_structure_mesh_data
     super(CubeFile, self).__init__(filepath)
     self.structure, self.mesh, self.data = cube_read_structure_mesh_data(self.filepath)