~ubuntu-branches/ubuntu/trusty/psicode/trusty

« back to all changes in this revision

Viewing changes to src/bin/optking/char_table.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*! \file
 
2
    \ingroup OPTKING
 
3
    \brief This file contains functions which provide information
 
4
     from the group character tables as given in Cotton 
 
5
*/
 
6
 
 
7
#include <cstdlib>
 
8
#include <cstring>
 
9
#include <cstdio>
 
10
#include <cctype>
 
11
#include <libciomr/libciomr.h>
 
12
 
 
13
#define EXTERN
 
14
#include "opt.h"
 
15
#undef EXTERN
 
16
 
 
17
namespace psi { namespace optking {
 
18
 
 
19
int **get_char_table(char *ptgrp);    /* returns the character table */
 
20
int get_nirreps(char *ptgrp);      /* "     " number of irreps */
 
21
const char **get_irrep_labels(char *ptgrp); /* "     " number of symmetry operations */
 
22
const char **get_symm_ops(char *ptgrp);     /* "     " symm operation labels */
 
23
int *get_ops_coeffs(char *ptgrp);     /* "     " coefficients of the symmetry operations */
 
24
int get_num_ops(char *ptgrp);         /* "     " number of operations */
 
25
int get_num_classes(char *ptgrp);     /* "     " number of classes of operations */
 
26
int *get_ops_in_class(char *ptgrp, int nirreps);
 
27
 
 
28
int **get_char_table(char *ptgrp) {
 
29
 
 
30
   int nirreps,i,j;
 
31
   int **table;
 
32
   int count;
 
33
 
 
34
   static int C1[1] = {1};
 
35
 
 
36
/* This works for CS, CI and C2 */
 
37
   static int CS[4] = { 1, 1,
 
38
                        1,-1};
 
39
 
 
40
/* This works for C2V and D2 */
 
41
   static int D2[16] = { 1, 1, 1, 1,
 
42
                         1, 1,-1,-1,
 
43
                         1,-1, 1,-1,
 
44
                         1,-1,-1, 1};
 
45
 
 
46
   static int C2H[16] = { 1, 1, 1, 1,
 
47
                          1,-1, 1,-1,
 
48
                          1, 1,-1,-1,
 
49
                          1,-1,-1, 1};
 
50
 
 
51
/* This works for C3V and D3 */
 
52
   static int D3[9] = { 1, 1, 1,
 
53
                        1, 1,-1,
 
54
                        2,-1, 0};
 
55
 
 
56
/* This works for C4V, D2D and D4 */
 
57
   static int D4[25] = { 1, 1, 1, 1, 1,
 
58
                         1, 1, 1,-1,-1,
 
59
                         1,-1, 1, 1,-1,
 
60
                         1,-1, 1,-1, 1,
 
61
                         2, 0,-2, 0, 0};
 
62
 
 
63
/* This works for O and TD point groups */
 
64
   static int TD[25] = { 1, 1, 1, 1, 1,
 
65
                           1, 1, 1,-1,-1,
 
66
                           2,-1, 2, 0, 0,
 
67
                           3, 0,-1, 1,-1,
 
68
                           3, 0,-1,-1, 1};
 
69
 
 
70
/* This works for C6V and D6 */
 
71
   static int D6[36] = { 1, 1, 1, 1, 1, 1,
 
72
                         1, 1, 1, 1,-1,-1,
 
73
                         1,-1, 1,-1, 1,-1,
 
74
                         1,-1, 1,-1,-1, 1,
 
75
                         2, 1,-1,-2, 0, 0,
 
76
                         2,-1,-1, 2, 0, 0};
 
77
 
 
78
/* This works for D3D and D3H */
 
79
   static int D3D[36] = { 1, 1, 1, 1, 1, 1,
 
80
                          1, 1,-1, 1, 1,-1,
 
81
                          2,-1, 0, 2,-1, 0,
 
82
                          1, 1, 1,-1,-1,-1,
 
83
                          1, 1,-1,-1,-1, 1,
 
84
                          2,-1, 0,-2, 1, 0};
 
85
 
 
86
   static int D2H[64] = { 1, 1, 1, 1, 1, 1, 1, 1,
 
87
                          1, 1,-1,-1, 1, 1,-1,-1,
 
88
                          1,-1, 1,-1, 1,-1, 1,-1,
 
89
                          1,-1,-1, 1, 1,-1,-1, 1,
 
90
                          1, 1, 1, 1,-1,-1,-1,-1,
 
91
                          1, 1,-1,-1,-1,-1, 1, 1,
 
92
                          1,-1, 1,-1,-1, 1,-1, 1,
 
93
                          1,-1,-1, 1,-1, 1, 1,-1};
 
94
 
 
95
 
 
96
   static int D4H[100] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 
97
                           1, 1, 1,-1,-1, 1, 1, 1,-1,-1,
 
98
                           1,-1, 1, 1,-1, 1,-1, 1, 1,-1,
 
99
                           1,-1, 1,-1, 1, 1,-1, 1,-1, 1,
 
100
                           2, 0,-2, 0, 0, 2, 0,-2, 0, 0,
 
101
                           1, 1, 1, 1, 1,-1,-1,-1,-1,-1,
 
102
                           1, 1, 1,-1,-1,-1,-1,-1, 1, 1,
 
103
                           1,-1, 1, 1,-1,-1, 1,-1,-1, 1,
 
104
                           1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
 
105
                           2, 0,-2, 0, 0,-2, 0, 2, 0, 0};
 
106
 
 
107
   static int OH[100] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 
108
                          1, 1,-1,-1, 1, 1,-1, 1, 1,-1,
 
109
                          2,-1, 0, 0, 2, 2, 0,-1, 2, 0,
 
110
                          3, 0,-1, 1,-1, 3, 1, 0,-1,-1,
 
111
                          3, 0, 1,-1,-1, 3,-1, 0,-1, 1,
 
112
                          1, 1, 1, 1, 1,-1,-1,-1,-1,-1,
 
113
                          1, 1,-1,-1, 1,-1, 1,-1,-1, 1,
 
114
                          2,-1, 0, 0, 2,-2, 0, 1,-2, 0,
 
115
                          3, 0,-1, 1,-1,-3,-1, 0, 1, 1,
 
116
                          3, 0, 1,-1,-1,-3, 1, 0, 1,-1};
 
117
 
 
118
   static int D6H[144] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 
119
                           1, 1, 1, 1,-1,-1, 1, 1, 1, 1,-1,-1,
 
120
                           1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
 
121
                           1,-1, 1,-1,-1, 1, 1,-1, 1,-1,-1, 1,
 
122
                           2, 1,-1,-2, 0, 0, 2, 1,-1,-2, 0, 0,
 
123
                           2,-1,-1, 2, 0, 0, 2,-1,-1, 2, 0, 0,
 
124
                           1, 1, 1, 1, 1, 1,-1,-1,-1,-1,-1,-1,
 
125
                           1, 1, 1, 1,-1,-1,-1,-1,-1,-1, 1, 1,
 
126
                           1,-1, 1,-1, 1,-1,-1, 1,-1, 1,-1, 1,
 
127
                           1,-1, 1,-1,-1, 1,-1, 1,-1, 1, 1,-1,
 
128
                           2, 1,-1,-2, 0, 0,-2,-1, 1, 2, 0, 0,
 
129
                           2,-1,-1, 2, 0, 0,-2, 1, 1,-2, 0, 0};
 
