|
|
新手参考了一下别人用自制脚本构建高尚氧化物模型,想要尝试构建自己的高熵合金模型
参考链接:https://www.bilibili.com/video/B ... 00bd2e672534043d45b
以下为本人根据自身需要更改后的脚本:
#!perl
use strict;
use Getopt::Long;
use MaterialsScript qw(:all);
use List::Util qw(shuffle);
use POSIX;
my $doc = $Documents{"Ni.xsd"};
$doc->BuildSuperCell(10, 10, 10);
my $table = Documents->New("structure.std");
$table->ColumnHeading(0) = "Structure";
$table->ColumnHeading(1) = "energy";
for(my $i=1;$i<=20;$i++)
{
my $alloy = Documents->New("alloy.xsd");
$alloy -> CopyFrom($doc);
my $atoms = $alloy->UnitCell->Atoms;
my @shuffle = shuffle(@$atoms);
for(my $j=1;$j<=800;$j++)
{
my $changeatom = shift(@shuffle);
$changeatom -> ElementSymbol = "Co";
};
for(my $k=1;$k<=800;$k++)
{
my $changeatom = shift(@shuffle);
$changeatom -> ElementSymbol = "Cr";
};
for(my $l=1;$l<=800;$l++)
{
my $changeatom = shift(@shuffle);
$changeatom -> ElementSymbol = "Fe";
};
for(my $m=1;$m<=800;$m++)
{
my $changeatom = shift(@shuffle);
$changeatom -> ElementSymbol = "Sb";
};
my $results = Modules->Forcite->GeometryOptimization->Run($alloy, Settings(
'3DPeriodicElectrostaticSummationMethod' => 'Ewald',
'3DPeriodicvdWEwaldSumAccuracy' => 0.0001,
'3DPeriodicElectrostaticEwaldSumAccuracy' => 0.0001,
'3DPeriodicvdWAtomCubicSplineCutOff' => 15.5,
'3DPeriodicvdWChargeGroupCubicSplineCutOff' => 15.5,
CurrentForcefield => 'Universal',
ChargeAssignment => 'Charge using QEq',
UseMaxDisplacement => 'No',
KeepMotionGroupsRigid => 'No'));
my $results = Modules->Forcite->Analysis->RadialDistributionFunction($doc, Settings());
my $outRDFChart = $results->RDFChart;
my $outRDFChartAsStudyTable = $results->RDFChartAsStudyTable;
$table->Cell($i-1,0) = $results->Structure;
$table->Cell($i-1,1) = $results->Structure->PotentialEnergy;
$table->Cell($i-1,2) = $results->RDFChart;
$Documents{"alloy.xsd"}->Delete;
$Documents{"alloy Convergence.xcd"}->Delete;
$Documents{"alloy Energies.xcd"}->Delete;
$Documents{"Status.txt"}->Delete;
$Documents{"alloy.txt"}->Delete;
$Documents{"alloy Forcite RDF.std"}->Delete;
$Documents{"alloy Forcite RDF.xcd"}->Delete;
}
|
-
1.png
(24.45 KB, 下载次数 Times of downloads: 7)
|