JDFTx  1.2.0
S2quad.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 #ifndef JDFTX_FLUID_SO3PLATONIC_H
21 #define JDFTX_FLUID_SO3PLATONIC_H
22 
25 
30 #include <vector>
31 #include <core/vector3.h>
32 #include <core/string.h>
33 #include <core/Util.h>
34 
36 struct S2quad
37 {
38  std::vector<vector3<> > euler;
39  std::vector<double> weight;
40  virtual int jMax() const=0;
41  virtual int nS1() const=0;
42  virtual string name() const=0;
43  virtual ~S2quad() {}
44 protected:
49  void add(vector3<> n, double relWeight=1., double s1phase=0.);
50 };
51 
54 { QuadEuler,
55  QuadTetrahedron,
56  QuadOctahedron,
57  QuadIcosahedron,
58  Quad7design_24,
59  Quad8design_36,
60  Quad9design_48,
61  Quad10design_60,
62  Quad11design_70,
63  Quad12design_84,
64  Quad13design_94,
65  Quad14design_108,
66  Quad15design_120,
67  Quad16design_144,
68  Quad17design_156,
69  Quad18design_180,
70  Quad19design_204,
71  Quad20design_216,
72  Quad21design_240,
73 };
74 
76 static EnumStringMap<S2quadType> S2quadTypeMap
77 ( QuadEuler, "Euler",
78  QuadTetrahedron, "Tetrahedron",
79  QuadOctahedron, "Octahedron",
80  QuadIcosahedron, "Icosahedron",
81  Quad7design_24, "7design24",
82  Quad8design_36, "8design36",
83  Quad9design_48, "9design48",
84  Quad10design_60, "10design60",
85  Quad11design_70, "11design70",
86  Quad12design_84, "12design84",
87  Quad13design_94, "13design94",
88  Quad14design_108, "14design108",
89  Quad15design_120, "15design120",
90  Quad16design_144, "16design144",
91  Quad17design_156, "17design156",
92  Quad18design_180, "18design180",
93  Quad19design_204, "19design204",
94  Quad20design_216, "20design216",
95  Quad21design_240, "21design240"
96 );
97 
98 
100 class EulerProduct : public S2quad
101 {
102 public:
108  EulerProduct(unsigned nBeta, unsigned nAlpha=0, unsigned nGamma=0);
109  int jMax() const;
110  int nS1() const;
111  string name() const;
112 
113 private:
114  unsigned nBeta, nAlpha, nGamma;
115 };
116 
117 
118 //--------------- Platonic Solid rotation groups ------------------
119 
121 class Tetrahedron : public S2quad
122 {
123 public:
124  Tetrahedron();
125  int jMax() const { return 2; }
126  int nS1() const { return 3; }
127  string name() const { return "Tetrahedron"; }
128 };
129 
131 class Octahedron : public S2quad
132 {
133 public:
134  Octahedron();
135  int jMax() const { return 3; }
136  int nS1() const { return 4; }
137  string name() const { return "Octahedron"; }
138 };
139 
141 class Icosahedron : public S2quad
142 {
143 public:
144  Icosahedron();
145  int jMax() const { return 5; }
146  int nS1() const { return 5; }
147  string name() const { return "Icosahedron"; }
148 };
149 
150 
151 //--------------- Hardin and Sloane Spherical designs -----------------
152 // Auto-converted from http://www2.research.att.com/~njas/sphdesigns
153 
155 class S2_7design_24 : public S2quad
156 {
157 public:
158  S2_7design_24();
159  int jMax() const { return 7; }
160  int nS1() const { return 8; }
161  string name() const { return "7-design"; }
162 };
163 
165 class S2_8design_36 : public S2quad
166 {
167 public:
168  S2_8design_36();
169  int jMax() const { return 8; }
170  int nS1() const { return 9; }
171  string name() const { return "8-design"; }
172 };
173 
175 class S2_9design_48 : public S2quad
176 {
177 public:
178  S2_9design_48();
179  int jMax() const { return 9; }
180  int nS1() const { return 10; }
181  string name() const { return "9-design"; }
182 };
183 
185 class S2_10design_60 : public S2quad
186 {
187 public:
188  S2_10design_60();
189  int jMax() const { return 10; }
190  int nS1() const { return 11; }
191  string name() const { return "10-design"; }
192 };
193 
195 class S2_11design_70 : public S2quad
196 {
197 public:
198  S2_11design_70();
199  int jMax() const { return 11; }
200  int nS1() const { return 12; }
201  string name() const { return "11-design"; }
202 };
203 
205 class S2_12design_84 : public S2quad
206 {
207 public:
208  S2_12design_84();
209  int jMax() const { return 12; }
210  int nS1() const { return 13; }
211  string name() const { return "12-design"; }
212 };
213 
215 class S2_13design_94 : public S2quad
216 {
217 public:
218  S2_13design_94();
219  int jMax() const { return 13; }
220  int nS1() const { return 14; }
221  string name() const { return "13-design"; }
222 };
223 
225 class S2_14design_108 : public S2quad
226 {
227 public:
228  S2_14design_108();
229  int jMax() const { return 14; }
230  int nS1() const { return 15; }
231  string name() const { return "14-design"; }
232 };
233 
235 class S2_15design_120 : public S2quad
236 {
237 public:
238  S2_15design_120();
239  int jMax() const { return 15; }
240  int nS1() const { return 16; }
241  string name() const { return "15-design"; }
242 };
243 
245 class S2_16design_144 : public S2quad
246 {
247 public:
248  S2_16design_144();
249  int jMax() const { return 16; }
250  int nS1() const { return 17; }
251  string name() const { return "16-design"; }
252 };
253 
255 class S2_17design_156 : public S2quad
256 {
257 public:
258  S2_17design_156();
259  int jMax() const { return 17; }
260  int nS1() const { return 18; }
261  string name() const { return "17-design"; }
262 };
263 
265 class S2_18design_180 : public S2quad
266 {
267 public:
268  S2_18design_180();
269  int jMax() const { return 18; }
270  int nS1() const { return 19; }
271  string name() const { return "18-design"; }
272 };
273 
275 class S2_19design_204 : public S2quad
276 {
277 public:
278  S2_19design_204();
279  int jMax() const { return 19; }
280  int nS1() const { return 20; }
281  string name() const { return "19-design"; }
282 };
283 
285 class S2_20design_216 : public S2quad
286 {
287 public:
288  S2_20design_216();
289  int jMax() const { return 20; }
290  int nS1() const { return 21; }
291  string name() const { return "20-design"; }
292 };
293 
295 class S2_21design_240 : public S2quad
296 {
297 public:
298  S2_21design_240();
299  int jMax() const { return 21; }
300  int nS1() const { return 22; }
301  string name() const { return "21-design"; }
302 };
303 
305 
306 #endif // JDFTX_FLUID_SO3PLATONIC_H
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:229
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:280
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:189
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:239
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:169
Spherical 15-design with 120 nodes.
Definition: S2quad.h:235
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:291
Spherical 17-design with 156 nodes.
Definition: S2quad.h:255
Spherical 8-design with 36 nodes.
Definition: S2quad.h:165
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:269
STL strings and streams with case insensitive comparison.
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:271
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:219
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:220
Spherical 12-design with 84 nodes.
Definition: S2quad.h:205
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:289
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:191
A template to ease option parsing (maps enums <–> strings)
Definition: Util.h:179
int nS1() const
This is a special case that doesn&#39;t have nS1=jMax+1.
Definition: S2quad.h:146
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:281
Tetrahedron rotation group.
Definition: S2quad.h:121
Spherical 18-design with 180 nodes.
Definition: S2quad.h:265
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:190
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:221
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:260
Spherical 14-design with 108 nodes.
Definition: S2quad.h:225
Spherical 21-design with 240 nodes.
Definition: S2quad.h:295
Spherical 7-design with 24 nodes.
Definition: S2quad.h:155
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:136
virtual string name() const =0
A short descriptive name for the S2 quadrature.
Outer-product quadrature on ZYZ euler angles.
Definition: S2quad.h:100
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:145
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:171
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:210
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:261
Octahedron rotation group.
Definition: S2quad.h:131
void add(vector3<> n, double relWeight=1., double s1phase=0.)
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:241
Spherical 9-design with 48 nodes.
Definition: S2quad.h:175
Spherical 11-design with 70 nodes.
Definition: S2quad.h:195
Spherical 16-design with 144 nodes.
Definition: S2quad.h:245
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:290
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:181
Spherical 19-design with 204 nodes.
Definition: S2quad.h:275
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:199
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:240
virtual int nS1() const =0
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:147
Icosahedron rotation group.
Definition: S2quad.h:141
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:231
std::vector< double > weight
suggested S2 quadrature weights (same length as euler, will be normalized to add up to 1) ...
Definition: S2quad.h:39
Miscellaneous utilities.
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:161
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:299
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:180
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:127
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:250
Spherical 10-design with 60 nodes.
Definition: S2quad.h:185
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:301
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:279
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:125
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:259
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:300
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:270
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:251
virtual int jMax() const =0
max angular momentum that the S2 quadrature is exact to (will be checked)
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:160
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:211
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:135
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:230
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:170
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:179
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:200
Spherical 13-design with 94 nodes.
Definition: S2quad.h:215
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:159
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:209
std::vector< vector3<> > euler
list of S2 quadrature nodes in first two components with suggested S1 phase in third component ...
Definition: S2quad.h:38
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:137
S2quadType
List of available quadratures.
Definition: S2quad.h:53
Spherical 20-design with 216 nodes.
Definition: S2quad.h:285
string name() const
A short descriptive name for the S2 quadrature.
Definition: S2quad.h:201
int jMax() const
max angular momentum that the S2 quadrature is exact to (will be checked)
Definition: S2quad.h:249
Abstract base class for a S2 quadrature definition (used to generate the SO3 qudarature) ...
Definition: S2quad.h:36
int nS1() const
suggested number of samples for the S1 sector (will be rounded up to nearest multiple of Zn) ...
Definition: S2quad.h:126