130
 
 
131
   nirreps = get_nirreps(ptgrp);
 
132
   table = init_int_matrix(nirreps,nirreps);
 
133
 
 
134
   count = 0;
 
135
 
 
136
if (strcmp(ptgrp,"C1 ") == 0)
 
137
   table[0][0] = 1;
 
138
 
 
139
else if ((strcmp(ptgrp,"CS ") == 0) || (strcmp(ptgrp,"CI ") == 0) || (strcmp(ptgrp,"C2 ") == 0)) {
 
140
   for (i=0;i<nirreps;++i)
 
141
      for (j=0;j<nirreps;++j)
 
142
         table[i][j] = CS[count++];
 
143
   }
 
144
else if ((strcmp(ptgrp,"D2 ") == 0) || (strcmp(ptgrp,"C2V") == 0)) {
 
145
   for (i=0;i<nirreps;++i)
 
146
      for (j=0;j<nirreps;++j)
 
147
         table[i][j] = D2[count++];
 
148
   }
 
149
else if (strcmp(ptgrp,"C2H") == 0) {
 
150
   for (i=0;i<nirreps;++i)
 
151
      for (j=0;j<nirreps;++j)
 
152
         table[i][j] = C2H[count++];
 
153
   }
 
154
else if ((strcmp(ptgrp,"C3V") == 0) || (strcmp(ptgrp,"D3 ") == 0)) {
 
155
   for (i=0;i<nirreps;++i)
 
156
      for (j=0;j<nirreps;++j)
 
157
         table[i][j] = D3[count++];
 
158
   }
 
