From 8a24c6c3ca54d4c21d27f0b5910f3e5732c301b9 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Thu, 30 Jul 2020 14:48:08 -0400 Subject: [PATCH] Modified the ResolveAutomorphisms() routine once again, to break symmetry of all elements in all symmetric partitions, rather than (as previously done) all elements in each partition, before re- running iterations to convergence. This solves the problem of having a very large number of partitions with a few elements each taking a long time to run. --- base/netcmp.c | 64 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/base/netcmp.c b/base/netcmp.c index 9063451..1bc7fa2 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -5841,21 +5841,20 @@ int ResolveAutomorphsByProperty() /* *------------------------------------------------------------------------- * - * ResolveAutormorphisms -- + * ResolveElementAutomorphisms -- * - * Arbitrarily equivalence one pair of elements within an automorphic class + * Apply arbitrary symmetry breaking to symmetric element lists, then + * iterate exhaustively to resolve all automorphisms. * * Return value is the same as VerifyMatching() * *------------------------------------------------------------------------- */ -int ResolveAutomorphisms() +int ResolveElementAutomorphisms() { struct ElementClass *EC; - struct NodeClass *NC; struct Element *E; - struct Node *N; int C1, C2; for (EC = ElementClasses; EC != NULL; EC = EC->next) { @@ -5891,10 +5890,38 @@ int ResolveAutomorphisms() E1 = E1->next; E2 = E2->next; } - goto converge; } } + FractureElementClass(&ElementClasses); + FractureNodeClass(&NodeClasses); + ExhaustiveSubdivision = 1; + while (!Iterate() && VerifyMatching() != -1); + return(VerifyMatching()); +} + +/* + *------------------------------------------------------------------------- + * + * ResolveNodeAutomorphisms -- + * + * Apply arbitrary symmetry breaking to symmetric node lists, then iterate + * exhaustively to resolve all automorphisms. Normally, all automorphisms + * should be resolved by ResolveElementAutomorphisms(). It is likely true + * that this routine will never run, by definition. + * + * Return value is the same as VerifyMatching() + * + *------------------------------------------------------------------------- + * + */ + +int ResolveNodeAutomorphisms() +{ + struct Node *N; + struct NodeClass *NC; + int C1, C2; + for (NC = NodeClasses; NC != NULL; NC = NC->next) { struct Node *N1, *N2; C1 = C2 = 0; @@ -5928,11 +5955,9 @@ int ResolveAutomorphisms() N1 = N1->next; N2 = N2->next; } - goto converge; } } - converge: FractureElementClass(&ElementClasses); FractureNodeClass(&NodeClasses); ExhaustiveSubdivision = 1; @@ -5940,6 +5965,29 @@ int ResolveAutomorphisms() return(VerifyMatching()); } +/* + *------------------------------------------------------------------------- + * + * ResolveAutormorphisms -- + * + * Arbitrarily equivalence one pair of elements within an automorphic class + * + * Return value is the same as VerifyMatching() + * + *------------------------------------------------------------------------- + */ + +int ResolveAutomorphisms() +{ + int result; + + result = ResolveElementAutomorphisms(); + if (result != 0) + result = ResolveNodeAutomorphisms(); + + return result; +} + /*------------------------------------------------------*/ /* PermuteSetup -- */ /* Add an entry to a cell's "permutes" linked list. */