summaryrefslogtreecommitdiff
path: root/ciamarra.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-03-22 16:37:13 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-03-22 16:37:13 +0100
commitfadb6926d8e07ecacc9e0d1031a567494db4730a (patch)
tree35453921aca184bd824e164a8490f714822984e3 /ciamarra.cpp
parentc6076430a445ba07866eb7fbdb083f016be57894 (diff)
downloadlattice_glass-fadb6926d8e07ecacc9e0d1031a567494db4730a.tar.gz
lattice_glass-fadb6926d8e07ecacc9e0d1031a567494db4730a.tar.bz2
lattice_glass-fadb6926d8e07ecacc9e0d1031a567494db4730a.zip
Split up functions, tired to generize in preparation for implementing Biroli-Mezard.
Diffstat (limited to 'ciamarra.cpp')
-rw-r--r--ciamarra.cpp79
1 files changed, 79 insertions, 0 deletions
diff --git a/ciamarra.cpp b/ciamarra.cpp
new file mode 100644
index 0000000..8449cbb
--- /dev/null
+++ b/ciamarra.cpp
@@ -0,0 +1,79 @@
+#include <iostream>
+
+#include "glass.hpp"
+
+
+void print(const CiamarraSystem<2>& s) {
+ for (const Vertex<2, CiamarraState<2>>& v : s.vertices) {
+ if (v.state(0) == 1 && v.state(1) == 0) {
+ std::cerr << "▶";
+ } else if (v.state(0) == -1 && v.state(1) == 0) {
+ std::cerr << "◀";
+ } else if (v.state(0) == 0 && v.state(1) == -1) {
+ std::cerr << "▲";
+ } else if (v.state(0) == 0 && v.state(1) == 1) {
+ std::cerr << "▼";
+ } else if (v.state(0) == 0 && v.state(1) == 0) {
+ std::cerr << " ";
+ } else {
+ std::cerr << "X";
+ }
+
+ if (v.position(0) == s.L - 1) {
+ std::cerr << std::endl;
+ }
+ }
+}
+
+template <unsigned D> Vector<D> randomVector(unsigned L, Rng& r) {
+ Vector<D> x;
+ for (unsigned i = 0; i < D; i++) {
+ x[i] = r.uniform((unsigned)0, L - 1);
+ }
+ return x;
+}
+
+int main() {
+ const unsigned D = 3;
+ unsigned L = 15;
+ unsigned Nmin = 2e2;
+ unsigned Nmax = 2e5;
+ double Tmin = 0.04;
+ double Tmax = 0.2;
+ double δT = 0.02;
+
+ CiamarraSystem<D> s(L);
+
+ Rng r;
+
+ double z = exp(1 / 0.08);
+
+ while (s.density() < 0.818) {
+ s.sweepGrandCanonical(z, r);
+ }
+
+ if (!s.compatible()) {
+ std::cerr << "Net compatible!" << std::endl;
+ return 1;
+ }
+
+ std::cerr << "Found state with appropriate density." << std::endl;
+
+ CiamarraSystem<D> s0 = s;
+
+ std::vector<Matrix<D>> ms = generateTorusMatrices<D>();
+
+ unsigned n = 1;
+ for (unsigned i = 0; i < 1e5; i++) {
+ if (n < 20 * log(i + 1)) {
+ n++;
+ std::cout << i << " " << s.overlap(s0) << std::endl;
+ }
+ s.sweepLocal(r);
+// s.sweepSwap(r);
+// s.swendsenWang(Transformation<D>(L, ms, r), r);
+ }
+
+ return 0;
+}
+