Skip to content

Commit 3c7dfc8

Browse files
author
Marco M. Mosca
committed
Improve docs a bit
1 parent b1ab73b commit 3c7dfc8

File tree

3 files changed

+32
-33
lines changed

3 files changed

+32
-33
lines changed

FindGemmi.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*]]
1919
IF(NOT DEFINED ENV{GEMMI_ROOT})
2020
message(STATUS "Using local package for Gemmi library...")
21-
set(PACKAGE_DIR_GEMMI "${CMAKE_CURRENT_SOURCE_DIR}/External/Gemmi")
21+
set(PACKAGE_DIR_GEMMI "${CMAKE_CURRENT_SOURCE_DIR}/External/gemmi-0.3.3")
2222
ELSE()
2323
message(STATUS "Using system environmental variable package for Gemmi library...")
2424
set(PACKAGE_DIR_GEMMI "$ENV{GEMMI_ROOT}")

README.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Voronoi-based Lattice Distances
2-
The repository contains the code of Voronoi-based Lattice Distances which encodes crystal lattices to Voronoi Domains and runs Voronoi-based metrics to compare them.
3-
The code is written in C++ and CMake. More details on the used metrics can be found in our paper published in the Crystal Research & Technology Journal: [Voronoi-Based Similarity Distances between Arbitrary Crystal Lattices](https://onlinelibrary.wiley.com/doi/10.1002/crat.201900197).
2+
Voronoi-based Lattice Distances encodes crystal lattices to Voronoi Domains and runs Voronoi-based metrics to compare them. More details on the used metrics can be found in our paper published in the Crystal Research & Technology Journal: [Voronoi-Based Similarity Distances between Arbitrary Crystal Lattices](https://onlinelibrary.wiley.com/doi/10.1002/crat.201900197).
43

54
The project has been compiled and run only on `Windows x64`.
65

@@ -16,7 +15,9 @@ The project has been compiled and run only on `Windows x64`.
1615
- `CMake C++ Tools for Windows`
1716
- `Git for Windows`
1817

19-
2. The software and shared libraries below must be installed by the user through Windows installers:
18+
2. Download the repository
19+
20+
3. The software below must be installed through Windows installers:
2021
- [CGAL-4.14.3-Setup.exe](https://github.com/CGAL/cgal/releases/tag/releases%2FCGAL-4.14.3)
2122

2223
Note: Install it in `VoronoiLatticeDistances\External\CGAL-4.14.3` folder and choose `64bit` binaries.
@@ -27,20 +28,36 @@ The project has been compiled and run only on `Windows x64`.
2728

2829
3. Add the following environmental variables as User:
2930
- `VS_DIR`: Path to Visual Studio with all folders (e.g. `Microsoft Visual Studio\2022\Community`)
30-
31-
4. Download the repository
3231

33-
5. Run the following in a `Command Prompt` (no PowerShell) to build and install it:
32+
5. Run the following in a `Command Prompt` (no PowerShell) to install it:
3433
```
3534
"%VS_DIR%\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
3635
cd VoronoiLatticeDistances/windows-setup
3736
dotnet build
3837
dotnet run
3938
```
39+
6. Restart the command prompt and run the executables: `voronoilatticedistances.exe` or `voronoilatticedistances_off.exe`.
4040
41-
## Usage: Run the metric computations
42-
To compute correctly the metrics, it is required that all input CIF files contain the primitive unit cell.
43-
Running the executable `voronoilatticedistances.exe` without parameters, it outputs the usage as follows:
41+
## Usage
42+
To compute correctly the metrics, it is required that all input `CIF` files contain the primitive unit cell.
43+
Run the executable without parameters for the usage. There are following some examples.
44+
### Produce Voronoi-based metrics from CIF files on 5 threads
45+
```
46+
.\voronoilatticedistances.exe -inputdir "path\to\cif_folder" -outputdir "path\to\output_dir" -ds -dh -threads 5
47+
```
48+
### Generate OFF files of Voronoi Domains and their volumes
49+
```
50+
.\voronoilatticedistances.exe -inputdir "path\to\cif_folder" -outputdir "path\to\output_dir" -off -vol
51+
```
52+
### Generate Voronoi Domains for 3D visualization
53+
File `.vtp` can be visualized with [Paraview software](https://www.paraview.org/).
54+
```
55+
.\voronoilatticedistances.exe -inputdir "path\to\cif_folder" -outputdir "path\to\output_dir" -vtp
56+
```
57+
### Produce Voronoi-based metrics from OFF files
58+
```
59+
.\voronoilatticedistances_off.exe -inputdir "path\to\off_folder" -outputdir "path\to\output_dir" -ds -dh
60+
```
4461
4562
Required options:
4663
@@ -61,23 +78,6 @@ Optional commands:
6178
- `-intervals` [integer n (default n=2)] It affects the number of rotation samples to be considered for metric computations (total number of rotations: 4*pi^2*n^3)
6279
- `-threads` [integer t (default t=1)] Rotation samples are divided among t threads
6380
64-
If users want to divide the voronoi cell computation from the metric computation, they can run `voronoilatticedistances_off.exe` to compute only the metrics from OFF files.
65-
66-
Required options:
67-
68-
- `-inputdir` [Input Folder with Voronoi Cell OFF files]
69-
- `-outputdir` [Output Folder to write metric results]
70-
71-
Output options (at least 1 required):
72-
73-
- `-ds` Outputs .csv file with Scale Invariant Distance matrix (n x n) between all n crystal structures
74-
- `-dh` Outputs .csv file with Extended Hausdorff Distance matrix (n x n) between all n crystal structures
75-
76-
Optional commands:
77-
78-
- `-intervals` [integer n (default n=2)] It affects the number of rotation samples to be considered for metric computations (number of rotations: 4*pi^2*n^3)
79-
- `-threads` [integer t (default t=1)] Rotation samples are divided among t threads
80-
8181
## Example of Voronoi Domains
8282
There are following the Voronoi domains of 5 real crystal lattices from the `T2 dataset` used in our experiments: T2-epsilon, T2-delta, T2-beta, T2-gamma and T2-alpha. Plus, the voronoi domains of the standard cubic, body-centred cubic and face-centred cubic lattices.
8383

windows-setup/Setup.fs

+5-6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ let configure (src_dir:string) (variables: string array) =
5252
"-L";
5353
"-G"; "Visual Studio 17 2022";
5454
sprintf @"-DCMAKE_INSTALL_PREFIX=%s" (Path.Combine(src_dir, "install"));
55-
@"-DCMAKE_C_COMPILER=cl";
55+
@"-DCMAKE_C_COMPILER=cl";
56+
@"-DBUILD_EXAMPLES=OFF";
57+
@"-DBUILD_TESTING=OFF";
5658
|]
5759
|> Array.append variables
5860
|> start_process "cmake"
@@ -77,7 +79,6 @@ let main args =
7779
let ext_dir = Path.GetFullPath(@"..\External")
7880
assert Directory.Exists(ext_dir)
7981
let boost_dir = Path.Combine(ext_dir, @"boost_1_69_0")
80-
// Set by Windows installer
8182
let cgal_dir = Path.Combine(ext_dir, @"CGAL-4.14.3")
8283

8384
assert Directory.Exists(ext_dir)
@@ -110,8 +111,6 @@ let main args =
110111
unzip ext_dir path_to_file
111112
File.Delete(path_to_file)
112113

113-
Directory.Move(Path.Combine(ext_dir,"gemmi-0.3.3"), Path.Combine(ext_dir,"Gemmi"))
114-
115114
let function_object_h = Path.Combine(cgal_dir, "include/CGAL/Cartesian/function_objects.h")
116115
assert File.Exists(function_object_h)
117116
let function_object_lines =
@@ -122,7 +121,7 @@ let main args =
122121
File.Delete(function_object_h)
123122
File.WriteAllLines(function_object_h, function_object_lines)
124123

125-
let small_hpp = Path.Combine(ext_dir, "Gemmi/include/gemmi/small.hpp")
124+
let small_hpp = Path.Combine(ext_dir, "gemmi-0.3.3/include/gemmi/small.hpp")
126125
assert File.Exists(small_hpp)
127126
let new_lines = [|
128127
@" if (len > 1) {";
@@ -146,7 +145,7 @@ let main args =
146145
Path.Combine(cgal_dir, @"auxiliary\gmp\lib");
147146
Path.Combine(vtk_dir, @"bin");
148147
Path.Combine(boost_dir, @"lib64-msvc-14.1");
149-
Path.Combine(libxml2_dir, @"bin");
148+
Path.Combine(libxml2_dir, @"bin");
150149
Path.Combine(zlib_dir, @"bin"); |] do
151150
assert Directory.Exists(path_value)
152151
let mutable path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.User);

0 commit comments

Comments
 (0)