159
else if ((strcmp(ptgrp,"C4V") == 0) || (strcmp(ptgrp,"D2D") == 0) || (strcmp(ptgrp,"D4 ") == 0)) {
 
160
   for (i=0;i<nirreps;++i)
 
161
      for (j=0;j<nirreps;++j)
 
162
         table[i][j] = D4[count++];
 
163
   }
 
164
else if ((strcmp(ptgrp,"O  ") == 0) || (strcmp(ptgrp,"TD ") == 0)) {
 
165
   for (i=0;i<nirreps;++i)
 
166
      for (j=0;j<nirreps;++j)
 
167
         table[i][j] = TD[count++];
 
168
   }
 
169
else if ((strcmp(ptgrp,"C6V") == 0) || (strcmp(ptgrp,"D6 ") == 0)) {
 
170
   for (i=0;i<nirreps;++i)
 
171
      for (j=0;j<nirreps;++j)
 
172
         table[i][j] = D6[count++];
 
173
   }
 
174
else if ((strcmp(ptgrp,"D3D") == 0) || (strcmp(ptgrp,"D3H") == 0)) {
 
175
   for (i=0;i<nirreps;++i)
 
176
      for (j=0;j<nirreps;++j)
 
177
         table[i][j] = D3D[count++];
 
178
   }
 
179
else if (strcmp(ptgrp,"D2H") == 0) {
 
180
   for (i=0;i<nirreps;++i)
 
181
      for (j=0;j<nirreps;++j)
 
182
         table[i][j] = D2H[count++];
 
183
   }
 
184
else if (strcmp(ptgrp,"D4H") == 0) {
 
185
   for (i=0;i<nirreps;++i)
 
186
      for (j=0;j<nirreps;++j)
 
187
         table[i][j] = D4H[count++];
 
188
   }
 
189
else if (strcmp(ptgrp,"OH ") == 0) {
 
190
   for (i=0;i<nirreps;++i)
 
191
      for (j=0;j<nirreps;++j)
 
192
         table[i][j] = OH[count++];
 
193
   }
 
194
else if (strcmp(ptgrp,"D6H") == 0) {
 
195
   for (i=0;i<nirreps;++i)
 
196
      for (j=0;j<nirreps;++j)
 
197
         table[i][j] = D6H[count++];
 
198
   }
 
199
else
 
200
   table[0][0] = 1;
 
201
 
 
202
 
 
203
 
 
204
  return table;
 
205
}
 
206
 
 
207
 
 
208
 
 
209
 
 
210
int get_nirreps(char *ptgrp) {
 
211
 
 
212
if (strcmp(ptgrp,"C1 ") == 0)
 
213
   return 1;
 
214
else if ((strcmp(ptgrp,"CS ") == 0) || (strcmp(ptgrp,"CI ") == 0) || (strcmp(ptgrp,"C2 ") == 0))
 
215
   return 2;
 
216
else if ((strcmp(ptgrp,"C2V") == 0) || (strcmp(ptgrp,"D2 ") == 0))
 
217
   return 4;
 
218
else if (strcmp(ptgrp,"C2H") == 0)
 
219
   return 4;
 
220
else if ((strcmp(ptgrp,"C3V") == 0) || (strcmp(ptgrp,"D3 ") == 0))
 
221
   return 3;
 
222
else if ((strcmp(ptgrp,"C5V") == 0) || (strcmp(ptgrp,"D5") == 0))
 
223
   return 4;
 
224
else if ((strcmp(ptgrp,"C4V") == 0) || (strcmp(ptgrp,"D2D") == 0) || (strcmp(ptgrp,"D4 ") == 0))
 
225
   return 5;
 
226
else if ((strcmp(ptgrp,"O  ") == 0) || (strcmp(ptgrp,"TD ") == 0))
 
227
   return 5;
 
228
else if ((strcmp(ptgrp,"C6V") == 0) || (strcmp(ptgrp,"D6 ") == 0))
 
229
   return 6;
 
230
else if ((strcmp(ptgrp,"D3D") == 0) || (strcmp(ptgrp,"D3H") == 0))
 
231
   return 6;
 
232
else if (strcmp(ptgrp,"D4D") == 0)
 
233
   return 7;
 
234
else if (strcmp(ptgrp,"D2H") == 0)
 
235
   return 8;
 
236
else if ((strcmp(ptgrp,"D5D") == 0) || (strcmp(ptgrp,"D5H") == 0))
 
237
   return 8;
 
238
else if (strcmp(ptgrp,"D6D") == 0)
 
239
   return 9;
 
240
else if (strcmp(ptgrp,"D4H") == 0)
 
241
   return 10;
 
242
else if (strcmp(ptgrp,"OH ") == 0)
 
243
   return 10;
 
244
else if (strcmp(ptgrp,"D6H") == 0)
 
245
   return 12;
 
246
else
 
247
   return 1;
 
248
}
 
