Skip to content
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

CONTCAR and XDATCAR can not output right in optimization #56

Open
wankiwi opened this issue Dec 19, 2023 · 0 comments
Open

CONTCAR and XDATCAR can not output right in optimization #56

wankiwi opened this issue Dec 19, 2023 · 0 comments

Comments

@wankiwi
Copy link

wankiwi commented Dec 19, 2023

When I did an optimization task, I got the wrong CONTCAR and XDATCAR files.

The CONTCAR is the same as the POSCAR.
image

The configuration output in every ion cycle is the same as the POSCAR.
image

My vasp version is 6.3.0 and my execution script is below:

import numpy as np
import os
import shutil
import tempfile

from ase.atoms import Atoms
from ase.optimize import BFGS
from ase.optimize import FIRE
from ase.io import read

from vasp_interactive import VaspInteractive

def run_with_vasp_interactive(atoms):
    print("Running relaxation using VaspInteractive")
    calc = VaspInteractive(
        encut=400,
        ispin=2,
        ismear=0,
        xc="pbe",
        kpts=(1, 1, 1),
        lorbit = 11,
        directory='./',
        ncore = 2,
        parse_vaspout=True,
    )

    # Use the provided atoms object for the calculation
    with calc:
        atoms.calc = calc
        dyn = BFGS(atoms)
        dyn.run(fmax=0.05)

    n_ion, n_elec = calc.read_all_iterations()
    print(f"Relaxation by VaspInteractive in {n_ion - 1} steps")
    print(f"Electronic scf steps per ionic cycle: {n_elec[:-1]}")

# Example usage:
if __name__ == "__main__":
    # Here you would load your structure from a file or other source
    # For example, using ASE's read function:
    # atoms = ase.io.read('path_to_structure_file.xyz')
    # run_with_vasp_interactive(atoms)

    # For demonstration, we'll still create an H2 molecule
    atoms = read('POSCAR')
    run_with_vasp_interactive(atoms)

I think it is a bug, could developers fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant