FOX/ObjCryst++  1.10.X (development)
Polyhedron.cpp
1 #include "ObjCryst/ObjCryst/Polyhedron.h"
2 
3 namespace ObjCryst
4 {
5 
6 Molecule* MakeTetrahedron(Crystal &cryst,const string &name,
7  const ScatteringPower *centralAtom,
8  const ScatteringPower *peripheralAtom,
9  const REAL dist)
10 {
11  Molecule *mol=new Molecule(cryst,name);
12  mol->AddAtom(0.,0.,0.,centralAtom,centralAtom->GetName());
13  mol->AddAtom(0.,0.,dist,peripheralAtom,peripheralAtom->GetName()+"1");
14  mol->AddAtom(0.,dist*0.943,-dist*0.333,peripheralAtom,peripheralAtom->GetName()+"2");
15  mol->AddAtom(dist*0.817,-dist*0.472,-dist*0.333,peripheralAtom,peripheralAtom->GetName()+"3");
16  mol->AddAtom(-dist*0.817,-dist*0.472,-dist*0.333,peripheralAtom,peripheralAtom->GetName()+"4");
17  mol->AddBond(mol->GetAtom(0),mol->GetAtom(1),dist,0.01,0.05);
18  mol->AddBond(mol->GetAtom(0),mol->GetAtom(2),dist,0.01,0.05);
19  mol->AddBond(mol->GetAtom(0),mol->GetAtom(3),dist,0.01,0.05);
20  mol->AddBond(mol->GetAtom(0),mol->GetAtom(4),dist,0.01,0.05);
21  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(2),109.5*DEG2RAD,0.01,0.05);
22  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(3),109.5*DEG2RAD,0.01,0.05);
23  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(4),109.5*DEG2RAD,0.01,0.05);
24  mol->AddBondAngle(mol->GetAtom(2),mol->GetAtom(0),mol->GetAtom(3),109.5*DEG2RAD,0.01,0.05);
25  mol->AddBondAngle(mol->GetAtom(2),mol->GetAtom(0),mol->GetAtom(4),109.5*DEG2RAD,0.01,0.05);
26  mol->AddBondAngle(mol->GetAtom(3),mol->GetAtom(0),mol->GetAtom(4),109.5*DEG2RAD,0.01,0.05);
27  return mol;
28 }
29 
30 Molecule* MakeOctahedron(Crystal &cryst,const string &name,
31  const ScatteringPower *centralAtom,
32  const ScatteringPower *peripheralAtom,
33  const REAL dist)
34 {
35  Molecule *mol=new Molecule(cryst,name);
36  mol->AddAtom(0.,0.,0.,centralAtom,centralAtom->GetName());
37  mol->AddAtom(0.,0.,dist,peripheralAtom,peripheralAtom->GetName()+"1");
38  mol->AddAtom(dist,0.,0.,peripheralAtom,peripheralAtom->GetName()+"2");
39  mol->AddAtom(0.,dist,0.,peripheralAtom,peripheralAtom->GetName()+"3");
40  mol->AddAtom(-dist,0.,0.,peripheralAtom,peripheralAtom->GetName()+"4");
41  mol->AddAtom(0.,-dist,0.,peripheralAtom,peripheralAtom->GetName()+"5");
42  mol->AddAtom(0.,0.,-dist,peripheralAtom,peripheralAtom->GetName()+"6");
43  mol->AddBond(mol->GetAtom(0),mol->GetAtom(1),dist,0.01,0.05);
44  mol->AddBond(mol->GetAtom(0),mol->GetAtom(2),dist,0.01,0.05);
45  mol->AddBond(mol->GetAtom(0),mol->GetAtom(3),dist,0.01,0.05);
46  mol->AddBond(mol->GetAtom(0),mol->GetAtom(4),dist,0.01,0.05);
47  mol->AddBond(mol->GetAtom(0),mol->GetAtom(5),dist,0.01,0.05);
48  mol->AddBond(mol->GetAtom(0),mol->GetAtom(6),dist,0.01,0.05);
49  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(2),M_PI/2.,0.01,0.05);
50  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(3),M_PI/2.,0.01,0.05);
51  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(4),M_PI/2.,0.01,0.05);
52  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(5),M_PI/2.,0.01,0.05);
53  mol->AddBondAngle(mol->GetAtom(6),mol->GetAtom(0),mol->GetAtom(2),M_PI/2.,0.01,0.05);
54  mol->AddBondAngle(mol->GetAtom(6),mol->GetAtom(0),mol->GetAtom(3),M_PI/2.,0.01,0.05);
55  mol->AddBondAngle(mol->GetAtom(6),mol->GetAtom(0),mol->GetAtom(4),M_PI/2.,0.01,0.05);
56  mol->AddBondAngle(mol->GetAtom(6),mol->GetAtom(0),mol->GetAtom(5),M_PI/2.,0.01,0.05);
57  mol->AddBondAngle(mol->GetAtom(2),mol->GetAtom(0),mol->GetAtom(3),M_PI/2.,0.01,0.05);
58  mol->AddBondAngle(mol->GetAtom(3),mol->GetAtom(0),mol->GetAtom(4),M_PI/2.,0.01,0.05);
59  mol->AddBondAngle(mol->GetAtom(4),mol->GetAtom(0),mol->GetAtom(5),M_PI/2.,0.01,0.05);
60  mol->AddBondAngle(mol->GetAtom(5),mol->GetAtom(0),mol->GetAtom(2),M_PI/2.,0.01,0.05);
61  return mol;
62 }
63 
64 Molecule* MakeSquarePlane(Crystal &cryst,const string &name,
65  const ScatteringPower *centralAtom,
66  const ScatteringPower *peripheralAtom,
67  const REAL d)
68 {
69  Molecule *mol=new Molecule(cryst,name);
70  mol->AddAtom(0.,0.,0.,centralAtom,centralAtom->GetName());
71  mol->AddAtom( d,0.,0.,peripheralAtom,peripheralAtom->GetName()+"1");
72  mol->AddAtom(0., d,0.,peripheralAtom,peripheralAtom->GetName()+"2");
73  mol->AddAtom(-d,0.,0.,peripheralAtom,peripheralAtom->GetName()+"3");
74  mol->AddAtom(0.,-d,0.,peripheralAtom,peripheralAtom->GetName()+"4");
75  mol->AddBond(mol->GetAtom(0),mol->GetAtom(1),d,0.01,0.05);
76  mol->AddBond(mol->GetAtom(0),mol->GetAtom(2),d,0.01,0.05);
77  mol->AddBond(mol->GetAtom(0),mol->GetAtom(3),d,0.01,0.05);
78  mol->AddBond(mol->GetAtom(0),mol->GetAtom(4),d,0.01,0.05);
79  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(2),M_PI/2.,0.01,0.05);
80  mol->AddBondAngle(mol->GetAtom(2),mol->GetAtom(0),mol->GetAtom(3),M_PI/2.,0.01,0.05);
81  mol->AddBondAngle(mol->GetAtom(3),mol->GetAtom(0),mol->GetAtom(4),M_PI/2.,0.01,0.05);
82  mol->AddBondAngle(mol->GetAtom(4),mol->GetAtom(0),mol->GetAtom(1),M_PI/2.,0.01,0.05);
83  return mol;
84 }
85 
86 Molecule* MakeCube(Crystal &cryst,const string &name,
87  const ScatteringPower *centralAtom,
88  const ScatteringPower *peripheralAtom,
89  const REAL d)
90 {
91  Molecule *mol=new Molecule(cryst,name);
92  const REAL d0=d/sqrt(3.);
93  mol->AddAtom(0.,0.,0.,centralAtom,centralAtom->GetName());
94  mol->AddAtom( d0,-d0, d0,peripheralAtom,peripheralAtom->GetName()+"1");
95  mol->AddAtom( d0, d0, d0,peripheralAtom,peripheralAtom->GetName()+"2");
96  mol->AddAtom(-d0, d0, d0,peripheralAtom,peripheralAtom->GetName()+"3");
97  mol->AddAtom(-d0,-d0, d0,peripheralAtom,peripheralAtom->GetName()+"4");
98  mol->AddAtom( d0,-d0,-d0,peripheralAtom,peripheralAtom->GetName()+"5");
99  mol->AddAtom( d0, d0,-d0,peripheralAtom,peripheralAtom->GetName()+"6");
100  mol->AddAtom(-d0, d0,-d0,peripheralAtom,peripheralAtom->GetName()+"7");
101  mol->AddAtom(-d0,-d0,-d0,peripheralAtom,peripheralAtom->GetName()+"8");
102  mol->AddBond(mol->GetAtom(0),mol->GetAtom(1),d,0.01,0.05);
103  mol->AddBond(mol->GetAtom(0),mol->GetAtom(2),d,0.01,0.05);
104  mol->AddBond(mol->GetAtom(0),mol->GetAtom(3),d,0.01,0.05);
105  mol->AddBond(mol->GetAtom(0),mol->GetAtom(4),d,0.01,0.05);
106  mol->AddBond(mol->GetAtom(0),mol->GetAtom(5),d,0.01,0.05);
107  mol->AddBond(mol->GetAtom(0),mol->GetAtom(6),d,0.01,0.05);
108  mol->AddBond(mol->GetAtom(0),mol->GetAtom(7),d,0.01,0.05);
109  mol->AddBond(mol->GetAtom(0),mol->GetAtom(8),d,0.01,0.05);
110 
111  mol->AddBond(mol->GetAtom(1),mol->GetAtom(2),2*d0,0.01,0.05);
112  mol->AddBond(mol->GetAtom(2),mol->GetAtom(3),2*d0,0.01,0.05);
113  mol->AddBond(mol->GetAtom(3),mol->GetAtom(4),2*d0,0.01,0.05);
114  mol->AddBond(mol->GetAtom(4),mol->GetAtom(1),2*d0,0.01,0.05);
115  mol->AddBond(mol->GetAtom(5),mol->GetAtom(6),2*d0,0.01,0.05);
116  mol->AddBond(mol->GetAtom(6),mol->GetAtom(7),2*d0,0.01,0.05);
117  mol->AddBond(mol->GetAtom(7),mol->GetAtom(8),2*d0,0.01,0.05);
118  mol->AddBond(mol->GetAtom(8),mol->GetAtom(5),2*d0,0.01,0.05);
119  mol->AddBond(mol->GetAtom(1),mol->GetAtom(5),2*d0,0.01,0.05);
120  mol->AddBond(mol->GetAtom(2),mol->GetAtom(6),2*d0,0.01,0.05);
121  mol->AddBond(mol->GetAtom(3),mol->GetAtom(7),2*d0,0.01,0.05);
122  mol->AddBond(mol->GetAtom(4),mol->GetAtom(8),2*d0,0.01,0.05);
123  #if 0
124  const REAL a=2*atan(1/sqrt(2.));
125  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(2),a,0.01,0.05);
126  mol->AddBondAngle(mol->GetAtom(2),mol->GetAtom(0),mol->GetAtom(3),a,0.01,0.05);
127  mol->AddBondAngle(mol->GetAtom(3),mol->GetAtom(0),mol->GetAtom(4),a,0.01,0.05);
128  mol->AddBondAngle(mol->GetAtom(4),mol->GetAtom(0),mol->GetAtom(1),a,0.01,0.05);
129  mol->AddBondAngle(mol->GetAtom(5),mol->GetAtom(0),mol->GetAtom(6),a,0.01,0.05);
130  mol->AddBondAngle(mol->GetAtom(6),mol->GetAtom(0),mol->GetAtom(7),a,0.01,0.05);
131  mol->AddBondAngle(mol->GetAtom(7),mol->GetAtom(0),mol->GetAtom(8),a,0.01,0.05);
132  mol->AddBondAngle(mol->GetAtom(8),mol->GetAtom(0),mol->GetAtom(1),a,0.01,0.05);
133  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(5),a,0.01,0.05);
134  mol->AddBondAngle(mol->GetAtom(2),mol->GetAtom(0),mol->GetAtom(6),a,0.01,0.05);
135  mol->AddBondAngle(mol->GetAtom(3),mol->GetAtom(0),mol->GetAtom(7),a,0.01,0.05);
136  mol->AddBondAngle(mol->GetAtom(4),mol->GetAtom(0),mol->GetAtom(8),a,0.01,0.05);
137  #endif
138  return mol;
139 }
140 
141 Molecule* MakeAntiPrismTetragonal(Crystal &cryst,const string &name,
142  const ScatteringPower *centralAtom,
143  const ScatteringPower *peripheralAtom,
144  const REAL d)
145 {
146  Molecule *mol=new Molecule(cryst,name);
147  const REAL d0=d/sqrt(3.);
148  mol->AddAtom(0.,0.,0.,centralAtom,centralAtom->GetName());
149  mol->AddAtom( d0,-d0, d0,peripheralAtom,peripheralAtom->GetName()+"1");
150  mol->AddAtom( d0, d0, d0,peripheralAtom,peripheralAtom->GetName()+"2");
151  mol->AddAtom(-d0, d0, d0,peripheralAtom,peripheralAtom->GetName()+"3");
152  mol->AddAtom(-d0,-d0, d0,peripheralAtom,peripheralAtom->GetName()+"4");
153  mol->AddAtom( d0*sqrt(2.),0.,-d0,peripheralAtom,peripheralAtom->GetName()+"5");
154  mol->AddAtom(0., d0*sqrt(2.),-d0,peripheralAtom,peripheralAtom->GetName()+"6");
155  mol->AddAtom(-d0*sqrt(2.),0.,-d0,peripheralAtom,peripheralAtom->GetName()+"7");
156  mol->AddAtom(0.,-d0*sqrt(2.),-d0,peripheralAtom,peripheralAtom->GetName()+"8");
157  mol->AddBond(mol->GetAtom(0),mol->GetAtom(1),d,0.01,0.05);
158  mol->AddBond(mol->GetAtom(0),mol->GetAtom(2),d,0.01,0.05);
159  mol->AddBond(mol->GetAtom(0),mol->GetAtom(3),d,0.01,0.05);
160  mol->AddBond(mol->GetAtom(0),mol->GetAtom(4),d,0.01,0.05);
161  mol->AddBond(mol->GetAtom(0),mol->GetAtom(5),d,0.01,0.05);
162  mol->AddBond(mol->GetAtom(0),mol->GetAtom(6),d,0.01,0.05);
163  mol->AddBond(mol->GetAtom(0),mol->GetAtom(7),d,0.01,0.05);
164  mol->AddBond(mol->GetAtom(0),mol->GetAtom(8),d,0.01,0.05);
165 
166  mol->AddBond(mol->GetAtom(1),mol->GetAtom(2),2*d0,0.01,0.05);
167  mol->AddBond(mol->GetAtom(2),mol->GetAtom(3),2*d0,0.01,0.05);
168  mol->AddBond(mol->GetAtom(3),mol->GetAtom(4),2*d0,0.01,0.05);
169  mol->AddBond(mol->GetAtom(4),mol->GetAtom(1),2*d0,0.01,0.05);
170  mol->AddBond(mol->GetAtom(5),mol->GetAtom(6),2*d0,0.01,0.05);
171  mol->AddBond(mol->GetAtom(6),mol->GetAtom(7),2*d0,0.01,0.05);
172  mol->AddBond(mol->GetAtom(7),mol->GetAtom(8),2*d0,0.01,0.05);
173  mol->AddBond(mol->GetAtom(8),mol->GetAtom(5),2*d0,0.01,0.05);
174 
175  mol->AddBond(mol->GetAtom(5),mol->GetAtom(1),d0*sqrt(5.),0.01,0.05);
176  mol->AddBond(mol->GetAtom(5),mol->GetAtom(2),d0*sqrt(5.),0.01,0.05);
177  mol->AddBond(mol->GetAtom(6),mol->GetAtom(2),d0*sqrt(5.),0.01,0.05);
178  mol->AddBond(mol->GetAtom(6),mol->GetAtom(3),d0*sqrt(5.),0.01,0.05);
179  mol->AddBond(mol->GetAtom(7),mol->GetAtom(3),d0*sqrt(5.),0.01,0.05);
180  mol->AddBond(mol->GetAtom(7),mol->GetAtom(4),d0*sqrt(5.),0.01,0.05);
181  mol->AddBond(mol->GetAtom(8),mol->GetAtom(4),d0*sqrt(5.),0.01,0.05);
182  mol->AddBond(mol->GetAtom(8),mol->GetAtom(1),d0*sqrt(5.),0.01,0.05);
183  #if 0
184  const REAL a=2*atan(1/sqrt(2.));
185  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(2),a,0.01,0.05);
186  mol->AddBondAngle(mol->GetAtom(2),mol->GetAtom(0),mol->GetAtom(3),a,0.01,0.05);
187  mol->AddBondAngle(mol->GetAtom(3),mol->GetAtom(0),mol->GetAtom(4),a,0.01,0.05);
188  mol->AddBondAngle(mol->GetAtom(4),mol->GetAtom(0),mol->GetAtom(1),a,0.01,0.05);
189  mol->AddBondAngle(mol->GetAtom(5),mol->GetAtom(0),mol->GetAtom(6),a,0.01,0.05);
190  mol->AddBondAngle(mol->GetAtom(6),mol->GetAtom(0),mol->GetAtom(7),a,0.01,0.05);
191  mol->AddBondAngle(mol->GetAtom(7),mol->GetAtom(0),mol->GetAtom(8),a,0.01,0.05);
192  mol->AddBondAngle(mol->GetAtom(8),mol->GetAtom(0),mol->GetAtom(1),a,0.01,0.05);
193  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(5),a,0.01,0.05);
194  mol->AddBondAngle(mol->GetAtom(2),mol->GetAtom(0),mol->GetAtom(6),a,0.01,0.05);
195  mol->AddBondAngle(mol->GetAtom(3),mol->GetAtom(0),mol->GetAtom(7),a,0.01,0.05);
196  mol->AddBondAngle(mol->GetAtom(4),mol->GetAtom(0),mol->GetAtom(8),a,0.01,0.05);
197  #endif
198  return mol;
199 }
200 
201 Molecule* MakePrismTrigonal(Crystal &cryst,const string &name,
202  const ScatteringPower *centralAtom,
203  const ScatteringPower *peripheralAtom,
204  const REAL d)
205 {
206  const REAL a=sqrt(3./7.)*d;
207  const REAL a1=a*2./sqrt(3.);
208  Molecule *mol=new Molecule(cryst,name);
209  mol->AddAtom(0.,0.,0.,centralAtom,centralAtom->GetName());
210  mol->AddAtom( a1 ,0. , a,peripheralAtom,peripheralAtom->GetName()+"1");
211  mol->AddAtom(-a1/2., a1*sqrt(3.)/2., a,peripheralAtom,peripheralAtom->GetName()+"2");
212  mol->AddAtom(-a1/2.,-a1*sqrt(3.)/2., a,peripheralAtom,peripheralAtom->GetName()+"3");
213  mol->AddAtom( a1 ,0. ,-a,peripheralAtom,peripheralAtom->GetName()+"4");
214  mol->AddAtom(-a1/2., a1*sqrt(3.)/2.,-a,peripheralAtom,peripheralAtom->GetName()+"5");
215  mol->AddAtom(-a1/2.,-a1*sqrt(3.)/2.,-a,peripheralAtom,peripheralAtom->GetName()+"6");
216 
217  mol->AddBond(mol->GetAtom(0),mol->GetAtom(1),d,0.01,0.05);
218  mol->AddBond(mol->GetAtom(0),mol->GetAtom(2),d,0.01,0.05);
219  mol->AddBond(mol->GetAtom(0),mol->GetAtom(3),d,0.01,0.05);
220  mol->AddBond(mol->GetAtom(0),mol->GetAtom(4),d,0.01,0.05);
221  mol->AddBond(mol->GetAtom(0),mol->GetAtom(5),d,0.01,0.05);
222  mol->AddBond(mol->GetAtom(0),mol->GetAtom(6),d,0.01,0.05);
223 
224  mol->AddBond(mol->GetAtom(1),mol->GetAtom(2),2*a,0.01,0.05);
225  mol->AddBond(mol->GetAtom(1),mol->GetAtom(3),2*a,0.01,0.05);
226  mol->AddBond(mol->GetAtom(2),mol->GetAtom(3),2*a,0.01,0.05);
227  mol->AddBond(mol->GetAtom(4),mol->GetAtom(5),2*a,0.01,0.05);
228  mol->AddBond(mol->GetAtom(4),mol->GetAtom(6),2*a,0.01,0.05);
229  mol->AddBond(mol->GetAtom(5),mol->GetAtom(6),2*a,0.01,0.05);
230  mol->AddBond(mol->GetAtom(1),mol->GetAtom(4),2*a,0.01,0.05);
231  mol->AddBond(mol->GetAtom(2),mol->GetAtom(5),2*a,0.01,0.05);
232  mol->AddBond(mol->GetAtom(3),mol->GetAtom(6),2*a,0.01,0.05);
233  return mol;
234 }
235 
236 Molecule* MakeIcosahedron(Crystal &cryst,const string &name,
237  const ScatteringPower *centralAtom,
238  const ScatteringPower *peripheralAtom,
239  const REAL d)
240 {
241  Molecule *mol=new Molecule(cryst,name);
242 
243  const REAL g0=(1.+sqrt(5.))/2.;
244  const REAL a=d/sqrt(1.+g0*g0);
245  const REAL g=g0*a;
246  mol->AddAtom(0.,0.,0.,centralAtom,centralAtom->GetName());
247 
248  mol->AddAtom(0., g, a,peripheralAtom,peripheralAtom->GetName()+"1");
249  mol->AddAtom(0., g,-a,peripheralAtom,peripheralAtom->GetName()+"2");
250  mol->AddAtom(0.,-g, a,peripheralAtom,peripheralAtom->GetName()+"3");
251  mol->AddAtom(0.,-g,-a,peripheralAtom,peripheralAtom->GetName()+"4");
252 
253  mol->AddAtom( a,0., g,peripheralAtom,peripheralAtom->GetName()+"5");
254  mol->AddAtom(-a,0., g,peripheralAtom,peripheralAtom->GetName()+"6");
255  mol->AddAtom( a,0.,-g,peripheralAtom,peripheralAtom->GetName()+"7");
256  mol->AddAtom(-a,0.,-g,peripheralAtom,peripheralAtom->GetName()+"8");
257 
258  mol->AddAtom( g, a,0.,peripheralAtom,peripheralAtom->GetName()+"9");
259  mol->AddAtom( g,-a,0.,peripheralAtom,peripheralAtom->GetName()+"10");
260  mol->AddAtom(-g, a,0.,peripheralAtom,peripheralAtom->GetName()+"11");
261  mol->AddAtom(-g,-a,0.,peripheralAtom,peripheralAtom->GetName()+"12");
262 
263  mol->AddBond(mol->GetAtom(0),mol->GetAtom(1),d,0.01,0.05);
264  mol->AddBond(mol->GetAtom(0),mol->GetAtom(2),d,0.01,0.05);
265  mol->AddBond(mol->GetAtom(0),mol->GetAtom(3),d,0.01,0.05);
266  mol->AddBond(mol->GetAtom(0),mol->GetAtom(4),d,0.01,0.05);
267  mol->AddBond(mol->GetAtom(0),mol->GetAtom(5),d,0.01,0.05);
268  mol->AddBond(mol->GetAtom(0),mol->GetAtom(6),d,0.01,0.05);
269  mol->AddBond(mol->GetAtom(0),mol->GetAtom(7),d,0.01,0.05);
270  mol->AddBond(mol->GetAtom(0),mol->GetAtom(8),d,0.01,0.05);
271  mol->AddBond(mol->GetAtom(0),mol->GetAtom(9),d,0.01,0.05);
272  mol->AddBond(mol->GetAtom(0),mol->GetAtom(10),d,0.01,0.05);
273  mol->AddBond(mol->GetAtom(0),mol->GetAtom(11),d,0.01,0.05);
274  mol->AddBond(mol->GetAtom(0),mol->GetAtom(12),d,0.01,0.05);
275 
276  mol->AddBond(mol->GetAtom(1),mol->GetAtom(2),2*a,0.01,0.05);
277  mol->AddBond(mol->GetAtom(1),mol->GetAtom(11),2*a,0.01,0.05);
278  mol->AddBond(mol->GetAtom(1),mol->GetAtom(6),2*a,0.01,0.05);
279  mol->AddBond(mol->GetAtom(1),mol->GetAtom(5),2*a,0.01,0.05);
280  mol->AddBond(mol->GetAtom(1),mol->GetAtom(9),2*a,0.01,0.05);
281  mol->AddBond(mol->GetAtom(2),mol->GetAtom(11),2*a,0.01,0.05);
282  mol->AddBond(mol->GetAtom(11),mol->GetAtom(6),2*a,0.01,0.05);
283  mol->AddBond(mol->GetAtom(6),mol->GetAtom(5),2*a,0.01,0.05);
284  mol->AddBond(mol->GetAtom(5),mol->GetAtom(9),2*a,0.01,0.05);
285  mol->AddBond(mol->GetAtom(9),mol->GetAtom(2),2*a,0.01,0.05);
286 
287  mol->AddBond(mol->GetAtom(4),mol->GetAtom(3),2*a,0.01,0.05);
288  mol->AddBond(mol->GetAtom(4),mol->GetAtom(12),2*a,0.01,0.05);
289  mol->AddBond(mol->GetAtom(4),mol->GetAtom(8),2*a,0.01,0.05);
290  mol->AddBond(mol->GetAtom(4),mol->GetAtom(7),2*a,0.01,0.05);
291  mol->AddBond(mol->GetAtom(4),mol->GetAtom(10),2*a,0.01,0.05);
292  mol->AddBond(mol->GetAtom(3),mol->GetAtom(12),2*a,0.01,0.05);
293  mol->AddBond(mol->GetAtom(12),mol->GetAtom(8),2*a,0.01,0.05);
294  mol->AddBond(mol->GetAtom(8),mol->GetAtom(7),2*a,0.01,0.05);
295  mol->AddBond(mol->GetAtom(7),mol->GetAtom(10),2*a,0.01,0.05);
296  mol->AddBond(mol->GetAtom(10),mol->GetAtom(3),2*a,0.01,0.05);
297 
298  mol->AddBond(mol->GetAtom(3),mol->GetAtom(5),2*a,0.01,0.05);
299  mol->AddBond(mol->GetAtom(3),mol->GetAtom(6),2*a,0.01,0.05);
300 
301  mol->AddBond(mol->GetAtom(12),mol->GetAtom(6),2*a,0.01,0.05);
302  mol->AddBond(mol->GetAtom(12),mol->GetAtom(11),2*a,0.01,0.05);
303  mol->AddBond(mol->GetAtom(8),mol->GetAtom(11),2*a,0.01,0.05);
304  mol->AddBond(mol->GetAtom(8),mol->GetAtom(2),2*a,0.01,0.05);
305  mol->AddBond(mol->GetAtom(7),mol->GetAtom(2),2*a,0.01,0.05);
306  mol->AddBond(mol->GetAtom(7),mol->GetAtom(9),2*a,0.01,0.05);
307  mol->AddBond(mol->GetAtom(10),mol->GetAtom(9),2*a,0.01,0.05);
308  mol->AddBond(mol->GetAtom(10),mol->GetAtom(5),2*a,0.01,0.05);
309  mol->AddBond(mol->GetAtom(3),mol->GetAtom(5),2*a,0.01,0.05);
310  mol->AddBond(mol->GetAtom(3),mol->GetAtom(6),2*a,0.01,0.05);
311  return mol;
312 }
313 
314 Molecule* MakeTriangle(Crystal &cryst,const string &name,
315  const ScatteringPower *centralAtom,
316  const ScatteringPower *peripheralAtom,
317  const REAL d)
318 {
319  Molecule *mol=new Molecule(cryst,name);
320  mol->AddAtom(0.,0.,0.,centralAtom,centralAtom->GetName());
321  mol->AddAtom(d,0.,0.,peripheralAtom,peripheralAtom->GetName()+"1");
322  mol->AddAtom(-d/2., d*sqrt(3.)/2,0.,peripheralAtom,peripheralAtom->GetName()+"2");
323  mol->AddAtom(-d/2.,-d*sqrt(3.)/2,0.,peripheralAtom,peripheralAtom->GetName()+"3");
324 
325  mol->AddBond(mol->GetAtom(0),mol->GetAtom(1),d,0.01,0.05);
326  mol->AddBond(mol->GetAtom(0),mol->GetAtom(2),d,0.01,0.05);
327  mol->AddBond(mol->GetAtom(0),mol->GetAtom(3),d,0.01,0.05);
328 
329  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(2),M_PI/3.*2.,0.01,0.05);
330  mol->AddBondAngle(mol->GetAtom(1),mol->GetAtom(0),mol->GetAtom(3),M_PI/3.*2.,0.01,0.05);
331  mol->AddBondAngle(mol->GetAtom(2),mol->GetAtom(0),mol->GetAtom(3),M_PI/3.*2.,0.01,0.05);
332  return mol;
333 }
334 
335 }//namespace
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Definition: Atom.cpp:47