ATAT 专题

ATAT CALPHAD 与绘图命令

sqs2tdb、OpenCalphad驱动、坐标及网格转换的6个命令。

更新于 2026-10-24约 17 分钟阅读按任务与环境选择适用配置
阅读本篇目录

ATAT 专题导读 · 完整教程与算例

sqs2tdb、OpenCalphad驱动、坐标及网格转换的6个命令。 每条列出用途、输入输出、调用格式和使用条件;展开参数表可查看 ATAT 3.52 的原始英文选项与默认值。

[int] 表示整数,[real] 表示实数,[string] 表示文件名或文本;同名参数在不同命令中的含义可能不同。调用前应准备对应输入文件。

CALPHAD 和图形转换#

sqs2tdb#

从预制 SQS、结构性质和组分模型构建 CALPHAD TDB。

输入与结果: species.in、所选数据库、结构性质、terms.in → 晶格模型及合并 TDB。

调用格式:

sqs2tdb -cp -l=FCC_A1 -lv=1

-cp 复制;-fit 拟合;-tdb 合并;-oc 提高 OpenCalphad 可移植性。首次复制/拟合会先创建需编辑的文件,按提示检查后重跑。只生成文件不代表数据库具有完整材料覆盖。

展开本命令的完整参数表
sqs2tdb version 3.52 by Axel van de Walle and with contributions to the SQS database
        from Ruoshi Sun, Qijun Hong and Sara Kadkhodaei.

Usage: sqs2tdb [options]    where the available options are:
-h   : More help.
-cp  : Copy SQS from the database to the current directory. Must specify:
       -lv=[level]
           level indicates how fine of composition mesh to use (0: only end members, 1: mid points, etc.)
       -l=[lattice]
          Available lattices
           AUCD_B19
           AUCD_B19.tar
           AUCU_L10
           BCC_A2
           BETASN_A5
           CDI2_C6
           CHI_A12
           CR3SI_A15
           CSCL_B2
           CUPRITE_C3
           CUPT_B22
           CUPT_L11
           DIAMOND_A4
           DUMMY
           FCC_A1
           FE3AL_D03
           FLUORITE_C1
           GA3PT5
           GAMMA_L12
           HCP_A3
           HEUSLER_D022
           HEUSLER_L21
           LIQUID
           MGCU2_C15
           MGZN2_C14
           NI3SN_D019
           NI4MO_D1A
           NIAS_D81
           OMEGA_C32
           PEROVSKITE_E21
           PYRITE_C2
           REO3_D09
           ROCKSALT_B1
           RUTILE_C4
           SIGMA_D8B
           WURTZITE_B4
           ZINCBLENDE_B3
           ZINTL_B32
           ZIRCONIA_TET

        Optional: -sp=Element,Element,...  to indicate which elements to consider
                      (otherwise read from species.in if it exists).
-fit : Fit solution model from SQS energies (to be run within the desired lattice directory)
       The -sro option can also be specified (with -fit) to include short-range order effects.
       The -ew=[real] option (default: 5) lets you set the increased weight given to endmembers in the fit.
-tdb : Combine solution models from one or multiple lattices into a single .tdb file.
       add the -oc (Open Calphad) option to generate a more portable tdb file.
-mk  : Generate input file for SQS generation with mcsqs. (Usually not needed - only for experts.)
       To be run in the SQS database directory:
       /public/software/atat/3.52/gcc-13.3/8173m/share/atat/data/sqsdb/[lattice name]
Note that -h,-mk,-cp,-fit,-tdb are mutually exclusive.


For more information see user guide published in:
  A. van de Walle, R. Sun, Q.-J. Hong, and S. Kadkhodaei.
  Software tools for high-throughput calphad from first-principles data.
  Calphad, 58:70, 2017.
  https://doi.org/10.1016/j.calphad.2017.05.005
