changed parsing again
[cluster_expansion.git] / cluster_expansion.cpp
bloba321873045d42aa5de821eb70ad59b74435db207
1 /*
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
9 */
11 #include <iostream>
14 #include "Lattice.h"
15 #include "LatticeParser.h"
17 #include "Interactions.h"
18 #include "InteractionsParser.h"
20 #include "SymmetryOperations.h"
23 #include "Structure.h"
24 #include "StructureParser.h"
28 void usage(const char *prog)
30 cerr << "usage: " << prog
31 << " structure-ini-file interactions-ini-file"
32 << endl;
34 exit(EXIT_FAILURE);
38 int main(int argc, char* argv[])
40 if (argc != 3)
41 usage(*argv);
43 try {
45 cout << "parsing lattice" << endl;
46 LatticeParser latticeParser(argv[1]);
47 Lattice lattice = latticeParser.getLattice();
48 cout << "parsed!!" << endl;
49 cout << lattice;
51 cout << "parsing interactions" << endl;
52 InteractionsParser interactionsParser(argv[2]);
53 Interactions interactions = interactionsParser.getInteractions();
55 cout << "interactions (before assessment):" << endl << interactions << endl;
56 lattice.assessInteractions(interactions);
57 cout << "interactions (after assessment):" << endl << interactions;
61 StructureParser structureParser(argv[1], argv[2]);
62 Structure structure = structureParser.getStructure();
64 cout << structure.lattice << endl;
66 cout << structure.onSiteEnergy << endl;
70 catch (exception& e) {
71 cerr << "FATAL: " << e.what() << endl;
72 exit(EXIT_FAILURE);
75 exit(EXIT_SUCCESS);