249
 
 
250
const char **get_symm_ops(char *ptgrp) {
 
251
 
 
252
   int i,j,nirreps;
 
253
   char **irreps;
 
254
 
 
255
   static const char *C1[] =  {"E"};
 
256
   static const char *CS[] =  {"E","SGH"};
 
257
   static const char *CI[] =  {"E","I"};
 
258
   static const char *C2[] =  {"E","C2"};
 
259
   static const char *D2[] =  {"E","C2Z","C2Y","C2X"};
 
260
   static const char *C2V[] = {"E","C2","SGV","SGV"};
 
261
   static const char *C2H[] = {"E","C2","I","SGH"};
 
262
   static const char *D3[] =  {"E","C3","C2"};
 
263
   static const char *C3V[] = {"E","C3","SGV"};
 
264
   static const char *D4[] =  {"E","C4","C2","C2'","C2\""};
 
265
   static const char *D2D[] = {"E","S4","C2","C2'","SGD"};
 
266
   static const char *C4V[] = {"E","C4","C2","SGV","SGD"};
 
267
   static const char *TD[] =  {"E","C3","C2","S4","SGD"};
 
268
   static const char *O[] =   {"E","C3","C2","C4","C2"};
 
269
   static const char *D6[] =  {"E","C6","C3","C2","C2'","C2\""};
 
270
   static const char *C6V[] = {"E","C6","C3","C2","SGV","SGD"};
 
271
   static const char *D3D[] = {"E","C3","C2","I","S6","SGD"};
 
272
   static const char *D3H[] = {"E","C3","C2","SGH","S3","SGV"};
 
273
   static const char *D2H[] = {"E","C2Z","C2Y","C2X","I","SGXY","SGXZ","SGYZ"}; 
 
274
   static const char *D4H[] = {"E","C4","C2","C2'","C2\"","I","S4","SGH","SGV","SGD"}; 
 
275
   static const char *OH[] =  {"E","C3","C2","C4","C2","I","S4","S6","SGH","SGD"};
 
276
   static const char *D6H[] = {"E","C6","C3","C2","C2'","C2\"","I","S3","S6","SGH","SGD","SGV"};
 
277
 
 
278
if (strcmp(ptgrp,"C1 ") == 0)
 
279
   return C1;
 
280
else if (strcmp(ptgrp,"CS ") == 0)
 
281
   return CS;
 
282
else if (strcmp(ptgrp,"CI ") == 0)
 
283
   return CI;
 
284
else if (strcmp(ptgrp,"C2 ") == 0)
 
285
   return C2;
 
286
else if (strcmp(ptgrp,"C2V") == 0)
 
287
   return C2V;
 
288
else if (strcmp(ptgrp,"D2 ") == 0)
 
289
   return D2;
 
290
else if (strcmp(ptgrp,"C2H") == 0)
 
291
   return C2H;
 
292
else if (strcmp(ptgrp,"C3V") == 0) 
 
293
   return C3V;
 
294
else if (strcmp(ptgrp,"D3 ") == 0)
 
295
   return D3;
 
296
else if (strcmp(ptgrp,"C4V") == 0) 
 
297
   return C4V;
 
298
else if (strcmp(ptgrp,"D2D") == 0)
 
299
   return D2D;
 
300
else if (strcmp(ptgrp,"D4 ") == 0)
 
301
   return D4;
 
302
else if (strcmp(ptgrp,"O  ") == 0) 
 
303
   return O;
 
304
else if (strcmp(ptgrp,"TD ") == 0)
 
305
   return TD;
 
306
else if (strcmp(ptgrp,"C6V") == 0) 
 
307
   return C6V;
 
308
else if (strcmp(ptgrp,"D6 ") == 0)
 
309
   return D6;
 
310
else if (strcmp(ptgrp,"D3D") == 0) 
 
311
   return D3D;
 
312
else if (strcmp(ptgrp,"D3H") == 0)
 
313
   return D3H;
 
314
else if (strcmp(ptgrp,"D2H") == 0)
 
315
   return D2H;
 
316
else if (strcmp(ptgrp,"D4H") == 0)
 
317
   return D4H;
 
318
else if (strcmp(ptgrp,"OH ") == 0)
 
319
   return OH;
 
320
else if (strcmp(ptgrp,"D6H") == 0)
 
321
   return D6H;
 
322
else
 
323
   return C1;
 
324
}
 