(Also, this paper should be cited in any publication resulting from this code's use.)

EXAMPLES

-> A simple session of sqs2tdb could be:

cp ~/atat/example/vasp.wrap .
emacs vasp.wrap   #edit as needed

echo Al,Ni > species.in

sqs2tdb -cp -l=FCC_A1 -lv=1
sqs2tdb -cp -l=FCC_A1 -lv=1

cd FCC_A1
foreachfile wait pwd \; runstruct_vasp

sqs2tdb -fit

Edit the file terms.in to read
1,0
2,0

sqs2tdb -fit

cd ..

(repeat the above for other lattices if necessary)

sqs2tdb -tdb

The file AL_NI.tdb would contain a valid .tdb file.

-> In a more advanced example, the runstruct_vasp command could be replaced
by a job script submission containing the runstruct_vasp command.

-> When there are lattice instabilities, the runstruct_vasp could be replaced by 
robustrelax_vasp -mk  #this is to be run only once (see robustrelax_vasp -h for instructions)
robustrelax_vasp -id

-> If phonons are to be included (for end members) one could do:
foreachfile endmem pwd \; fitfc -si=str_relax.out -ernn=4 -ns=1 -nrr
foreachfile -d 3 wait \; runstruct_vasp -lu -w vaspf.wrap
   where vaspf.wrap contains parameters for a static run to calculate forces.
foreachfile endmem pwd \; fitfc -si=str_relax.out -f -frnn=2
foreachfile endmem pwd \; robustrelax_vasp -vib

sqs2tdb -fit

OPTIONAL input files (to placed in the topmost directory):

    exfromsgte.in : specify which phases should NOT be copied from SGTE database
                    (by default all phases for each relevant element are included,
                    but you may want to use ab initio data for virtual phase).
                    Phases are specified in the form: SGTE_[lattice]_[element]
                    e.g. SGTE_BCC_A2_AL
    subref.sed    : substitution rule (sed command to be applied to final tdb file)

OUTPUT FILES
    In addition to the *.tdb files, there is some diagnostic info available in the files fit_[property].out where property could be 
    energy, svib_ht, etc.

ADVANCED FEATURES
    In each sqs subdirectory created, there may be a file called link that contains the path to
    another directory where energy data can be found. This is useful if another structure is
    known be equivalent by symmetry. This file is created by default for equivalence within a
    given structure type can even find symmetries across structure types.
    You can also create the file yourself and the code will follow your link.

    There may also be a file called bump which indicates that a structure must be moved up in energy by the
    amount specified by the -bv option (or 5e-3 by default) to avoid degeneracy with an equivalent higher symmetry structure.
    This file is created by default (during the -cp step) when the code detects higher symmetry (e.g. a GAMMA_L12 phase with all sites occupied
    with the same type of atom is just FCC). You can delete this file if the higher-symmetry structure is not in your
    set of structures. This file is read during the -fit step.

    In summary, if you see a bump file, ask yourself if you have that structure elsewhere and put an appropriate link file.
    If you don't have that structure elsewhere, you can delete the bump file.
    The code will still work and give the right answer if you don't do this, but it will spend  more computer time.

    During the -fit step, one can specify the -sro option to include a low-order CVM approximation to the short range order.
    One can also specify the weights used to enforce better fit of the end members with the -ew option (a weight of 10 is the default).

    The default lower and upper temperature limits of 298.15K and 10000K can be changed with the -Tl=... and -Tu=... options, respectively.
    
    This code now allows for the input free energies to general CALPHAD-compatible T-dependent functions. To use this feature, place your functions
    in 'func' files and do not specify th 'energy' or 'svib_ht' files
    (or specify the -jf option to force the code to ignore the 'energy' and 'svib_ht' files).

ocplotpd#

调用 OpenCalphad 扫描平衡并组织相图网格/绘图。

输入与结果: TDB、组分与温度设置、外部 oc 命令及配置 → 平衡数据与图形文件。

调用格式:

ocplotpd -tdb=AU_CU.tdb -n=20 -T0=300 -T1=1500 -e=AU,CU

OpenCalphad 是外部依赖,ATAT 安装本身不提供这个求解器。先检查 ~/.ocplotpd 或程序旁配置,确认数据库完整性;不要把几何绘图样例当成已求解相图。

展开本命令的完整参数表
A front-end to OpenCalphad for PLOTting Phase Diagrams.
Usage: ocplotpd [-ha] [-nt] [-tlf=fraction] [-1f] [-vtk] [-rmax=r_max] [-rmin=r_min] [-np=nb_of_proc] -tdb=tdbfile -n=nb_of_samples -T0=min_temperature -T1=max_temperature -e=element,element,...

Mandatory parameters:
 tdbfile: name of the Thermodynamic DataBase (TDB) file to use
 element,element,... : a list of the elements (and associated phases) to extract from the TDB file
 nb_of_samples: Number of phase equilibria sampled to generate the phase diagram
 min_temperature: lower bound on the temperature axis
 max_temperature: upper bound on the temperature axis (if min_temperature=max_temperature, a cross section is plotted)
 
optional parameters:
 -ha:   high accuracy calculations
 -nt:   no tie lines
 -tlf:  fraction of tie lines displayed (between 0.0 and 1.0)
 -1f:   generate a single gnuplot file
 -vtk:  generate vtk files (instead of gnuplot)
 -rmax: max distance between points in triangulation
 -rmin: discard points closer to each other than this cutoff
 -np:   launch nb_of_proc copies of opencalphad
 -noc:  do not run OpenCalphad - just create the graphs from the *.dat files
 -nd:   general n-dimensional phase diagram (generate input files for ndviewer - experimental)
 -debug:do not delete temporary files
 -mpi:  use mpi for simplexize code (experimental)

mkaxes#

生成 Gibbs 三角形/四面体等坐标轴和坐标变换。

输入与结果: 轴类型、标签、尺度或输入坐标 → 网格/变换结果。

调用格式:

mkaxes -tri -ef=bi > axes.bi

-tetra 四面体;-trans 坐标变换;-mat 矩阵;-ef 选 vtk/bi/stl 等导出。仅生成几何图件。

展开本命令的完整参数表
MaKe Axes 3.52, by Axel van de Walle
     -h            Display more help (Default: Off)
 -trans            Transform to coordinate system (Default: Off)
   -mat            Output transformation matrices (Default: Off)
   -tri            Gibbs triangle (Default: Off)
 -tetra            Gibbs tetrahedron (Default: Off)
 -hidim=[int]      Dimension (Default: 3)
   -col=[real]     Color (Default: 0)
   -rgb=[real],... RGB Color (Default: )
    -vl=[string]   Vertices labels (Default: )
  -zmax=[real]      (Default: 1000)
  -zmin=[real]      (Default: 0)
-zscale=[real]      (Default: 1000)
    -cs            Cross-Section (Default: Off)
    -cf=[string]   Cross section input File (Default: cut.in)
  -font=[string]   font file (Default: )
    -ef=[string]   Export format (default: vtk)
   -sig=[int]      Number of significant digits printed (Default: 5)
     -d            Use all default values (Default: Off)

simplexize#

将点集或分段线转换成可绘图的单纯形/线网格。

输入与结果: tab.in 中的点和空行分段 → VTK、内置 bi 等网格。

调用格式:

simplexize -l -ef=bi > lines.bi

-l 连线;-tie 连系线;-rmax/-rmin 控制网格;-cs 截面。网格生成不包含相平衡物理求解。

展开本命令的完整参数表
Simplexize 3.52, by Axel van de Walle
   -t=[string]   Input table file (Default: tab.in)
 -col=[real]     Color (Default: 0)
 -rgb=[real],... RGB Color (Default: )
-rmax=[real]     Maximum radius of curvature (Default: 0.1)
-rmin=[real]     Minimum distance between points kept (Default: 0.001)
   -l            Plot lines (Default: Off)
 -tie            Plot tie lines (Default: Off)
-tiew=[real]     Tie line width (Default: 0.01)
 -sig=[int]      Number of significant digits printed (default: 5)
  -ef=[string]   Export format (default: vtk)
  -cs            Cross-Section (Default: Off)
  -cf=[string]   Cross section input File (Default: cut.in)
   -h            Display more help (Default: Off)
   -d            Use all default values (Default: Off)

triph#

把温度—三元组分分支数据三角化为曲面。

输入与结果: tab.in 分段表格 → VTK/bi 等曲面。

调用格式:

triph -sc=1 -ef=vtk > surface.vtk

表格首列为唯一轴,后两列为三元组分坐标;-sc 缩放首轴,-bf 生成背面。输入必须已正确分支和排序。

展开本命令的完整参数表
TRIangulate PHase 3.52, by Axel van de Walle
  -t=[string]   Input table file (Default: tab.in)
 -sc=[real]     Scale for the unique axis (1st) (Default: 1000)
-col=[int]      Color (Default: 0)
-nfn            do Not fix Normal vector (Default: Off)
 -bf            generate back face (Default: Off)
-sig=[int]      Number of significant digits printed (default: 5)
 -ef=[string]   Export format (default: vtk)
  -h            Display more help (Default: Off)
  -d            Use all default values (Default: Off)

3d2gnu#

把 ATAT 内置三维网格转换成 gnuplot 绘图脚本。

输入与结果: -if 指定 bi 网格、视角/光照设置 → gnuplot 脚本。

调用格式:

3d2gnu -if=lines.bi > plot.gnu

-tc 设置终端和输出,-eye/-at/-up 调整视角。不能把任意 CSV 或 VTK 直接当成 bi 输入。

展开本命令的完整参数表
3D to GNUplot 3.52, by Axel van de Walle
 -if=[string]   Input table file (Default: tri.bi)
 -tc=[string]   set terminal command (Default: set term postscript eps color ; set out 'test.eps')
-eye=[real],... Eye position (Default: 0,-5,0)
 -at=[real],... Lookat position (Default: 0,0,0)
 -up=[real],... Up direction (Default: 0,0,1)
-fov=[real]     Field of View (in degrees) (Default: 30)
-lit=[real],... Light direction (Default: 0,0.707107,-0.707107)
-amb=[real]     Ambiant light level (Default: 0.5)
  -h            Display more help (Default: Off)
  -d            Use all default values (Default: Off)

原始参数表来自 ATAT 3.52,作者 Axel van de Walle 及相应贡献者。中文说明由鸢算科技编写;算法出处与论文引用。

需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。

查看配图

放大后可滚动查看细节,按 Esc 关闭。

100%查看原图 ↗