24小时热门版块排行榜    

查看: 744  |  回复: 3
当前主题已经存档。

zhxd1028

禁虫 (小有名气)

本帖内容被屏蔽

» 猜你喜欢

» 本主题相关商家推荐: (我也要在这里推广)

已阅   关注TA 给TA发消息 送TA红花 TA的回帖

zdd2008

金虫 (职业作家)

zhxd1028(金币+10):太感谢了! 2010-04-19 21:40
楼主给个QQ吧,我传给你,纳米盘坏了!!!
2楼2010-04-19 20:22:15
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

zdd2008

金虫 (职业作家)


qli0218(金币+1):谢谢 2010-04-19 20:50
以下是getcif.pl文件的内容,楼主自己再建一个文件吧,呵呵


eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' if 0;
#;-*- Perl -*-

# 13-05-2005

# Makes a linear interpolation between to POSCARs with N points

use FindBin qw($Bin) ;
use lib "$Bin" ;
use Vasp ;

(@ARGV<3) || die "USAGE: getcif.pl \n" ;
# Defaults
$poscarfilename="CONTCAR";
$potcar="POTCAR";
# Read input variables
if(@ARGV>0){
  $poscarfilename=$ARGV[0];
}
if(@ARGV>1){
  $poscarfilename=$ARGV[0];
  $potcar=$ARGV[1];
}
(-e "$poscarfilename" || die (" $poscarfilename does not exist\n";
(-e "$potcar" || die (" $potcar does not exist\n";
($coordinates,$basis,$lattice,$num_atoms,$total_atoms,$selectiveflag,$selective,$description)
= read_poscar($poscarfilename);
$coms=`grep 'TITEL' $potcar`;
@coms=split /\n/, $coms;
$num_coms=@coms;
(@{$num_atoms}==$num_coms) || die (" POSCAR and POTCAR files should have the same types of atoms\n";
for($i=0;$i<$total_atoms;$i++){
  for($j=0;$j<3;$j++){
  if($coordinates->[$i][$j]<0) {
    $coordinates->[$i][$j]+=1;}
if($coordinates->[$i][$j]>=1) {
    $coordinates->[$i][$j]-=1;  }}}
open OUT, ">out.cif";
printf"data_\n_audit_creation_method    ''\n";
printf OUT "data_\n_audit_creation_method    ''\n";
$lengtha=sqrt($basis->[0][0]*$basis->[0][0]+$basis->[1][0]*$basis->[1][0]+$basis->[2][0]*$basis->[2][0]);
$lengthb=sqrt($basis->[0][1]*$basis->[0][1]+$basis->[1][1]*$basis->[1][1]+$basis->[2][1]*$basis->[2][1]);
$lengthc=sqrt($basis->[0][2]*$basis->[0][2]+$basis->[1][2]*$basis->[1][2]+$basis->[2][2]*$basis->[2][2]);
$cos_alpha=($basis->[0][1]*$basis->[0][2]+$basis->[1][1]*$basis->[1][2]+$basis->[2][1]*$basis->[2][2])/$lengthb/$lengthc;
$sin_alpha=sqrt(1-$cos_alpha*$cos_alpha);
$alpha=atan2($sin_alpha,$cos_alpha)*180/3.141592653589793;
$cos_beta=($basis->[0][0]*$basis->[0][2]+$basis->[1][0]*$basis->[1][2]+$basis->[2][0]*$basis->[2][2])/$lengtha/$lengthc;
$sin_beta=sqrt(1-$cos_beta*$cos_beta);
$beta=atan2($sin_beta,$cos_beta)*180/3.141592653589793;
$cos_gamma=($basis->[0][0]*$basis->[0][1]+$basis->[1][0]*$basis->[1][1]+$basis->[2][0]*$basis->[2][1])/$lengtha/$lengthb;
$sin_gamma=sqrt(1-$cos_gamma*$cos_gamma);
$gamma=atan2($sin_gamma,$cos_gamma)*180/3.141592653589793;
printf"_cell_length_a%20.6f\n",$lengtha;
printf OUT "_cell_length_a%20.6f\n",$lengtha;
printf"_cell_length_b%20.6f\n",$lengthb;
printf OUT "_cell_length_b%20.6f\n",$lengthb;
printf"_cell_length_c%20.6f\n",$lengthc;
printf OUT "_cell_length_c%20.6f\n",$lengthc;
printf"_cell_angle_alpha     %.4f\n",$alpha;
printf OUT "_cell_angle_alpha     $.4f\n",$alpha;
printf"_cell_angle_beta      %.4f\n",$beta;
printf OUT "_cell_angle_beta      $.4f\n",$beta;
printf"_cell_angle_gamma     %.4f\n",$gamma;
printf OUT "_cell_angle_gamma     %.4f\n",$gamma;
printf"_symmetry_space_group_name_H-M  'T'\n";
printf OUT "_symmetry_space_group_name_H-M  'T'\n";
printf"loop_\n";
printf OUT "loop_\n";
printf"_atom_site_type_symbol\n_atom_site_label\n";
printf OUT "_atom_site_type_symbol\n_atom_site_label\n";
printf"_atom_site_fract_x\n_atom_site_fract_y\n_atom_site_fract_z\n";
printf OUT "_atom_site_fract_x\n_atom_site_fract_y\n_atom_site_fract_z\n";
$index=0;
for($j=0;$j<@{$num_atoms};$j++){  
     $line=$coms[$j];
     chomp($line) ;
     $line=~s/^\s+//g;
     @line=split /\s+/,$line;
     $c[$j]=$line[3];
    if($j != 0){$num_atoms->[$j]+=$num_atoms->[$j-1];}  
for($m=$index;$m<$num_atoms->[$j];$m++){
printf "%5s%5s%d\t",$c[$j],$c[$j],$m+1;
printf OUT  "%5s%5s%d\t",$c[$j],$c[$j],$m+1;
printf "%12.8f%12.8f%12.8f\n",$coordinates->[$m][0],$coordinates->[$m][1],$coordinates->[$m][2];
printf OUT  "%12.8f%12.8f%12.8f\n",$coordinates->[$m][0],$coordinates->[$m][1],$coordinates->[$m][2];
}
$index=$num_atoms->[$j];
}
3楼2010-04-19 20:44:01
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

fanchen021

铁杆木虫 (正式写手)

晕~~~~~~~
4楼2010-04-20 00:03:10
已阅   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zhxd1028 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 建议基金发布提前给出明确的时间点 +10 kulium 2026-08-21 13/650 2026-08-21 21:58 by alongwaytogo
[基金申请] 2026国自然函评费到账 +7 羊腰板 2026-08-21 7/350 2026-08-21 21:28 by iwuli
[基金申请] 今日不放榜?网传国自然预计 8 月 27 日可查结果 +16 医学老男孩 2026-08-20 20/1000 2026-08-21 21:13 by Ldrop2023
[基金申请] 看来今天不会放榜了? +8 chengyan1220 2026-08-21 11/550 2026-08-21 17:52 by dcqxinyang
[基金申请] 时间戳又变了 +13 wuchongjun 2026-08-20 19/950 2026-08-21 17:21 by 紫杉醇
[基金申请] filecode,4个jtjc了 +11 ziyangfang 2026-08-19 14/700 2026-08-21 16:51 by applepetty
[基金申请] 让我中一个面上吧! +11 大萍1987 2026-08-20 13/650 2026-08-21 14:48 by 20120902066
[基金申请] 人气不行了 +7 fansofjerry 2026-08-21 7/350 2026-08-21 14:13 by Vivilian
[基金申请] 感觉是下周放榜了 +7 angus9576 2026-08-17 12/600 2026-08-21 13:38 by weiyin
[基金申请] 只有每年这种时候来逛逛小木虫 +23 yaoyewhu2008 2026-08-20 25/1250 2026-08-21 12:19 by Poppy1104
[基金申请] 时间戳又变了8-15 +15 archvillain 2026-08-15 27/1350 2026-08-21 11:32 by tim76
[基金申请] 今天基金会出结果吗?20260819 +15 kkkl_v 2026-08-19 16/800 2026-08-21 11:22 by 365372687
[论文投稿] 投稿咨询 +5 wwm09 2026-08-17 7/350 2026-08-21 10:11 by 期刊论文帮手
[基金申请] 放榜前的不淡定 40+4 snowwithsea 2026-08-19 13/650 2026-08-21 08:30 by 北京莱茵编辑
[基金申请] 估计是周四 +3 archvillain 2026-08-18 3/150 2026-08-21 01:48 by jnhyjjm
[基金申请] 重要消息,中午系统在维护 +11 yuleib84 2026-08-18 12/600 2026-08-20 11:09 by xskun
[教师之家] 为什么余额宝的年化利率越来越低?主要原因有哪些? +5 瞬息宇宙 2026-08-15 5/250 2026-08-19 20:23 by super2002521
[基金申请] 今天放榜吗? +14 布布和一二 2026-08-19 15/750 2026-08-19 18:07 by gltch
[基金申请] 2027广东省杰青 +4 奶牛小黑 2026-08-15 10/500 2026-08-19 11:02 by wanfengnew
[基金申请] 今天维护系统维护 祝所有人 高中 +8 gjjjzhong 2026-08-18 9/450 2026-08-18 13:01 by 家与远方
信息提示
请填处理意见