예제 #1
0
    def run(self):
        """

        For disordered systems with relaxed atomic positions,
        it might be better to use initial atomic positions to use the
        symmetry of the structure (POSCAR_initial).
        """
        poscar = Poscar('POSCAR')
        number_of_atoms = poscar.get_atoms().get_number_of_atoms()
        dummy_symbols = self.create_dummy_symbols(number_of_atoms)
        poscar.get_atoms().set_chemical_symbols(dummy_symbols)
        poscar.write_poscar('POSCAR_ideal')
예제 #2
0
    def __init__(self,
                 spg_number,
                 mesh=None,
                 tmax=None,
                 is_sqs=False,
                 is_average_mass=False,
                 dim_sqs=None,
                 prior_primitive_axis=None,
                 band_points=None,
                 poscar_name="POSCAR",
                 magmom_line=None,
                 mode_mean_masses="a",
                 is_primitive=False,
                 is_fct=False,
                 is_bcm=False,
                 variables=None,
                 nac=None):
        if variables is None:
            self._dos_input = {
                "f_min": -10.0,  # THz
                "f_max": 15.0,  # THz
                "d_freq": 0.01,  # THz
                "sigma": 0.1,  # THz
            }
        else:
            self._dos_input = variables

        if mesh is None:
            mesh = [1, 1, 1]
        if dim_sqs is None:
            dim_sqs = [1, 1, 1]

        self._dictionary = {}
        self._poscar = Poscar(poscar_name)
        self._mesh = mesh
        self._tmax = tmax
        self._band_points = band_points

        self._spg_number = spg_number
        self._is_sqs = is_sqs
        self._is_average_mass = is_average_mass
        self._dim_sqs = dim_sqs
        self._is_primitive = is_primitive
        self._is_fct = is_fct
        self._is_bcm = is_bcm
        self._prior_primitive_axis = prior_primitive_axis
        self._mode_mean_masses = mode_mean_masses
        self._magmom_line = magmom_line
        self._nac = nac

        self._dim = get_dim('writefc.conf')
예제 #3
0
def create_randomized_configurations(mapfile,
                                     infile,
                                     random_seed,
                                     numconf,
                                     is_sorted):
    """

    Parameters
    ----------
    mapfile : String
        Input file including mapping information.
    infile : String
        POSCAR filename.
    """
    import json
    from vasp.poscar import Poscar
    from collections import OrderedDict

    atoms = Poscar(infile).get_atoms()

    with open(mapfile, "r") as f:
        map_s2s = json.load(f, object_pairs_hook=OrderedDict)

    order = create_order_of_symbols(map_s2s)

    configuration_randomizer = ConfigurationRandomizer(
        atoms=atoms,
        map_s2s=map_s2s,
        random_seed=random_seed,
    )

    for i in range(numconf):
        atoms = configuration_randomizer.create_randomized_configuration()
        filename = "RPOSCAR-{}".format(i + 1)
        poscar = Poscar().set_atoms(atoms)
        if is_sorted:
            poscar.sort_by_symbols(order=order)
        poscar.write(filename)
예제 #4
0
    def create_spg_number(self):
        """
        
        spg_number is used to determine the primitive axis and band paths.
        """
        if self._poscar_average_filename is not None:
            poscar_filename = self._poscar_average_filename
        else:
            poscar_filename = self._poscar_filename
        print('SPG number is searched from {}'.format(poscar_filename))

        spg_number = Poscar(poscar_filename).get_symmetry_dataset()["number"]
        print("spg_number:", spg_number)
        return spg_number
예제 #5
0
 def write_cell_enlarged_ideal(self, filename):
     poscar = Poscar()
     poscar.set_atoms(self._enlarged_cell_average)
     poscar.write(filename)
예제 #6
0
 def write_cell_enlarged(self, filename):
     poscar = Poscar()
     poscar.set_atoms(self._enlarged_cell)
     poscar.write(filename)
예제 #7
0
 def __init__(self,
              poscar_filename="POSCAR",
              fc_filename="FORCE_CONSTANTS"):
     self._poscar = Poscar(poscar_filename)
     self._force_constants = parse_FORCE_CONSTANTS(fc_filename)
     self._fc_reduced = None