Académique Documents
Professionnel Documents
Culture Documents
ZaiweiZhang,R.EdwinGarca
Nowadays,scholarsareworkingonnanoscalemoreandmorefrequently.Atthatscale, descriptionscouldbehardtomadesincemostofnanomaterialscannotbeseenatnormallife. Therefore,programsimulationofnanoscaledmaterialsaremoreandmoreneeded. ProjectGoals: Myresearchprojectisdevelopingasimulationtoolforthediffusionreactionsindifferenttypes ofmaterials.MymainresponsibilityistocreateaGraphicUserInterfaceofthetoolandgenerate graphicalresultssothatuserscanhavemoreunderstandingontheoutput.Therefore,myresearch interestsmainlyfocusedonGraphicUserInterfacedesign,ComputationOptimizing,or HumanMachineInterfacing. ResearchMethods: TocreatetheGraphicUserInterface,IusedtheVirtualKineticsofMaterialsLaboratory createdbyProf.Garcia,AlexBartolandDavidR.ElyfromSchoolofMaterialsEngineeringatPurdue University.Thesoftwareispythonbasedandisusedtogetinputsimulationdatafromtheuser. However,therearenomethodstodisplaygraphicaloutputsbyusingtheVirtualKineticsofMaterials Laboratorysoftware.Therefore,GTK+toolkithasbeenusedtocreateanothergraphicuserinterface todisplaythegraphicaloutputs.GTK+isanopensourcesoftwarespecializedincreatingGraphicUser Interface. Forthediffusionsimulationbetweendifferentmaterials,materialpropertiesneedtobedefined firstsothattheprogramcancreatethecorrespondinglatticeandproceedthesimulation.Therefore,I createamenufortheprogram,andifclickingthemenubuttonsinthepulldownmenu,thereisa separatewindowforeachmenu.Inthefirstwindow,therewillbesliderbarsorpulldownmenutoget inputinformationfromuser.Alltherequiredinputinthefirstwindowarewhatneededtocreatethe latticeaccordingtotheinputmaterialproperty.Inthesecondwindow,therewillbecontrolstogetthe informationofthesimulationenvironment,suchastemperatureandnumberofstepsofthesimulation. Userwillbeabletostartthesimulationandgeneratealltheoutputsinthesecondwindow.Bydoing this,usercanbeinformedwiththeorderofthesimulationstep,andhaveamuchclearersenseofhow thesimulationwillberunning.Also,therewillbelesspotentialerrorsdonebyusersbydoingthat.Since thesimulationmaytakealongtime,theoutputimagewillbeupdatedasnewsimulationresultsarrived. Togetarealtimeupdatedplot,GTK+toolkithasbeenusedtocreatetheoutputframeandtocreate themainlooptocontinuesthesimulation. KeyResults:
Appendices
Appendix1: Theprogram,whichcontainsthephysicalengineofvacancydiffusionmechanism,hasalready beenprogrammedbyProf.GarciaandDaveR.ElyinMSEdepartmentatPurdue.However,users cannotobservethechangingnumbersofdiffusivitiesduringVacancyDiffusionsimulationsbetween differentmaterials.Also,thereisnoGraphicUserInterfaceforthesimulationtools.Tosolvethe problem,theVirtualKineticsofMaterialsLaboratoryprogramisusedtocreatetheGraphicUser Interface.Also,GTK+toolkithasbeenusedtocreateapopupwindowdisplayingupdateddiffusivities duringthesimulation.Foruserpurpose,thepopupwindowhasbeensettodisplayaplotofdiffusivity versussimulationtime.Duringtheprogrammingprocess,severalproblemswerefoundandsolvedby usingGTK+mainloopandfunctionsinMatplotlibplottinglibrary. Themainchallenge,whichiscreateanupdatedimagewiththerealtimeupdatedinformation, wassolvedbyusingtheGTK+mainloop.Bydoingthat,thefunctionpointerofthesimulationfunction intheprogramhasbeenpassedtotheGTK+mainloop.TheGTK+enginewillrunthefunction automaticallyuntilthereisaFalsevaluereturned.Aslongasthefunctionisrunning,theset_data functionwillbeusedtoupdatethenewlineofdataintheplottingfunction.Theplottingfunctionisusing thematplotliblibrary.Thematplotlibreturnsanobjectreferenceaftereachplottingfunctionbeingcalled, whichallowsmetocontrolthelineobject.Bydoingthat,Iamabletoupdatethelinedrawntoreflect thenewvalues. Appendix2: Thefigure1hasshownthefinalGraphicalUserInterface.Theprogramhasthefollowingmain features: Beabletogenerateamodelforacubiclatticewiththethreedimensionalmeasurementsenteredby usersandthematerialchosenbyusers Simulationtemperatureiscontrolledbyusers Numberofhopsduringthesimulationiscontrolledbyusers BeabletogenerateaGIFfilebasedonallthepicturesgeneratedduringthesimulation UserscanclearallthematerialsgeneratedduringthesimulationbyclicktheRunbuttonbesidethe ResetTag Simulationresultswillbedisplayedgraphicallyduringtheruntimesimulation Also,asshownabove,thefigure2isthemainoutputofthesimulationtool.Itsarealtimeplot simulation.Thefollowingpicturesaresomeoutputpicturesgeneratedbythesimulationtool.