325
 
 
326
 
 
327
 
 
328
 
 
329
const char **get_irrep_labels(char *ptgrp) {
 
330
 
 
331
   int i,j,nirreps;
 
332
   char **irreps;
 
333
 
 
334
   static const char *C1[] = {"A"};
 
335
   static const char *CS[] = {"Ap","App"};
 
336
   static const char *CI[] = {"Ag","Au"};
 
337
   static const char *C2[] = {"A","B"};
 
338
   static const char *D2[] = {"A","B1","B2","B3"};
 
339
   static const char *C2V[] = {"A1","A2","B1","B2"};
 
340
   static const char *C2H[] = {"Ag","Bg","Au","Bu"};
 
341
   static const char *D3[] = {"A1","A2","E"};
 
342
   static const char *C3V[] = {"A1","A2","E"};
 
343
   static const char *D4[] = {"A1","A2","B1","B2","E"};
 
344
   static const char *D2D[] = {"A1","A2","B1","B2","E"};
 
345
   static const char *C4V[] = {"A1","A2","B1","B2","E"};
 
346
   static const char *TD[] = {"A1","A2","E","T1","T2"};
 
347
   static const char *O[] = {"A1","A2","E","T1","T2"};
 
348
   static const char *D6[] = {"A1","A2","B1","B2","E1","E2"};
 
349
   static const char *C6V[] = {"A1","A2","B1","B2","E1","E2"};
 
350
   static const char *D3D[] = {"A1g","A2g","Eg","A1u","A2u","Eu"};
 
351
   static const char *D3H[] = {"A1p","A2p","Ep","A1pp","A2pp","Epp"};
 
352
   static const char *D2H[] = {"Ag","B1g","B2g","B3g","Au","B1u","B2u","B3u"};
 
353
   static const char *D4H[] = {"A1g","A2g","B1g","B2g","Eg","A1u","A2u","B1u","B2u","Eu"};
 
354
   static const char *OH[] = {"A1g","A2g","Eg","T1g","T2g","A1u","A2u","Eu","T1u","T2u"};
 
355
   static const char *D6H[] = {"A1g","A2g","B1g","B2g","E1g","E2g","A1u","A2u","B1u","B2u","E1u","E2u"};
 
356
 
 
357
if (strcmp(ptgrp,"C1 ") == 0)
 
358
   return C1;
 
359
else if (strcmp(ptgrp,"CS ") == 0)
 
360
   return CS;
 
361
else if (strcmp(ptgrp,"CI ") == 0)
 
362
   return CI;
 
363
else if (strcmp(ptgrp,"C2 ") == 0)
 
364
   return C2;
 
365
else if (strcmp(ptgrp,"C2V") == 0)
 
366
   return C2V;
 
367
else if (strcmp(ptgrp,"D2 ") == 0)
 
368
   return D2;
 
369
else if (strcmp(ptgrp,"C2H") == 0)
 
370
   return C2H;
 
371
else if (strcmp(ptgrp,"C3V") == 0)
 
372
   return C3V;
 
373
else if (strcmp(ptgrp,"D3 ") == 0)
 
374
   return D3;
 
375
else if (strcmp(ptgrp,"C4V") == 0)
 
376
   return C4V;
 
377
else if (strcmp(ptgrp,"D2D") == 0)
 
378
   return D2D;
 
379
else if (strcmp(ptgrp,"D4 ") == 0)
 
380
   return D4;
 
381
else if (strcmp(ptgrp,"O  ") == 0)
 
382
   return O;
 
383
else if (strcmp(ptgrp,"TD ") == 0)
 
384
   return TD;
 
385
else if (strcmp(ptgrp,"C6V") == 0)
 
386
   return C6V;
 
387
else if (strcmp(ptgrp,"D6 ") == 0)
 
388
   return D6;
 
389
else if (strcmp(ptgrp,"D3D") == 0)
 
390
   return D3D;
 
391
else if (strcmp(ptgrp,"D3H") == 0)
 
392
   return D3H;
 
393
else if (strcmp(ptgrp,"D2H") == 0)
 
394
   return D2H;
 
395
else if (strcmp(ptgrp,"D4H") == 0)
 
396
   return D4H;
 
397
else if (strcmp(ptgrp,"OH ") == 0)
 
398
   return OH;
 
399
else if (strcmp(ptgrp,"D6H") == 0)
 
400
   return D6H;
 
401
else
 
402
   return C1;
 
403
}
 
