FOX/ObjCryst++  1.10.X (development)
geomStructFactor_097.cpp
1 /* ObjCryst++ Object-Oriented Crystallographic Library
2  (c) 2000-2002 Vincent Favre-Nicolin vincefn@users.sourceforge.net
3  2000-2001 University of Geneva (Switzerland)
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #include "ObjCryst/CrystVector/CrystVector.h"
20 
21 #ifdef __VFN_GEOM_STRUCT_FACTOR_USE_POINTERS
22 
23 #define H (*h)
24 #define K (*k)
25 #define L (*l)
26 #define SF (*sf)
27 
28 #define __VFN_GEOM_STRUCT_FACTOR_POINTERS_INIT const REAL *h,*k,*l; REAL*sf;\
29  h=hh.data();k=kk.data();l=ll.data();sf=sfsf.data(); for(long i=0;i<hh.numElements();i++){
30 #define __VFN_GEOM_STRUCT_FACTOR_POINTERS_END h++ ; k++ ; l++ ; sf++; };
31 
32 #else
33 
34 #define H hh
35 #define K kk
36 #define L ll
37 #define sfsf SF
38 
39 #define __VFN_GEOM_STRUCT_FACTOR_POINTERS_INIT
40 #define __VFN_GEOM_STRUCT_FACTOR_POINTERS_END
41 
42 #endif
43 
44 namespace ObjCryst
45 {
46 
47 void RealGeomStructFactor_97 (const REAL x,
48  const REAL y,
49  const REAL z,
50  const CrystVector_REAL&hh,
51  const CrystVector_REAL&kk,
52  const CrystVector_REAL&ll,
53  CrystVector_REAL& sfsf)
54 {
55 __VFN_GEOM_STRUCT_FACTOR_POINTERS_INIT
56 
57  SF+= 8*pow(cos((H+K+L)/4),2)*cos(L*z)*(cos(H*x)*cos(K*y)+cos(K*x)*cos(H*y));
58 
59 __VFN_GEOM_STRUCT_FACTOR_POINTERS_END
60 
61  return;
62 };
63 
64 void ImagGeomStructFactor_97 (const REAL x,
65  const REAL y,
66  const REAL z,
67  const CrystVector_REAL&hh,
68  const CrystVector_REAL&kk,
69  const CrystVector_REAL&ll,
70  CrystVector_REAL& sfsf)
71 {
72 __VFN_GEOM_STRUCT_FACTOR_POINTERS_INIT
73 
74  SF += (-8)*pow(cos((H+K+L)/4),2)*sin(L*z)*(sin(H*x)*sin(K*y)-sin(K*x)*sin(H*y));
75 
76 __VFN_GEOM_STRUCT_FACTOR_POINTERS_END
77 
78  return;
79 };
80 
81 }
82 #undef H
83 #undef K
84 #undef L
85 #undef SF
86 #undef hh
87 #undef kk
88 #undef ll
89 #undef sfsf
90 #undef __VFN_GEOM_STRUCT_FACTOR_POINTERS_INIT
91 #undef __VFN_GEOM_STRUCT_FACTOR_POINTERS_END
92 
93 #undef __VFN_GEOM_STRUCT_FACTOR_USE_POINTERS
void ImagGeomStructFactor_97(const REAL x, const REAL y, const REAL z, const CrystVector_REAL &h, const CrystVector_REAL &k, const CrystVector_REAL &l, CrystVector_REAL &isf)
void RealGeomStructFactor_97(const REAL x, const REAL y, const REAL z, const CrystVector_REAL &h, const CrystVector_REAL &k, const CrystVector_REAL &l, CrystVector_REAL &rsf)
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Definition: Atom.cpp:47