Skip to content
forked from duck10/S6G6

Distance calculations for lattices

Notifications You must be signed in to change notification settings

nsls-ii-mx/S6G6

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

s6g6 contains a library of functions for calculating distances between lattices. In this code base, there are two types of distance calculations: S6 and G6 distances. G6 was described by Andrews&Bernstein, 1988 and 2014. S6 was described by Andrews,Bernstein, and Sauter, 2014 (two papers).

In this repository, there is support code for reading unit cell information, doing Niggli or Selling (Delone/Delaunay) reduction, creating S6 and G6 objects, and computing the distance between a pair of lattices.

The test code (s6g6_test.cpp) will read a file of unit cells,usually prefixed by the lattice type (P F I R A B C), followed by the unit cell parameters. The test program will then calculate all the distances between each pair of input cells.

The module Rcpp_distances.cpp is designed to accept (from R) 13 command line arguments: DistanceType, lattice type 1, unit cell parameters for cell #1, lattice type 2, unit cell parameters for cell #2. The Distance type should either "N" or "S", "N" for Niggli reduction and distance calculation in G6, "S" for Selling reduction and distance calculation in S6.

A sample input to Rcpp_distances: S P 10 10 10 90 90 90 F 11 11 11 91 91 91

NOTE: for the test code (only), there are alternate input types available. Instead of a lattice type, "S" will indicate that the input is in Selling parameters (the scalars of Delone reduction), and "G" will indicate that input is in G6 parameters. All input types can be mixed as they are all converted to the same form in the programs.

NOTE: the two distance functions (CS6Dist and NCDist) REQUIRE that the input be reduced using the appropriate method. Inputing unreduced cells will return invalid results that might appear valid. There is no internal check that the inputs are reduced.

For running cmake on Windows computers, the paths for includes and binaries may need to be edited in the 4 *.cmake files in cmake/modules to correspond to particular windows installations of R.

Sample input and output for s6g6_test

p 10 10 10 90 90 90 f 10 10 10 90 90 90 i 10 10 10 90 90 90 end

0 10.00000 10.00000 10.00000 1.57080 1.57080 1.57080 1 7.07107 7.07107 7.07107 2.09440 2.09440 1.57080 0 0.00000 0.00000 0.00000 -100.00000 -100.00000 -100.00000 1-25.00000 -25.00000 0.00000 -25.00000 -25.00000 -0.00000 0 1 132.288

0 10.00000 10.00000 10.00000 1.57080 1.57080 1.57080 2 8.66025 8.66025 8.66025 1.91063 1.91063 1.91063 0 0.00000 0.00000 0.00000 -100.00000 -100.00000 -100.00000 2-25.00000 -25.00000 -25.00000 -25.00000 -25.00000 -25.00000 0 2 136.931

1 7.07107 7.07107 7.07107 2.09440 2.09440 1.57080 2 8.66025 8.66025 8.66025 1.91063 1.91063 1.91063 1 -25.00000 -25.00000 0.00000 -25.00000 -25.00000 -0.00000 2 -25.00000 -25.00000 -25.00000 -25.00000 -25.00000 -25.00000 1 2 35.3553

About

Distance calculations for lattices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 55.4%
  • C 37.1%
  • CMake 7.4%
  • R 0.1%