404
 
 
405
 
 
406
 
 
407
 
 
408
int *get_ops_coeffs(char *ptgrp) {
 
409
 
 
410
   static int C1[]  = {1}; 
 
411
   static int CS[]  = {1,1};
 
412
   static int CI[]  = {1,1};
 
413
   static int C2[]  = {1,1};
 
414
   static int D2[]  = {1,1,1,1};
 
415
   static int C2V[] = {1,1,1,1};
 
416
   static int C2H[] = {1,1,1,1};
 
417
   static int D3[]  = {1,2,3};
 
418
   static int C3V[] = {1,2,3};
 
419
   static int D4[]  = {1,2,1,2,2};
 
420
   static int D2D[] = {1,2,1,2,2};
 
421
   static int C4V[] = {1,2,1,2,2};
 
422
   static int TD[]  = {1,8,3,6,6};
 
423
   static int O[]   = {1,8,3,6,6};
 
424
   static int D6[]  = {1,2,2,1,3,3};
 
425
   static int C6V[] = {1,2,2,1,3,3};
 
426
   static int D3D[] = {1,2,3,1,2,3};
 
427
   static int D3H[] = {1,2,3,1,2,3};
 
428
   static int D2H[] = {1,1,1,1,1,1,1,1};
 
429
   static int D4H[] = {1,2,1,2,2,1,2,1,2,2};
 
430
   static int OH[]  = {1,8,6,6,3,1,6,8,3,6};
 
431
   static int D6H[] = {1,2,2,1,3,3,1,2,2,1,3,3};
 
432
 
 
433
if (strcmp(ptgrp,"C1 ") == 0)
 
434
   return C1;
 
435
else if (strcmp(ptgrp,"CS ") == 0)
 
436
   return CS;
 
437
else if (strcmp(ptgrp,"CI ") == 0)
 
438
   return CI;
 
439
else if (strcmp(ptgrp,"C2 ") == 0)
 
440
   return C2;
 
441
else if (strcmp(ptgrp,"C2V") == 0)
 
442
   return C2V;
 
443
else if (strcmp(ptgrp,"D2 ") == 0)
 
444
   return D2;
 
445
else if (strcmp(ptgrp,"C2H") == 0)
 
446
   return C2H;
 
447
else if (strcmp(ptgrp,"C3V") == 0)
 
448
   return C3V;
 
449
else if (strcmp(ptgrp,"D3 ") == 0)
 
450
   return D3;
 
451
else if (strcmp(ptgrp,"C4V") == 0)
 
452
   return C4V;
 
453
else if (strcmp(ptgrp,"D2D") == 0)
 
454
   return D2D;
 
455
else if (strcmp(ptgrp,"D4 ") == 0)
 
456
   return D4;
 
457
else if (strcmp(ptgrp,"O  ") == 0)
 
458
   return O;
 
459
else if (strcmp(ptgrp,"TD ") == 0)
 
460
   return TD;
 
461
else if (strcmp(ptgrp,"C6V") == 0)
 
462
   return C6V;
 
463
else if (strcmp(ptgrp,"D6 ") == 0)
 
464
   return D6;
 
465
else if (strcmp(ptgrp,"D3D") == 0)
 
466
   return D3D;
 
467
else if (strcmp(ptgrp,"D3H") == 0)
 
468
   return D3H;
 
469
else if (strcmp(ptgrp,"D2H") == 0)
 
470
   return D2H;
 
471
else if (strcmp(ptgrp,"D4H") == 0)
 
472
   return D4H;
 
473
else if (strcmp(ptgrp,"OH ") == 0)
 
474
   return OH;
 
475
else if (strcmp(ptgrp,"D6H") == 0)
 
476
   return D6H;
 
477
else
 
478
   return C1;
 
479
}
 
480
 
 
481
 
 
482
 
 
483
 
 
484
int get_num_ops(char *ptgrp) {
 
485
 
 
486
if (strcmp(ptgrp,"C1 ") == 0)
 
487
   return 1;
 
488
else if (strcmp(ptgrp,"CS ") == 0)
 
489
   return 2;
 
490
else if (strcmp(ptgrp,"CI ") == 0)
 
491
   return 2;
 
492
else if (strcmp(ptgrp,"C2 ") == 0)
 
493
   return 2;
 
494
else if (strcmp(ptgrp,"C2V") == 0)
 
495
   return 4;
 
496
else if (strcmp(ptgrp,"D2 ") == 0)
 
497
   return 4;
 
498
else if (strcmp(ptgrp,"C2H") == 0)
 
499
   return 4;
 
500
else if (strcmp(ptgrp,"C3V") == 0)
 
501
   return 6;
 
502
else if (strcmp(ptgrp,"D3 ") == 0)
 
503
   return 6;
 
504
else if (strcmp(ptgrp,"C4V") == 0)
 
505
   return 8;
 
506
else if (strcmp(ptgrp,"D2D") == 0)
 
507
   return 8;
 
508
else if (strcmp(ptgrp,"D4 ") == 0)
 
509
   return 8;
 
510
else if (strcmp(ptgrp,"O  ") == 0)
 
511
   return 24;
 
512
else if (strcmp(ptgrp,"TD ") == 0)
 
513
   return 24;
 
514
else if (strcmp(ptgrp,"C6V") == 0)
 
515
   return 12;
 
516
else if (strcmp(ptgrp,"D6 ") == 0)
 
517
   return 12;
 
518
else if (strcmp(ptgrp,"D3D") == 0)
 
519
   return 12;
 
520
else if (strcmp(ptgrp,"D3H") == 0)
 
521
   return 12;
 
522
else if (strcmp(ptgrp,"D2H") == 0)
 
523
   return 8;
 
524
else if (strcmp(ptgrp,"D4H") == 0)
 
525
   return 16;
 
526
else if (strcmp(ptgrp,"OH ") == 0)
 
527
   return 48;
 
528
else if (strcmp(ptgrp,"D6H") == 0)
 
529
   return 24;
 
530
else
 
531
   return 1;
 
532
}
 
