Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'user_incar_settings': user_incar_settings}))
t.append(WriteNormalmodeDisplacedPoscar(mode=mode,
displacement=displacement))
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd))
key = "{}_{}".format(mode, displacement).replace('-', 'm').replace('.',
'd')
t.append(pass_vasp_result(pass_dict={"mode": mode,
"displacement": displacement,
"epsilon": "a>>epsilon_static"},
mod_spec_key="raman_epsilon->{}".format(key),
parse_eigen=True))
t.append(PassCalcLocs(name=name))
t.append(
VaspToDb(db_file=db_file, additional_fields={"task_label": name}))
super(RamanFW, self).__init__(t, parents=parents, name=fw_name, **kwargs)
t.append(
CopyCalsHome(calc_home=os.path.join(calc_home, name), run_name="hold_" + str(start_temp - temp_decrement)))
fw_list.append(Firework(t, parents=[fw1], name=name + "_hold_" + str(start_temp - temp_decrement), spec=priority_spec))
temperature -= temp_decrement
while temperature > end_temp:
# Cool Step
t = []
t.append(CopyVaspOutputs(calc_loc=True, contcar_to_poscar=True, additional_files=["XDATCAR", "OSZICAR", "DOSCAR"]))
t.append(WriteSetTask(start_temp= temperature, end_temp = temperature - temp_decrement, nsteps= nsteps_cool))
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd, gamma_vasp_cmd=">>gamma_vasp_cmd<<",
handler_group="md", wall_time=wall_time, gzip_output=False))
t.append(PassCalcLocs(name=name+"_cool_"+str(temperature-temp_decrement)))
if copy_calcs:
t.append(CopyCalsHome(calc_home=os.path.join(calc_home, name), run_name="cool_"+str(temperature-temp_decrement)))
fw_list.append(Firework(t, name=name + "_cool_" + str(temperature - temp_decrement), parents=[fw_list[len(fw_list)-1]], spec=priority_spec))
# Hold Step
t = []
t.append(
CopyVaspOutputs(calc_loc=True, contcar_to_poscar=True, additional_files=["XDATCAR", "OSZICAR", "DOSCAR"]))
t.append(WriteSetTask(start_temp=temperature-temp_decrement, end_temp=temperature - temp_decrement, nsteps=nsteps_hold))
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd, gamma_vasp_cmd=">>gamma_vasp_cmd<<",
handler_group="md", wall_time=wall_time, gzip_output=False))
t.append(PassCalcLocs(name=name + "_hold_" + str(temperature - temp_decrement)))
if copy_calcs:
t.append(CopyCalsHome(calc_home=os.path.join(calc_home, name),
run_name="hold_" + str(temperature - temp_decrement)))
if temperature == end_temp+temp_decrement:
parents (Firework): Parents of this particular Firework. FW or list of FWS.
metadata (dict): meta data
**kwargs: Other kwargs that are passed to Firework.__init__.
"""
override_default_feff_params = override_default_feff_params or {}
feff_input_set = get_feff_input_set_obj(feff_input_set, absorbing_atom, structure, edge,
radius, beam_energy, beam_direction, collection_angle,
convergence_angle, user_eels_settings=user_eels_settings,
**override_default_feff_params)
spectrum_type = feff_input_set.__class__.__name__[2:-3]
t = [WriteFeffFromIOSet(absorbing_atom=absorbing_atom, structure=structure, radius=radius,
feff_input_set=feff_input_set),
RunFeffDirect(feff_cmd=feff_cmd),
PassCalcLocs(name=name),
SpectrumToDbTask(absorbing_atom=absorbing_atom, structure=structure,
db_file=db_file, spectrum_type=spectrum_type, edge=edge,
output_file="eels.dat", metadata=metadata)]
super(EELSFW, self).__init__(t, parents=parents, name="{}-{}".
format(structure.composition.reduced_formula, name), **kwargs)
# Create new directory and move to that directory to perform
# polarization calculation
t.append(CreateFolder(folder_name="polarization", change_dir=True))
# Copy VASP Outputs from static calculation
t.extend(
[
CopyVaspOutputs(
calc_loc=static_name,
additional_files=["CHGCAR", "WAVECAR"],
contcar_to_poscar=True,
),
ModifyIncar(incar_update={"lcalcpol": True}),
RunVaspCustodian(vasp_cmd=vasp_cmd),
PassCalcLocs(name=name),
VaspToDb(
db_file=db_file, additional_fields={"task_label": name}
),
]
)
# Note, Outcar must have read_lcalcpol method for polarization
# information to be processed. ...assuming VaspDrone will automatically
# assimilate all properties of the Outcar.
super(LcalcpolFW, self).__init__(
t,
parents=parents,
name="{}-{}".format(structure.composition.reduced_formula, name),
**kwargs
)
_steps += run_steps
spawn_count += 1
fw_list.append(fw1)
while _steps < target_steps:
_name = (name + "_" + str(spawn_count))
t = []
t.append(CopyVaspOutputs(calc_loc=True, contcar_to_poscar=True, additional_files=["XDATCAR", "OSZICAR", "DOSCAR"]))
if spawn_count == 1:
if copy_calcs:
t.append(CopyCalsHome(calc_home=calc_home, run_name=name + "_0"))
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd, gamma_vasp_cmd=">>gamma_vasp_cmd<<",
handler_group="md", wall_time=run_time, gzip_output=False))
if copy_calcs:
t.append(CopyCalsHome(calc_home=calc_home, run_name=_name))
t.append(PassCalcLocs(name=_name))
new_fw = Firework(tasks=t, name=_name, parents=[fw_list[spawn_count-1]], spec=priority_spec)
_steps += run_steps
spawn_count += 1
fw_list.append(new_fw)
return fw_list
files=["WAVECAR", "WAVECAR.gz"], calc_loc=calc_loc
)
)
# Will save Lobster Calculation in Database
t.append(
LobsterRunToDb(
db_file=db_file,
calc_loc=calc_loc,
additional_fields=lobstertodb_kwargs,
additional_outputs=additional_outputs,
)
)
# passes information to next firetask
t.append(PassCalcLocs(name=name))
super(LobsterFW, self).__init__(t, parents=parents, name=fw_name, **kwargs)
def get_mdfw(start_temp, end_temp, nsteps, vasp_cmd, wall_time, name, copy_calcs, calc_home, db_file, snap_num, parents=[],
priority_spec={}, start_copy=False, relax=False, diffusion=False):
t = []
if start_copy:
t.append(CopyVaspOutputs(calc_loc=True, contcar_to_poscar=True, additional_files=["XDATCAR", "OSZICAR", "DOSCAR"]))
if copy_calcs:
t.append(
CopyCalsHome(calc_home=os.path.join(calc_home, name), run_name="cool_" + str(end_temp)))
t.append(CopyVaspOutputs(calc_loc=True, contcar_to_poscar=True, additional_files=["XDATCAR", "OSZICAR", "DOSCAR"]))
t.append(WriteSetTask(start_temp=start_temp, end_temp=end_temp, nsteps=nsteps))
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd, gamma_vasp_cmd=">>gamma_vasp_cmd<<",
handler_group="md", wall_time=wall_time, gzip_output=False))
t.append(PassCalcLocs(name=name + "_cool_" + str(end_temp)))
if copy_calcs:
t.append(
CopyCalsHome(calc_home=os.path.join(calc_home, name), run_name="cool_" + str(end_temp)))
if relax:
t.append(RelaxStaticTask(copy_calcs=copy_calcs, calc_home=calc_home, db_file=db_file, snap_num=snap_num,
priority_spec=priority_spec))
if diffusion:
t.append(DiffusionTask(copy_calcs=copy_calcs, calc_home=calc_home, db_file=db_file, snap_num=snap_num,
priority_spec=priority_spec))
return Firework(t, name=name + "_cool_" + str(end_temp), parents=parents, spec=priority_spec)
user_incar_settings=user_incar_settings,
user_kpoints_settings=user_kpoints_settings,
sort_tol=sort_tol, d_img=d_img,
interpolation_type=interpolation_type)
# Task 2: Run NEB using Custodian
cust_args = {"job_type": "neb", "gzip_output": False,
"handler_group": "no_handler"}
cust_args.update(additional_cust_args)
run_neb_task = RunVaspCustodian(vasp_cmd=">>vasp_cmd<<",
gamma_vasp_cmd=">>gamma_vasp_cmd<<",
**cust_args)
# Task 3, 4: Transfer and PassCalcLocs
tasks = [write_neb_task, run_neb_task, TransferNEBTask(label=label),
PassCalcLocs(name=label)]
super(NEBFW, self).__init__(tasks, spec=spec, name=label, **kwargs)
t.append(WriteSetTask(start_temp= temperature, end_temp = temperature - temp_decrement, nsteps= nsteps_cool))
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd, gamma_vasp_cmd=">>gamma_vasp_cmd<<",
handler_group="md", wall_time=wall_time, gzip_output=False))
t.append(PassCalcLocs(name=name+"_cool_"+str(temperature-temp_decrement)))
if copy_calcs:
t.append(CopyCalsHome(calc_home=os.path.join(calc_home, name), run_name="cool_"+str(temperature-temp_decrement)))
fw_list.append(Firework(t, name=name + "_cool_" + str(temperature - temp_decrement), parents=[fw_list[len(fw_list)-1]], spec=priority_spec))
# Hold Step
t = []
t.append(
CopyVaspOutputs(calc_loc=True, contcar_to_poscar=True, additional_files=["XDATCAR", "OSZICAR", "DOSCAR"]))
t.append(WriteSetTask(start_temp=temperature-temp_decrement, end_temp=temperature - temp_decrement, nsteps=nsteps_hold))
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd, gamma_vasp_cmd=">>gamma_vasp_cmd<<",
handler_group="md", wall_time=wall_time, gzip_output=False))
t.append(PassCalcLocs(name=name + "_hold_" + str(temperature - temp_decrement)))
if copy_calcs:
t.append(CopyCalsHome(calc_home=os.path.join(calc_home, name),
run_name="hold_" + str(temperature - temp_decrement)))
if temperature == end_temp+temp_decrement:
t.append(RelaxStaticTask(copy_calcs=copy_calcs, calc_home=calc_home, db_file=db_file, snap_num=snap_num, priority_spec=priority_spec))
if diffusion:
t.append(DiffusionTask(copy_calcs=copy_calcs, calc_home=calc_home, db_file=db_file, snap_num=snap_num, priority_spec=priority_spec))
fw_list.append(Firework(t, name=name+"_hold_"+str(temperature-temp_decrement), parents=[fw_list[len(fw_list)-1]], spec=priority_spec))
temperature -= temp_decrement
wf = Workflow(fw_list, name=wflow_name + "_" + name + "simulated_anneal_WF")
wf = powerups.add_modify_incar_envchk(wf)
return wf
t = []
if prev_calc_dir:
t.append(CopyVaspOutputs(calc_dir=prev_calc_dir, contcar_to_poscar=True))
t.append(WriteVaspNMRFromPrev(prev_calc_dir=".", mode=mode, isotopes=isotopes))
elif parents and copy_vasp_outputs:
t.append(CopyVaspOutputs(calc_loc=True, contcar_to_poscar=True))
t.append(WriteVaspNMRFromPrev(prev_calc_dir=".", mode=mode, isotopes=isotopes))
elif structure:
vasp_input_set = MPNMRSet(structure, mode=mode, isotopes=isotopes)
t.append(WriteVaspFromIOSet(structure=structure, vasp_input_set=vasp_input_set))
else:
raise ValueError("Must specify structure or previous calculation.")
t.extend([
RunVaspCustodian(vasp_cmd=vasp_cmd, auto_npar=">>auto_npar<<"),
PassCalcLocs(name=name),
VaspToDb(db_file=db_file, additional_fields={"task_label": name})
])
super(NMRFW, self).__init__(t, parents=parents, name=fw_name, **kwargs)