summaryrefslogtreecommitdiff
path: root/src/animate_fracture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/animate_fracture.cpp')
-rw-r--r--src/animate_fracture.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/animate_fracture.cpp b/src/animate_fracture.cpp
index c3b4a69..9d875e6 100644
--- a/src/animate_fracture.cpp
+++ b/src/animate_fracture.cpp
@@ -31,20 +31,20 @@ int main(int argc, char* argv[]) {
int opt;
unsigned N = 1;
- double Lx = 16.0;
- double Ly = 16.0;
+ unsigned n = 16;
+ double a = 16.0;
double beta = 0.5;
- while ((opt = getopt(argc, argv, "X:Y:N:b:")) != -1) {
+ while ((opt = getopt(argc, argv, "n:a:N:b:")) != -1) {
switch (opt) {
case 'N':
N = (unsigned)atof(optarg);
break;
- case 'X':
- Lx = atof(optarg);
+ case 'n':
+ n = atoi(optarg);
break;
- case 'Y':
- Ly = atof(optarg);
+ case 'a':
+ a = atof(optarg);
break;
case 'b':
beta = atof(optarg);
@@ -57,16 +57,16 @@ int main(int argc, char* argv[]) {
cholmod_common c;
CHOL_F(start)(&c);
- animate meas(Lx, Ly, 700, argc, argv);
+ animate meas(sqrt(2*n *a), sqrt( 2*n / a), 700, argc, argv);
randutils::auto_seed_128 seeds;
std::mt19937 rng{seeds};
for (unsigned trial = 0; trial < N; trial++) {
- graph G(Lx, Ly, rng);
+ graph G(n, a, rng);
elastic_network elastic_network(G, &c);
elastic_network.set_thresholds(beta, rng);
- elastic_network.fracture(meas);
+ elastic_network.fracture(meas, true);
if (quit.load())
break;