533
 
 
534
 
 
535
 
 
536
 
 
537
int get_num_classes(char *ptgrp) {
 
538
 
 
539
if (strcmp(ptgrp,"C1 ") == 0)
 
540
   return 1;
 
541
else if (strcmp(ptgrp,"CS ") == 0)
 
542
   return 2;
 
543
else if (strcmp(ptgrp,"CI ") == 0)
 
544
   return 2;
 
545
else if (strcmp(ptgrp,"C2 ") == 0)
 
546
   return 2;
 
547
else if (strcmp(ptgrp,"C2V") == 0)
 
548
   return 4;
 
549
else if (strcmp(ptgrp,"D2 ") == 0)
 
550
   return 4;
 
551
else if (strcmp(ptgrp,"C2H") == 0)
 
552
   return 4;
 
553
else if (strcmp(ptgrp,"C3V") == 0)
 
554
   return 3;
 
555
else if (strcmp(ptgrp,"D3 ") == 0)
 
556
   return 3;
 
557
else if (strcmp(ptgrp,"C4V") == 0)
 
558
   return 5;
 
559
else if (strcmp(ptgrp,"D2D") == 0)
 
560
   return 5;
 
561
else if (strcmp(ptgrp,"D4 ") == 0)
 
562
   return 5;
 
563
else if (strcmp(ptgrp,"O  ") == 0)
 
564
   return 5;
 
565
else if (strcmp(ptgrp,"TD ") == 0)
 
566
   return 5;
 
567
else if (strcmp(ptgrp,"C6V") == 0)
 
568
   return 6;
 
569
else if (strcmp(ptgrp,"D6 ") == 0)
 
570
   return 6;
 
571
else if (strcmp(ptgrp,"D3D") == 0)
 
572
   return 6;
 
573
else if (strcmp(ptgrp,"D3H") == 0)
 
574
   return 6;
 
575
else if (strcmp(ptgrp,"D2H") == 0)
 
576
   return 8;
 
577
else if (strcmp(ptgrp,"D4H") == 0)
 
578
   return 10;
 
579
else if (strcmp(ptgrp,"OH ") == 0)
 
580
   return 10;
 
581
else if (strcmp(ptgrp,"D6H") == 0)
 
582
   return 12;
 
583
else
 
584
   return 1;
 
585
}
 
586
 
 
587
 
 
588
/*** GET_OPS_IN_CLASS : finds numbers of operations in the classes
 
589
 * of the molecular point group. nirreps is for checking */
 
