Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions calphy/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@
sarath.menon@ruhr-uni-bochum.de/yury.lysogorskiy@icams.rub.de
"""

import os
import shutil
import warnings
import logging
import numpy as np
from collections import Counter, defaultdict

from pylammpsmpi import LammpsLibrary
from lammps import lammps
from ase.io import read, write

import numpy as np
import pyscal3.core as pc
from pyscal3.trajectory import Trajectory

from pylammpsmpi import LammpsLibrary

try:
import lammps.mliap # noqa: F401

has_mliap = True
except ImportError:
has_mliap = False


class LammpsScript:
"""Collect LAMMPS commands instead of executing them.
Expand Down Expand Up @@ -115,6 +117,11 @@ def create_object(
if "-screen" not in cmdargs:
cmdargs.extend(["-screen", "none"])
lmp = LammpsLibrary(cores=cores, working_directory=directory, cmdargs=cmdargs)
if has_mliap:
if "-k" in cmdargs or "-kokkos" in cmdargs:
lmp.lmp.activate_mliappy_kokkos()
else:
lmp.lmp.activate_mliappy()

commands = [
["units", "metal"],
Expand Down
4 changes: 2 additions & 2 deletions environment-nolammps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ dependencies:
- pyyaml
- mendeleev
- openmpi
- numpy
- numpy >=2.0.0
- mpi4py
- pylammpsmpi
- pylammpsmpi >0.4.1
- matplotlib
- tqdm
- pydantic >=2.3.0
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ dependencies:
- mendeleev
- lammps
- openmpi
- numpy
- numpy >=2.0.0
- mpi4py
- pylammpsmpi
- pylammpsmpi >0.4.1
- matplotlib
- tqdm
- pydantic >=2.3.0
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ dependencies = [
"mendeleev",
"tqdm",
"scipy",
"pydantic>=2",
"pydantic>=2.3.0",
"pyscal3",
"pylammpsmpi",
"pylammpsmpi>0.4.1"
]

[project.optional-dependencies]
Expand Down
Loading