Tweaked .gitignore
[cluster_expansion.git] / cluster_expansion.cpp
bloba66e473cb901023fc4eb32f5bfa6e0bd017842a9
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>
12 #include <memory>
15 #include "Lattice.h"
16 #include "LatticeParser.h"
18 #include "Interactions.h"
19 #include "InteractionsParser.h"
21 #include "SymmetryOperations.h"
24 #include "Structure.h"
25 #include "StructureParser.h"
29 void usage(const char *prog)
31 cerr << "usage: " << prog
32 << " structure-ini-file interactions-ini-file"
33 << endl;
35 exit(EXIT_FAILURE);
39 int main(int argc, char* argv[])
41 if (argc != 3)
42 usage(*argv);
44 try {
46 cout << "parsing lattice" << endl;
47 LatticeParser latticeParser(argv[1]);
48 Lattice *lattice = latticeParser.getLattice();
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;
60 StructureParser structureParser(argv[1], argv[2]);
61 Structure structure = structureParser.getStructure();
63 cout << structure.lattice << endl;
64 cout << structure.onSiteEnergy << endl;
66 catch (exception& e) {
67 cerr << "FATAL: " << e.what() << endl;
68 exit(EXIT_FAILURE);
71 exit(EXIT_SUCCESS);