590
 
 
591
int *get_ops_in_class(char *ptgrp, int nirreps) {
 
592
 
 
593
  int num_class, *num_ops, error_var = 0; 
 
594
 
 
595
  static int class_C1[] = {1},
 
596
             num_class_C1 = 1,
 
597
 
 
598
             /* for CS,CI,C2 */
 
599
             class_CS[] = {1,1},
 
600
             num_class_CS = 2,
 
601
 
 
602
             /* for C2V,D2,C2h */
 
603
             class_D2[] = {1,1,1,1},
 
604
             num_class_D2 = 4,
 
605
 
 
606
             /* for C3V,D3 */
 
607
             class_D3[] = {1,2,3},
 
608
             num_class_D3 = 3,
 
609
 
 
610
             /* for C4V,D2D,D4 */
 
611
             class_D4[] = {1,2,1,2,2},
 
612
             num_class_D4 = 5,
 
613
 
 
614
             /* for O,TD */
 
615
             class_TD[] = {1,8,3,6,6},
 
616
             num_class_TD = 5,
 
617
 
 
618
             /* for C6V,D6 */
 
619
             class_D6[] = {1,2,2,1,3,3},
 
620
             num_class_D6 = 6,
 
621
 
 
622
             /*for D3D,D3H */
 
623
             class_D3D[] = {1,2,3,1,2,3},
 
624
             num_class_D3D = 6,
 
625
 
 
626
             class_D2H[] = {1,1,1,1,1,1,1,1},
 
627
             num_class_D2H = 8,
 
628
 
 
629
             class_D4H[] = {1,2,1,2,2,1,2,1,2,2},
 
630
             num_class_D4H = 10,
 
631
 
 
632
             class_OH[] = {1,8,6,6,3,1,6,8,3,6},
 
633
             num_class_OH = 10,
 
634
 
 
635
             class_D6H[] = {1,2,2,1,3,3,1,2,2,1,3,3},
 
636
             num_class_D6H = 12;
 
637
 
 
638
 
 
639
  if (strcmp(ptgrp,"C1 ") == 0) {
 
640
    if(nirreps == num_class_C1)
 
641
      num_ops = class_C1;
 
642
    else error_var = 1;
 
643
  }
 
644
  else if (strcmp(ptgrp,"CS ")==0 || strcmp(ptgrp,"CI ")==0 ||
 
645
          strcmp(ptgrp,"C2 ")==0) {
 
646
    if(nirreps == num_class_CS)
 
647
      num_ops = class_CS;
 
648
    else error_var = 1;
 
649
  }
 
650
  else if (strcmp (ptgrp, "C2V")==0 || strcmp (ptgrp, "D2 ")==0 ||
 
651
          strcmp(ptgrp,"C2H")==0) {
 
652
    if(nirreps == num_class_D2)
 
653
      num_ops = class_D2;
 
654
    else error_var = 1;
 
655
  }
 
656
  else if(strcmp(ptgrp,"C3V")==0 || strcmp(ptgrp,"D3 ")==0) {
 
657
    if(nirreps == num_class_D3)
 
658
      num_ops = class_D3;
 
659
    else error_var = 1;
 
660
  }  
 
661
 
 
662
  else if(strcmp(ptgrp,"C4V")==0 || strcmp(ptgrp,"D2D")==0 || 
 
663
          strcmp(ptgrp,"D4 ")==0) {
 
664
    if(nirreps == num_class_D4)
 
665
      num_ops = class_D4;
 
666
    else error_var = 1;
 
667
  }
 
668
 
 
669
  else if(strcmp(ptgrp,"O  ")==0 || strcmp(ptgrp,"TD ")==0) { 
 
670
    if(nirreps == num_class_TD)
 
671
      num_ops = class_TD;
 
672
    else error_var = 1;
 
673
  }
 
674
 
 
675
  else if(strcmp(ptgrp,"C6V")==0 || strcmp(ptgrp,"D6 ")==0) {
 
676
    if(nirreps == num_class_D6)
 
677
      num_ops = class_D6;
 
678
    else error_var = 1;
 
679
  }  
 
680
 
 
681
  else if(strcmp(ptgrp,"D3D")==0 || strcmp(ptgrp,"D3H")==0) {
 
682
    if(nirreps == num_class_D3D)
 
683
      num_ops = class_D3D;
 
684
    else error_var = 1;
 
685
  }
 
686
 
 
687
  else if(strcmp(ptgrp,"D2H")==0) {
 
688
    if(nirreps == num_class_D2H)
 
689
      num_ops = class_D2H;
 
690
    else error_var = 1;
 
691
  }
 
692
 
 
693
  else if(strcmp(ptgrp,"D4H")==0) {
 
694
    if(nirreps == num_class_D4H)
 
695
      num_ops = class_D4H;
 
696
    else error_var = 1;
 
697
  }
 
698
 
 
699
  else if(strcmp(ptgrp,"OH ")==0) {
 
700
    if(nirreps == num_class_OH)
 
701
      num_ops = class_OH;
 
702
    else error_var = 1;
 
703
  }
 
704
 
 
705
  else if(strcmp(ptgrp,"D6H")==0) {
 
706
    if(nirreps == num_class_D6H)
 
707
      num_ops = class_D6H;
 
708
    else error_var = 1;
 
709
  }
 
710
 
 
711
  else if (num_ops[0] == 0) error_var = 1;
 
712
 
 
713
  if(error_var != 0) {
 
714
    punt("problem assigning number of operations per class");
 
715
  } 
 
716
 
 
717
return num_ops;
 
718
 
 
719
}      
 
720
 
 
721
}} /* namespace psi::optking */
 
722