2 * Determination of lateral interaction parameters on a c(2x2) square lattice
3 * using linear combinations to express each interaction and then counting
4 * them in terms of cluster-expansion coefficients
6 * Michael Rieger, FHI, 2008
7 * rieger@fhi-berlin.mpg.de
13 // some legacy stuff (to be removed)
18 #include "LatticeParser.h"
20 #include "Interactions.h"
21 #include "InteractionsParser.h"
24 #include "SymmetryParser.h"
27 void usage(const char *prog
)
29 cerr
<< "usage: " << prog
30 << " structure-ini-file interactions-ini-file"
37 void panic(char *msg
, ...)
42 fprintf(stderr
, "FATAL: ");
43 vfprintf(stderr
, msg
, vargs
);
44 fprintf(stderr
, "\n");
49 int main(int argc
, char* argv
[])
55 LatticeParser
latticeParser(argv
[1]);
56 Lattice lattice
= latticeParser
.getLattice();
58 cout
<< "lattice:" << endl
<< lattice
.adsorbates
;
59 cout
<< "underlying surface:" << endl
<< lattice
.surface
;
61 InteractionsParser
interactionsParser(argv
[2]);
62 Interactions interactions
= interactionsParser
.getInteractions();
64 cout
<< "interactions:" << endl
;
65 Interactions::iterator interaction
= interactions
.begin();
66 Interactions::iterator last_interaction
= interactions
.end();
67 while (interaction
!= last_interaction
) {
68 cout
<< "interaction " << interaction
->name
<< ": ";
69 Directions::iterator direction
= interaction
->directions
.begin();
70 Directions::iterator last_direction
= interaction
->directions
.end();
71 while (direction
!= last_direction
) {
72 cout
<< "(" << direction
->x
<< "/"
73 << direction
->y
<< "), ";
84 catch (exception
& e
) {
85 cerr
<< "FATAL: " << e
.what() << endl
;