示例#1
0
 def set_base_name(self, set_dir, base_job_name):
     if set_dir is not None:
         self.setting_dir = set_dir
     else:
         self.setting_dir = os.path.join(platform_id.setting_dir(),
                                         "job_scripts")
     self.base_job_name = base_job_name
     self.base_name = os.path.join(self.setting_dir, self.base_job_name)
示例#2
0
def remove_O2(vaspRundictList, nb_sites=1, redundancy=None):
    """    for each structure given in argument,
    remove the most oxidized oxygen
    and create a VASP input folder in the job folder
    option for redundancy to generate a larger supercell"""

    if redundancy is None:
        if input("redundancy ? Y/N")[0] == "Y":
            redundancy = True
        else:
            redundancy = False

    folder_list = []

    for run in vaspRundictList:
        parent_path = os.path.join(run.job_folder, "O_deficient")
        print("removing O from {}".format(run.str_id))

        for O_index in labile_O_indices(run, nb_sites):
            print("removed O index : {}".format(O_index))
            job = launch.Job.from_rundict(run)
            job.structure.remove_sites([O_index])
            job.entry_id = "{}_rem_O{}".format(job.entry_id, O_index)
            folder_list.append(
                job.set_job_folder(parent_path, explicit_jobpath=False))
            job.write_data_input()

            if redundancy:
                job = launch.Job.from_rundict(run)
                job.structure.make_supercell([1, 2, 1])
                job.entry_id = "{}_big".format(job.entry_id)
                folder_list.append(
                    job.set_job_folder(parent_path, explicit_jobpath=False))
                job.write_data_input()

    for folder in folder_list:
        setting_dir = platform_id.setting_dir()
        job_file_name = os.path.join(setting_dir, "job_scripts",
                                     "vasp_job_double")
        name = "degaz_{}".format(abs(hash(folder)))
        job_string = 'sbatch -J {} --workdir {}  {}'.format(
            name, folder, job_file_name)
        if input("LAUNCH the following [Y/n] :\n{}\n".format(
                job_string)) == "Y":
            subprocess.call([job_string], shell=True)

    return folder_list
示例#3
0
# from pymatgen.io.vasp.outputs import Oszicar  # Outcar
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer

import rw_utils.platform_id as platform_id

import structure_analysis.structure_geometry_utils as cluster

import electronic_analysis.read_mag_props as nupdown

global PARAM

# DICT of parameters to set to true or false.
PARAM = {}

PARAM['logFile'] = True  # wether to print a log file of the results
PARAM['mainFolder'] = platform_id.setting_dir()
PARAM['verbose'] = 0

# DATA COLLECTION FUNCTIONS
# =========================================


def get_job_list(init_dir, file_system_choice=None):
    print("\n {} \n ".format(init_dir))
    if file_system_choice is None:
        file_system_choice = input(
            "[j]ob / [p]roject / [s]uper_project ?  :  ")

    if file_system_choice[0] == "p":
        # file_system = "p"
        subdir_list = [
示例#4
0
        NELM = 100
        NSW = 0

    b – Lancer un calcul non – colinéaire avec VASP
        /home/sol/Vasp/Vasp5/vasp.5.3.5-openmpi-nc/vasp
    b1 – kill the job

    c-  if IBZKPT generated :
        Fichier IBZKPT est écrit
        (SI le Fichier KPOINT n’a pas déja la forme voulue !!)
        Cp IBZPKT KPOINTS

    Le fichier IBZKPTS doit contenir les points K, et la dernière colonne,
    correspondant à la multiplicité des points K doit être égale a 1.
"""
settingDir = platform_id.setting_dir()


def generate_IBZKPT(folder):

    shutil.copy2('INCAR', 'OLD_INCAR')
    incar = Incar.from_file("INCAR")
    os.remove("INCAR")

    print("old incar \n", incar)
    incar["ISPIN"] = 1  # spin less calculation
    incar.pop("MAGMOM", None)  # we don't need that anymore !
    incar["ISMEAR"] = 0  # No smearing
    incar["LSORBIT"] = "TRUE"  # Non colinear calculation
    incar["NSW"] = 0  # single point
    incar["ISYM"] = 0  # no symmetry for kpts
示例#5
0
import electronic_analysis.read_dos as DOS
import electronic_analysis.read_hull as hull
import electronic_analysis.read_mag_props as nupdown
import electronic_analysis.readO2 as O2
import electronic_analysis.rundict_utils as read

import structure_analysis.bailar_twist as bailar

import filtering_runs.filter_runs as filter_runs
import rw_utils.generic_plot as generic_plot
import rw_utils.platform_id as platform_id

print(matplotlib.get_backend())
print(sys.version)

SETTING_DIR = platform_id.setting_dir()


def filter_loop(run_list_all, input_graph_type=None, allow_filtering=True):
    """
    outer loop to select (and change) the dataset
    before entering the plot loop (with a fixed dataset)
    """

    continue_filter_loop = True

    while continue_filter_loop:
        x_coord = filter_runs.select_x_coord()
        if allow_filtering:
            restricted_runs = filter_runs.restrict_run_list(
                run_list_all, x_coord)