#!perl
use strict;
use MaterialsScript qw(:all);
sub AddRefineStructureDOF($);
#Load the settings file.
#The Reflex Refinement dialog has been used to configure the basic Refinement
#options to be applied to each phase. The settings have been saved using the
#Save Settings ... options and entering "QPA" for the name of the settings.
Modules->Reflex->LoadSettings("QPA");
print "\n\n================ QPA using the Rietveld method =======================\n";
my $phaseTable2 = Documents->New("StructureQPA.std");
#Add the first structure using the Refinement settings as saved in the QPA settings file.
my $struct1 = $Documents{"Acetohexamide_FormA.xsd"};
AddRefineStructureDOF($struct1);
#turning off preferred refinement optimization in this particular case.
my $results = Modules->Reflex->PowderQPA->AddPhase($phaseTable2, $struct1 ,Settings( PreferredOrientation => "None"));
my $phaseRowS1 = $results->RowIndex;
#Phase B
my $struct2 = $Documents{"Acetohexamide_FormB.xsd"};
AddRefineStructureDOF($struct2);
$results = Modules->Reflex->PowderQPA->AddPhase($phaseTable2, $struct2);
my $phaseRowS2 = $results->RowIndex;
#corrundum
my $struct3 = $Documents{"corundum.xsd"};
#Delete all bonds as those prevent automatic definition of structural freedom.
$struct3->AsymmetricUnit->Bonds->Delete();
AddRefineStructureDOF($struct3);
#corundum has atoms on special positions - during lattice change, fractional coordinates need to be fixed
$results = Modules->Reflex->PowderQPA->AddPhase($phaseTable2, $struct3, Settings( FixFractionalCoordinates => "Yes"));
my $phaseRowS3 = $results->RowIndex;
#==== Modify the settings for the QPA calculation if necessary
Modules->Reflex->ChangeSettings(
Settings(Convergence => "Coarse",
AddPhaseDiffractionCharts => "No",
TwoThetaMin => 5,
TwoThetaMax => 80
));
#==== Load the experimental data and run the QPA calculation. If multiple mixture pattern with the same phases
#==== are to be decomposed, just start a loop here.
# my $expDoc = Documents=>Import("C:\MyPatterns\Acetohexamide_Mixture.3cam"); #use the import method if you need to import
#data from outside the current project
my $expDoc = $Documents{"Acetohexamide_Mixture.xcd"};
my $QPAResults = Modules->Reflex->PowderQPA->Run($phaseTable2, $expDoc);
printf "Rwp for decomposition of %s: %5.1f \n", $expDoc->Name , $QPAResults->Rwp ;
my $weightA = $phaseTable2->Cell( $phaseRowS1, 'Weight %');
my $weightB = $phaseTable2->Cell( $phaseRowS2, 'Weight %');
my $weightC = $phaseTable2->Cell( $phaseRowS3, 'Weight %');
printf "\nContent of Form A : %6.2f \n", $weightA ;
printf "Content of Form B : %6.2f \n", $weightB ;
printf "Content of corundum: %6.2f \n", $weightC ;
print "\nQPA calculation finished.\n\n";
#======================================
#
# Adds structural DOF and sets refinement flags, no torsion refinement
sub AddRefineStructureDOF($)
{
my ($struct) = @_;
Modules->Reflex->Preparation->SetRefineLattice( $struct, "Yes" );
Modules->Reflex->Preparation->AssignStructuralDegreesOfFreedom( $struct );
Modules->Reflex->Preparation->SetRefineTorsions( $struct, "No" );
Modules->Reflex->Preparation->SetRefineMotionGroups( $struct, "Yes" ) ;
}
新建文本文档 (5)_materialsstudio_源码
版权申诉
75 浏览量
2021-10-01
03:30:11
上传
评论
收藏 1KB ZIP 举报
周玉坤举重
- 粉丝: 63
- 资源: 4780
最新资源
- 基于Javascript和Python的微商城项目设计源码 - MicroMall
- 基于Java的网上订餐系统设计源码 - online ordering system
- 基于Javascript的超级美眉网络资源管理应用模块设计源码
- 基于Typescript和PHP的编程知识储备库设计源码 - study-php
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
- 基于Dart的Flutter小提琴调音器APP设计源码 - violinhelper
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
- 基于MATLAB的声纹识别系统设计源码 - VoiceprintRecognition
- 基于Java的微服务插件集合设计源码 - wsy-plugins
- 基于Vue和微信小程序的监理日志系统设计源码 - supervisionLog
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