Beispiel #1
0
    def run_task(self, fw_spec):
        strain = self.get("strain", 0.0)
        user_incar_settings = self.get("user_incar_settings", {})

        struct = Structure.from_file("POSCAR")
        struct.apply_strain(strain)
        INCAR = Incar(user_incar_settings)

        struct.to(filename="POSCAR")
        INCAR.write_file("INCAR")
Beispiel #2
0
def write_incar(file_path, settings):
    """
    Generates VASP INCAR file for VASP calculation.

    **Args:

    workdir (str):
    input_settings (InputParameters):
    """

    #file_path = os.path.join(work_dir,"INCAR")
    incar = Incar().from_dict(settings)
    incar.write_file(file_path)
def replace_incar_tags(path, tag, value):
    incar = Incar().from_file(os.path.join(path, 'INCAR'))
    incar.__setitem__(tag, value)
    incar.write_file(os.path.join(path, 'INCAR'))
        "NKRED": 2,
        "PRECFOCK": "Fast",
        "AEXX": HF,
    }
    # creating Incar object
    incar = Incar(incar_dict)
    # calculations directory
    calc_dir = './HF_tuning/'
    # setting up destination directory
    file_dir = calc_dir + 'HF_' + str(HF) + '/'
    # checking if path already exists - if not create it
    if not os.path.exists(file_dir):
        os.makedirs(file_dir)

# writing INCAR in designated path
    incar.write_file(file_dir + 'INCAR')

    # KPOINTS file

    k = 6
    kpoints = Kpoints.gamma_automatic(kpts=(k, k, k), shift=(0.0, 0.0, 0.0))
    kpoints.write_file(file_dir + 'KPOINTS')

    # setting up job_vasp.sh script
    new_job_vasp_file = open(file_dir + 'job_vasp.sh', 'w')

    import re
    with open('./job_vasp.sh') as origin_file:
        # searching lines in input file
        for line in origin_file:
            # emulating 'grep' command