:D 获取中...

1 Installtion

1.1 download

git clone -b stable https://github.com/lammps/lammps.git mylammps (2022 version needed for MLIP2)
git clone https://gitlab.com/ashapeev/mlip-2.git
git clone https://gitlab.com/ashapeev/interface-lammps-mlip-2.git .
### OR
git clone https://gitlab.com/ashapeev/mlip-3.git
git clone https://gitlab.com/ivannovikov/interface-lammps-mlip-3.git

1.2 Compile MLIP2 or MLIP3

  • Similar method for MLIP2 and MLIP-3

1.2.1 Intel oneapi

## load environment variables for intel oneapi 
cd mlip-2
./configure
make mlp
mv mlp mlp_mpi 
make libinterface
## you will get bin/mlp and lib/lib_mlip_interface.a
cp lib_mlip_interface.a [root of interface-lammps-mlip]

## serial version for some commands 
 ./configure --no-mpi
 make mlp
 mv mlp mlp_ser

1.2.2 gcc7+OpenMPI3+Openblas

## load environment variables for gcc7+OpenMPI3+Openblas 
cd mlip-2
./configure --blas=openblas --blas-root=/home/ywmu/backup/Src/blas/openblas/openblas.lib.gnu
make mlp
make libinterface
## you will get bin/mlp and lib/lib_mlip_interface.a
cp lib_mlip_interface.a [interface-lammps-mlip]

1.3 check libraries for Lammps

cd [root_of_lammps]/src
make yes-most && make no-lib && make no-ext
make  package-status| grep YES

### building some libs 
### load python 3
cd [root_of_lammps]/lib
cd plumed/
python Install.py -b 
### change the path of github in ../lib/plumed/Install.py if needed (e.g., hub.nuaa.cf)
cd ../voronoi
python Install.py -b 
cd ..
##################

 make  yes-PLUMED yes-VORONOI
 make  package-status | grep YES
 
### Optional 
#### Add NEP-CPU 
#### https://gtihub.com/brucefan1983/NEP_CPU
git clone https://gtihub.com/brucefan1983/NEP_CPU.git
cd NEP_CPU-main 
cp -r src/*  interface/lammps/USER-NEP/
cp -r interface/lammps/USER-NEP  [root_of_lammps]/src/
cd [root_of_lammps]/src/
make yes-USER-NEP
##################

## for intel openmpi , failed for intel 2015
cp MAKE/OPTIONS/Makefile.oneapi  MAKE/Makefile.mpi
### modify MAKE/Makefile.mpi for intel compiler including oneapi 
replace -xHost with -march=core-avx2

## OR for ompi 
cp MAKE/OPTIONS/Makefile.g++_openmpi  MAKE/Makefile.mpi

cd [interface-lammps-mlip]
./install.sh [root_of_lammps] mpi 

# you will get lmp_mpi

2 XRD and SAED(From)

2.1 Compute

  • Example input file,in.BulkNi,
variable  A string bulkNi

boundary        p p p

units       metal
timestep    0.001

lattice         fcc 3.52
region          box block 0 20 0 20 0 20
create_box      1 box
create_atoms    1 box

pair_style      none
mass            * 58.71
atom_modify     sort 0 0

compute         XRD all xrd  1.541838 Ni 2Theta 40 80 c 2 2 2 LP 1 echo

compute         SAED all saed 0.0251  Ni Kmax 0.85 &
                Zone 0 0 0 c 0.025 0.025 0.025 &
                dR_Ewald 0.01 echo manual

fix             1 all ave/histo/weight 1 1 1 40 80 200 c_XRD[1] c_XRD[2] &
                mode vector file $A.hist.xrd

fix             2 all saed/vtk 1 1 1 c_SAED file $A_001.saed 

#dump            1 all custom 1 $A.dump id x y z 
run             0

unfix           1
unfix           2
uncompute       XRD
uncompute       SAED
  • on Windows, lmp_serial -pk omp 4 -sf omp -in in.BulkNi

2.2 Visual

  • XRD: 删除前几行,从第一列数值为1开始,导入Veusz或Origin绘图,推荐使用第2、4列绘图。

2.2.1 SAED

In addition to the LAMMPS output, a simple visualizaiton of the electron diffraction data is included. The visualization was created using the VisIt Open Source visualiztion software develeoped at Larrence Livermore National Laboraatory (https://wci.llnl.gov/simulation/computer-codes/visit/).

Below is a step by step guide to produce similar images:

2.2.1.1 Open the diffraction .vtk files in VisIt

2.2.1.2 Click add->pseudocolor->intensity;

  • Note, green name means its ready to be drawn

2.2.1.3 Click Draw;

  • Note, you will see the full rectangular mesh grid which is what we are wanting.
  • We need to remove ghost data (those values set to -1).

2.2.1.4 Select intensity plot;

  • Click Operators->Selection->Isovolume;
  • Double click isovolume (under intensity plot);
  • Change lower bound to 0;
  • Click Apply;
  • Click Dismiss;
  • Click Draw;
  • Note, now you will see only where there was valid intensity data (if you don’t use Zone it will be a sphere). But most intensity are low so color the intensity by log scale.

2.2.1.5 Select intensity plot

  • Double click Pseudocolor;
  • Change Scale to Log;
  • Check Mimimum Limit;
  • Input non-zero minimum limit (i.e. 1);
  • Click Apply;
  • Click Dismiss;
  • Note, clicking apply will change the scale automatically. But unless you have used Zone and a thin dR_Ewald you likely have lots of extra data visualized that does not intersect the Ewald sphere. Next, we want to take a spherical slice to mimic the intersection of Ewald’s sphere with reciprocal space.

2.2.1.6 Select intensity plot;

  • Click Operators->Slicing>Spherical Slice;
  • Double click Spherical Slice;
  • Change the origin/radius to represent the center of your Ewald sphere; (i.e. 39.84063 0 0) and radius (i.e. 39.84063) for lambda = 0.251
  • Click Apply;
  • Click Dismiss;
  • Click Draw;
  • This is the saed pattern, but we are not guaranteed to be aligned correctly with the zone axis.

2.2.1.7 On the menu bar->select Controls->View;

  • Change View Normal to the zone axis of choice (i.e. -1 0 0);
  • Adjust Up Vector if desired (i.e. 0 1 0);
  • Turn off Perspective view;
  • Click Apply;
  • Click Dismiss;
  • Note that for the primary x, y, and z zone axis you can use the drop own Align to axis. However, it is likely that there is a bunch of extra annotations on the image that don’t look appealing.

2.2.1.8 On the menu bar->select Control->Annotation;

  • Here you can change what is visualized along side the data and how you display axis information. I typically turn most all the display information off.

2.2.1.9 Save the image

  • Click File-> Set save options
  • Click Save
  • Note, further fine tuning can be achieved by adjusing the color table and max/min values.