12.07.2015 Views

The Computational Materials Repository

The Computational Materials Repository

The Computational Materials Repository

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

22 Introduction and usage of CMRimport cmr . . .c a l c = GPAW( ) . . .cmr params = {” db keywords ” : [ ”ABO3” , ”CsZnO3 ” ] ,” d b s c r i p t s ” : [ ” CsZnO3 . py ” ] ,” d b f i l e s ” : [ ” CsZnO3 . t x t ” ] ,”name ” : ” CsZnO3” ,”A” : ” Cs ” ,”B” : ” Zn” ,”X” : ”O3”}c a l c . w r i t e ( ” . db ” , cmr params=cmr params )Figure 2.3: A small python script to add an arbitrary result to the db-file repository.GPAW provides the ability to use its native write function.new so-called fields which are name–value pairs. <strong>The</strong> last field in the examplefor example has the name “X” with the value “O3”. Some of the informationcarried by the fields or keywords are in this example somehow redundant. It is ofcourse possible just from the identity of the atoms and their positions to recoverwhich metal atom is in fact the “A” atom in the perovskite structure, but itmay be convenient sometimes to add the information explicitly for fast and easyretrieval. If other programs than GPAW are used or if one wants to “manually”add information to the db-files this can be done as shown in figure 2.4.importcmrcmr params = {” input ” : ” CsZnO3 . xxx ” ,” output ” : ” . db ” ,” db keywords ” : [ ”ABO3” , ”CsZnO3” , ” hof ” ] ,” d b s c r i p t s ” : [ ” CsZnO3 . py ” ] ,” d b f i l e s ” : [ ” CsZnO3 . t x t ” ] ,”name ” : ”CsZnKO3” ,”A” : ” Cs ” ,”B” : ” Zn” ,”X” : ”O3”}cmr . c o n v e r t ( cmr params )Figure 2.4: A small python script to add an arbitrary result to the db-file repository.All extra fields and keywords are defined in a python dictionary and passedas an extra argument to cmr.convert. ”input” specifies the file that shouldbe imported and ”output” the name of the output file - using ”.db” as a namesignals that we are not interested in a real filename and would like the outputto be written directly to the db-file repository (from where it will be added tothe database). ”db keywords” is a list of keywords that identify this calculation,db scripts and db files take a list of filenames that will be included - and finally

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!