-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ASE LAMMPSlib Calculator #63
Comments
I nevere tried other calculators but it should be possible. The siesta support was implemented by the otside contributor. The problem with LAMMPS is that it is an internal calculator not an external one (like vasp or abinit). You should be able to get around this problem by actually making a new objects for the deformed structures. Please post the error messages. Maybe I will be able to help. |
I think I have an approach that will work for Line 578 in 6117c9a
Would look something like this: def SerialCalculate(systems,calc,prefix="Calc_"):
if type(systems) != type([]) :
sysl=[systems]
else :
sysl=systems
basedir=os.getcwd()
res=[]
for n,s in enumerate(sysl):
if isinstance(calc, LAMMPSlib):
s.set_calculator(calc)
else:
s.set_calculator(deepcopy(calc))
s.get_calculator().block=False
place=tempfile.mkdtemp(prefix=prefix, dir=basedir)
os.chdir(place)
s.get_calculator().working_dir=place
s.get_potential_energy()
os.chdir(basedir)
time.sleep(0.2)
res.append([n,s])
return [r for ns,s in enumerate(sysl) for nr,r in res if nr==ns] It seems to work, but I've only tested on a single ...
systems = get_elementary_deformations(structure, n=10, d=0.1)
result = SerialCalculate(systems, calculator)
cij, _ = get_elastic_tensor(structure, systems=result) Can create a pull request if you think it makes sense. |
Was wondering if you have any guidance on how might be able to proceed with using
ASE LAMMPSlib
. I tried to simply pass theASE LAMMPSlib
calculator object but gotdeepcopy
errors.Heres the source to the
ASE LAMMPSlib
implementation:https://wiki.fysik.dtu.dk/ase/_modules/ase/calculators/lammpslib.html#LAMMPSlib
The text was updated successfully, but these errors were encountered: