aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-08-05 14:24:11 +0200
committerThomas White <taw@physics.org>2019-08-16 10:26:59 +0200
commitff97bef6953ca6de47d6fe8076e2d3444e48dd1c (patch)
treeb0cd764cd8a159167be3953a48125adc4dd79fc8 /src
parentb4e52c888c13287eeca1a6b4222e9f3038db8b51 (diff)
compare_cell_parameters and compare_reindexed_cell_parameters: Accept 6 tolerances
Diffstat (limited to 'src')
-rw-r--r--src/cell_tool.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/cell_tool.c b/src/cell_tool.c
index cd457f25..a1755f42 100644
--- a/src/cell_tool.c
+++ b/src/cell_tool.c
@@ -77,6 +77,7 @@ static int comparecells(UnitCell *cell, const char *comparecell,
{
UnitCell *cell2;
RationalMatrix *m;
+ double tolerance[6];
cell2 = load_cell_from_file(comparecell);
if ( cell2 == NULL ) {
@@ -90,8 +91,15 @@ static int comparecells(UnitCell *cell, const char *comparecell,
STATUS("------------------> The reference unit cell:\n");
cell_print(cell2);
+ tolerance[0] = ltl;
+ tolerance[1] = ltl;
+ tolerance[2] = ltl;
+ tolerance[3] = atl;
+ tolerance[4] = atl;
+ tolerance[5] = atl;
+
STATUS("------------------> The comparison results:\n");
- if ( !compare_reindexed_cell_parameters(cell, cell2, ltl, atl, csl, &m) ) {
+ if ( !compare_reindexed_cell_parameters(cell, cell2, tolerance, csl, &m) ) {
STATUS("No relationship found between lattices.\n");
return 0;
} else {
@@ -227,6 +235,14 @@ static int find_ambi(UnitCell *cell, SymOpList *sym, double ltl, double atl)
SymOpList *ops;
signed int i[9];
const int maxorder = 3;
+ double tolerance[6];
+
+ tolerance[0] = ltl;
+ tolerance[1] = ltl;
+ tolerance[2] = ltl;
+ tolerance[3] = atl;
+ tolerance[4] = atl;
+ tolerance[5] = atl;
ops = get_pointgroup("1");
if ( ops == NULL ) return 1;
@@ -265,7 +281,7 @@ static int find_ambi(UnitCell *cell, SymOpList *sym, double ltl, double atl)
nc = cell_transform_intmat(cell, m);
- if ( compare_cell_parameters(cell, nc, ltl, atl) ) {
+ if ( compare_cell_parameters(cell, nc, tolerance) ) {
if ( !intmat_is_identity(m) ) add_symop(ops, m);
STATUS("-----------------------------------------------"
"-------------------------------------------\n");