summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-01-14 15:48:14 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-01-14 15:48:14 +0100
commit6ae3cc6b8105c37c6fea840af2395e1972812387 (patch)
tree31057dd884815ea35fc0fe577959b69f6f69d953
parentdedcfe0c9aa1ae79dc4d26c559f239571bb26394 (diff)
downloadcode-6ae3cc6b8105c37c6fea840af2395e1972812387.tar.gz
code-6ae3cc6b8105c37c6fea840af2395e1972812387.tar.bz2
code-6ae3cc6b8105c37c6fea840af2395e1972812387.zip
Catch errors in the J-perturbing loop and save entire vectors, not just their norm difference.
-rw-r--r--langevin.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/langevin.cpp b/langevin.cpp
index acac6c7..a4c9cf3 100644
--- a/langevin.cpp
+++ b/langevin.cpp
@@ -1,3 +1,4 @@
+#include <exception>
#include <getopt.h>
#include <eigen3/Eigen/LU>
@@ -131,7 +132,7 @@ int main(int argc, char* argv[]) {
// simulation parameters
double ε = 1e-4;
- double εJ = 5e-2;
+ double εJ = 1e-2;
double δ = 1e-2; // threshold for determining saddle
double Δ = 1e-3;
double γ = 1e-2; // step size
@@ -219,10 +220,14 @@ int main(int argc, char* argv[]) {
iterateOver<Scalar, p>(Jp, perturbJ);
- Vector zSaddleNew = findSaddle(Jp, zSaddle, ε);
- Vector zSaddlePrevNew = findSaddle(Jp, zSaddlePrev, ε);
+ try {
+ Vector zSaddleNew = findSaddle(Jp, zSaddle, ε);
+ Vector zSaddlePrevNew = findSaddle(Jp, zSaddlePrev, ε);
- std::cout << (zSaddleNew - zSaddlePrevNew).norm() << std::endl;
+ std::cout << zSaddleNew.transpose() << " " << zSaddlePrevNew.transpose() << std::endl;
+ } catch (std::exception& e) {
+ std::cerr << "Couldn't find a saddle with new couplings, skipping." << std::endl;
+ }
}
return 0;