def __init__(self, atoms = [], lattice = None, filename = None, qeInput = None):
        """
        atoms        -- list of QEAtom atom instances or a QEStructure object
        lattice      -- QELattice object
        filename     -- filename QE input file 
        qeInput      -- pointer to a PWInput parsing object. If not None, 
                        its PWInput.structure and PWInput.structure.lattice 
                        will be  reset to the current instance of the structure       
        """
          
        Structure.__init__(self) 
        self.formatString = '%# .8f %# .8f %# .8f'
        self._atomicPositionsType = 'crystal'
        self._qeInput = qeInput
        self.lattice = QELattice()
        self.lattice._qeInput = self._qeInput
           
        if lattice != None:

            if self.lattice._qeInput != None:            
                self._qeInput = self.lattice._qeInput
            else:
               self.lattice._qeInput = self._qeInput              
                       
            self.lattice = QELattice( lattice = lattice )
                      
           
        # CP and PW inputs are compatible
        from pwinput import PWInput
        from cpinput import CPInput        
        if isinstance( atoms, PWInput) or isinstance( atoms, CPInput):
            qeInput = atoms        
        elif isinstance( atoms, QEStructure):
            stru = atoms                
            self.__dict__.update( stru.__dict__ )            
            # deep copy of the lattice will deep copy PWInput as well
            self.lattice = QELattice(lattice = stru.lattice)            
            self._qeInput = self.lattice._qeInput                
            self[:] = stru
        else:
            if self.lattice == None:
                raise "Lattice must be provided"                            
            self[:] = atoms
        
        if filename != None:        
            qeInput = PWInput(filename = filename)
            qeInput.parse()
            self.parseInput(qeInput)            
        
        if qeInput != None:            
            self.lattice._qeInput = qeInput
            self._qeInput = qeInput
        
        if self.lattice._qeInput != None:
            self.lattice._qeInput.structure = self
            self.lattice._qeInput.structure.lattice = self.lattice
            
        return
Exemple #2
0
    def __init__(self, atoms=[], lattice=None, filename=None, qeInput=None):
        """
        atoms        -- list of QEAtom atom instances or a QEStructure object
        lattice      -- QELattice object
        filename     -- filename QE input file 
        qeInput      -- pointer to a PWInput parsing object. If not None, 
                        its PWInput.structure and PWInput.structure.lattice 
                        will be  reset to the current instance of the structure       
        """

        Structure.__init__(self)
        self.formatString = '%# .8f %# .8f %# .8f'
        self._atomicPositionsType = 'crystal'
        self._qeInput = qeInput
        self.lattice = QELattice()
        self.lattice._qeInput = self._qeInput

        if lattice != None:

            if self.lattice._qeInput != None:
                self._qeInput = self.lattice._qeInput
            else:
                self.lattice._qeInput = self._qeInput

            self.lattice = QELattice(lattice=lattice)

        # CP and PW inputs are compatible
        from pwinput import PWInput
        from cpinput import CPInput
        if isinstance(atoms, PWInput) or isinstance(atoms, CPInput):
            qeInput = atoms
        elif isinstance(atoms, QEStructure):
            stru = atoms
            self.__dict__.update(stru.__dict__)
            # deep copy of the lattice will deep copy PWInput as well
            self.lattice = QELattice(lattice=stru.lattice)
            self._qeInput = self.lattice._qeInput
            self[:] = stru
        else:
            if self.lattice == None:
                raise "Lattice must be provided"
            self[:] = atoms

        if filename != None:
            qeInput = PWInput(filename=filename)
            qeInput.parse()
            self.parseInput(qeInput)

        if qeInput != None:
            self.lattice._qeInput = qeInput
            self._qeInput = qeInput

        if self.lattice._qeInput != None:
            self.lattice._qeInput.structure = self
            self.lattice._qeInput.structure.lattice = self.lattice

        return
 def __init__(self, *args, **kwargs):
     Structure.__init__(self, *args, **kwargs)
     self.bratoms = {
         'space'     : "p1",
         'rmax'      :  6.0,
         'core'      : None,
         'edge'      : 'K',
         'shift'     : None,
         'output'    : None,
         'nitrogen'  : None,
         'argon'     : None,
         'krypton'   : None,
     }
     return
Exemple #4
0
 def __init__(self, *args, **kwargs):
     Structure.__init__(self, *args, **kwargs)
     self.bratoms = {
         'space'     : "p1",
         'rmax'      :  6.0,
         'core'      : None,
         'edge'      : 'K',
         'shift'     : None,
         'output'    : None,
         'nitrogen'  : None,
         'argon'     : None,
         'krypton'   : None,
     }
     return
Exemple #5
0
 def __init__(self, *args, **kwargs):
     self.pdffit = {
         'scale' : 1.0,
         'delta1' : 0.0,
         'delta2' : 0.0,
         'sratio' : 1.0,
         'rcut' : 0.0,
         'spcgr' : 'P1',
         'spdiameter' : 0.0,
         'stepcut' : 0.0,
         'dcell' : 6*[0.0],
         'ncell' : [1, 1, 1, 0],
     }
     Structure.__init__(self, *args, **kwargs)
     return