forked from pmla/polyhedral-template-matching
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_ptm.h
141 lines (118 loc) · 5.88 KB
/
index_ptm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#ifndef INDEX_PTM_HPP
#define INDEX_PTM_HPP
#include <stdint.h>
#include <stdbool.h>
//------------------------------------
// definitions
//------------------------------------
#define PTM_NO_ERROR 0
#define PTM_CHECK_FCC (1 << 0)
#define PTM_CHECK_HCP (1 << 1)
#define PTM_CHECK_BCC (1 << 2)
#define PTM_CHECK_ICO (1 << 3)
#define PTM_CHECK_SC (1 << 4)
#define PTM_CHECK_ALL (PTM_CHECK_SC | PTM_CHECK_FCC | PTM_CHECK_HCP | PTM_CHECK_ICO | PTM_CHECK_BCC)
#define PTM_MATCH_NONE 0
#define PTM_MATCH_FCC 1
#define PTM_MATCH_HCP 2
#define PTM_MATCH_BCC 3
#define PTM_MATCH_ICO 4
#define PTM_MATCH_SC 5
#define PTM_ALLOY_NONE 0
#define PTM_ALLOY_PURE 1
#define PTM_ALLOY_L10 2
#define PTM_ALLOY_L12_CU 3
#define PTM_ALLOY_L12_AU 4
#define PTM_ALLOY_B2 5
#define PTM_MAX_NBRS 14
#define PTM_MAX_POINTS 15
#define PTM_MAX_FACETS 24
//------------------------------------
// function declarations
//------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ptm_local_handle* ptm_local_handle_t;
ptm_local_handle_t ptm_initialize_local();
void ptm_uninitialize_local(ptm_local_handle_t ptr);
int ptm_initialize_global();
int ptm_index( ptm_local_handle_t local_handle, int num_points, double* atomic_positions, int32_t* atomic_numbers, int32_t flags, bool topological_ordering, //inputs
int32_t* p_type, int32_t* p_alloy_type, double* p_scale, double* p_rmsd, double* q, double* F, double* F_res, double* U, double* P, int8_t* mapping, double* p_interatomic_distance, double* p_lattice_constant); //outputs
//------------------------------------
// global initialization switch
//------------------------------------
extern bool ptm_initialized;
//------------------------------------
// number of neighbours
//------------------------------------
const int ptm_num_nbrs[6] = {0, 12, 12, 14, 12, 6};
//------------------------------------
// template structures
//------------------------------------
//these point sets have barycentre {0, 0, 0} and are scaled such that the mean neighbour distance is 1
const double ptm_template_sc[7][3] = { { 0. , 0. , 0. },
{ 0. , 0. , -1. },
{ 0. , 0. , 1. },
{ 0. , -1. , 0. },
{ 0. , 1. , 0. },
{ -1. , 0. , 0. },
{ 1. , 0. , 0. } };
const double ptm_template_fcc[13][3] = { { 0. , 0. , 0. },
{ 0. , 0.707106781187, 0.707106781187 },
{ 0. , -0.707106781187, -0.707106781187 },
{ 0. , 0.707106781187, -0.707106781187 },
{ 0. , -0.707106781187, 0.707106781187 },
{ 0.707106781187, 0. , 0.707106781187 },
{ -0.707106781187, 0. , -0.707106781187 },
{ 0.707106781187, 0. , -0.707106781187 },
{ -0.707106781187, 0. , 0.707106781187 },
{ 0.707106781187, 0.707106781187, 0. },
{ -0.707106781187, -0.707106781187, 0. },
{ 0.707106781187, -0.707106781187, 0. },
{ -0.707106781187, 0.707106781187, 0. } };
const double ptm_template_hcp[13][3] = { { 0. , 0. , 0. },
{ 0.707106781186, 0. , 0.707106781186 },
{ -0.235702260395, -0.942809041583, -0.235702260395 },
{ 0.707106781186, 0.707106781186, 0. },
{ -0.235702260395, -0.235702260395, -0.942809041583 },
{ 0. , 0.707106781186, 0.707106781186 },
{ -0.942809041583, -0.235702260395, -0.235702260395 },
{ -0.707106781186, 0.707106781186, 0. },
{ 0. , 0.707106781186, -0.707106781186 },
{ 0.707106781186, 0. , -0.707106781186 },
{ 0.707106781186, -0.707106781186, 0. },
{ -0.707106781186, 0. , 0.707106781186 },
{ 0. , -0.707106781186, 0.707106781186 } };
const double ptm_template_ico[13][3] = { { 0. , 0. , 0. },
{ 0. , 0.525731112119, 0.850650808352 },
{ 0. , -0.525731112119, -0.850650808352 },
{ 0. , 0.525731112119, -0.850650808352 },
{ 0. , -0.525731112119, 0.850650808352 },
{ -0.525731112119, -0.850650808352, 0. },
{ 0.525731112119, 0.850650808352, 0. },
{ 0.525731112119, -0.850650808352, 0. },
{ -0.525731112119, 0.850650808352, 0. },
{ -0.850650808352, 0. , -0.525731112119 },
{ 0.850650808352, 0. , 0.525731112119 },
{ 0.850650808352, 0. , -0.525731112119 },
{ -0.850650808352, 0. , 0.525731112119 } };
const double ptm_template_bcc[15][3] = { { 0. , 0. , 0. },
{ -0.541451884327, -0.541451884327, -0.541451884327 },
{ 0.541451884327, 0.541451884327, 0.541451884327 },
{ 0.541451884327, -0.541451884327, -0.541451884327 },
{ -0.541451884327, 0.541451884327, 0.541451884327 },
{ -0.541451884327, 0.541451884327, -0.541451884327 },
{ 0.541451884327, -0.541451884327, 0.541451884327 },
{ -0.541451884327, -0.541451884327, 0.541451884327 },
{ 0.541451884327, 0.541451884327, -0.541451884327 },
{ 0. , 0. , -1.082903768655 },
{ 0. , 0. , 1.082903768655 },
{ 0. , -1.082903768655, 0. },
{ 0. , 1.082903768655, 0. },
{ -1.082903768655, 0. , 0. },
{ 1.082903768655, 0. , 0. } };
#ifdef __cplusplus
}
#endif
#endif