- Timestamp:
- 09/29/10 16:20:35 (20 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/mcstas-1.x/lib/samples/Single_crystal.comp
r2895 r2955 86 86 * ax=3.0282, by=3.0282, cz=3.0282/2) 87 87 * 88 * %BUGS:89 * The component is known not to work properly as a Bragg monochromator. The90 * reason is likely to relate to the internal definition of reciprocal space91 * orientation. Investigation undergoing.92 *93 88 * Also, always use a non-zero value of delta_d_d. 94 89 * … … 103 98 * zthick: Thickness of crystal (no extinction simulated) [m] 104 99 * geometry: Name of an Object File Format (OFF) file for complex geometry. 105 * The OFF file may be generated from XYZ coordinates using qhull/powercrust [str] 100 * The OFF file may be generated from XYZ coordinates using 101 * qhull/powercrust [str] 106 102 * delta_d_d: Lattice spacing variance, gaussian RMS [1] 107 * mosaic: Crystal mosaic (isotropic), gaussian RMS. Puts the crystal in the isotropic mosaic model state, thus disregarding other mosaicity parameters. [arc minutes] 108 * mosaic_a: Horizontal (rotation around lattice vector a) mosaic (anisotropic), gaussian RMS. 103 * mosaic: Crystal mosaic (isotropic), gaussian RMS. Puts the crystal in the 104 * isotropic mosaic model state, thus disregarding other mosaicity 105 * parameters. [arc minutes] 106 * mosaic_a: Horizontal (rotation around lattice vector a) mosaic (anisotropic), 107 * gaussian RMS. 109 108 * Put the crystal in the anisotropic crystal vector state. I.e. model mosaicity 110 109 * through rotation around the crystal lattice vectors. Has precedence over 111 110 * in-plane mosaic model. [arc minutes] 112 * mosaic_b: Vertical (rotation around lattice vector b) mosaic (anisotropic), gaussian RMS. [arc minutes] 113 * mosaic_c: Out-of-plane (Rotation around lattice vector c) mosaic (anisotropic), gaussian RMS [arc minutes] 114 * mosaic_AB: In Plane mosaic rotation and plane vectors (anisotropic), mosaic_A, mosaic_B, A_h,A_k,A_l, B_h,B_k,B_l, input as a {}-delimited, 8-element vector. Puts the component in the in-plane mosaic state. Vectors A and B define plane in which the crystal roation is defined, and mosaic_A, mosaic_B, denotes the resp. mosaicities (gaussian RMS) with respect to the the two reflections chosen by A and B (Miller indices). [arc_minutes, arc_minutes,1, 1, 1, 1, 1, 1] 111 * mosaic_b: Vertical (rotation around lattice vector b) mosaic (anisotropic), 112 * gaussian RMS. [arc minutes] 113 * mosaic_c: Out-of-plane (Rotation around lattice vector c) mosaic (anisotropic), 114 * gaussian RMS [arc minutes] 115 * mosaic_AB: In Plane mosaic rotation and plane vectors (anisotropic), mosaic_A, mosaic_B, 116 * A_h,A_k,A_l, B_h,B_k,B_l, input as a {}-delimited, 8-element vector. 117 * Puts the component in the in-plane mosaic state. Vectors A and B define 118 * plane in which the crystal roation is defined, and mosaic_A, mosaic_B, 119 * denotes the resp. mosaicities (gaussian RMS) with respect to the the 120 * two reflections chosen by A and B (Miller indices). 121 * [arc_minutes, arc_minutes,1, 1, 1, 1, 1, 1] 115 122 * 116 123 * recip_cell: Choice of direct/reciprocal (0/1) unit cell definition [1] … … 364 371 365 372 /* special cases for the structure definition */ 366 if (info->m_ax || info->m_ay || info->m_az) info->m_a=0; 373 if (info->m_ax || info->m_ay || info->m_az) info->m_a=0; /* means we specify by hand the vectors */ 367 374 if (info->m_bx || info->m_by || info->m_bz) info->m_b=0; 368 375 if (info->m_cx || info->m_cy || info->m_cz) info->m_c=0; 369 376 377 /* compute the norm from vector a if missing */ 370 378 if (info->m_ax || info->m_ay || info->m_az) { 371 379 double as=sqrt(info->m_ax*info->m_ax+info->m_ay*info->m_ay+info->m_az*info->m_az); … … 373 381 if (!info->m_cx && !info->m_cy && !info->m_cz) info->m_a=info->m_c=as; 374 382 } 375 376 383 if (info->m_a && !info->m_b) info->m_b=info->m_a; 377 384 if (info->m_b && !info->m_c) info->m_c=info->m_b; 378 385 386 /* compute the lattive angles if not set from data file. Not used when in vector mode. */ 379 387 if (info->m_a && !info->m_aa) info->m_aa=90; 380 381 388 if (info->m_aa && !info->m_bb) info->m_bb=info->m_aa; 382 389 if (info->m_bb && !info->m_cc) info->m_cc=info->m_bb; 383 390 391 /* parameters consistency checks */ 384 392 if (!info->m_ax && !info->m_ay && !info->m_az && !info->m_a) { 385 393 fprintf(stderr, … … 414 422 else cs = sqrt(info->m_cx*info->m_cx+info->m_cy*info->m_cy+info->m_cz*info->m_cz); 415 423 416 info->m_ ax = as; info->m_ay = 0; info->m_az= 0;417 info->m_ bx= bs*cos(info->m_cc*DEG2RAD);418 info->m_ by = bs*sin(info->m_cc*DEG2RAD);419 info->m_ bz= 0;420 info->m_c x= cs*cos(info->m_bb*DEG2RAD);424 info->m_bz = as; info->m_by = 0; info->m_bx = 0; 425 info->m_az = bs*cos(info->m_cc*DEG2RAD); 426 info->m_ay = bs*sin(info->m_cc*DEG2RAD); 427 info->m_ax = 0; 428 info->m_cz = cs*cos(info->m_bb*DEG2RAD); 421 429 info->m_cy = cs*(cos(info->m_aa*DEG2RAD)-cos(info->m_cc*DEG2RAD)*cos(info->m_bb*DEG2RAD)) 422 430 /sin(info->m_cc*DEG2RAD); 423 info->m_c z = sqrt(cs*cs - info->m_cx*info->m_cx- info->m_cy*info->m_cy);431 info->m_cx = sqrt(cs*cs - info->m_cz*info->m_cz - info->m_cy*info->m_cy); 424 432 425 433 printf("Single_crystal: %s structure a=%g b=%g c=%g aa=%g bb=%g cc=%g ",
