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.

26 Introduction and usage of CMRAt the beginning, right after the imports, the definitions describe the datasets (ABO 3 , A, B, X) that we need to retrieve from the database and the fieldsthat we would like to see in the output (fields of interest):ABO3 = {”name ” : ”ABO3” ,” name value ” : {” d b u s e r ” : ” i v c a ”} ,” keywords ” : [ ”ABO3” ] ,” f i e l d s o f i n t e r e s t ” : [ ” P o t e n t i a l E n e r g y as e ABO3” ,”A” ,”B” ] }. . .<strong>The</strong> name value (db user=ivca) and the keywords (ABO3) define how ABO 3calculations are identified. <strong>The</strong> fields of interest contains information aboutfields that we would like to see in the output while the name.field name is usedin the definition of the combination criterion:c o m b c r i t = [ ( ”ABO3.A” , ”A.A” ) ,(”ABO3.B” , ”B.A” ) ,(”ABO3.X” , ”X.A” ) ]For every quadruple that fits the criteria, we determine the hof by writing itas an equation:c a l c = ”ABO3. P o t e n t i a l E n e r g y ”c a l c += ”− ABO3. nA∗A. P o t e n t i a l E n e r g y /A. nA”c a l c += ”− ABO3. nB∗B. P o t e n t i a l E n e r g y /B. nA”c a l c += ”− X. P o t e n t i a l E n e r g y ”e v a l u a t i o n s = {” e h e a t o f f o r m a t i o n ”:”(% s )∗% f ” % ( c a l c , h a r t r e e )}keywords = [ ” ABO3 hof ” ]<strong>The</strong> last step is to add some keywords to identify the results and create aninstance of the GroupingAgent and call its run method. During the run thecreated db-files (results) are written directly to the db-file repository.agent = GroupingAgent ( DBReader ( ) ,[ABO3, A, B, X] ,c o m b i n a t i o n c r i t e r i o n s ,e v a l u a t i o n s ,d b f i l e s =(”” , ” members only ” ,{” db keywords ” : keywords } ) )agent . run ( )Instead of writing the data back to the database we can print it as well ontothe screen and create a spreadsheet in the csv format. <strong>The</strong> following slightlymodified code shows how:. . .dc = D a t a C o l l e c t i o n ( )agent = GroupingAgent ( DBReader ( ) ,c r i t e r i o n s ,c o m b i n a t i o n c r i t e r i o n s ,e v a l u a t i o n s ,d a t a c o l l e c t i o n = dc )

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

Saved successfully!

Ooh no, something went wrong!