Changeset 2927

Show
Ignore:
Timestamp:
09/06/10 16:55:55 (17 months ago)
Author:
farhi
Message:

samples: updated headers, fixed usage of nb_toms = multiplicity of chemical formula within unit cell

Location:
trunk/nlib/samples
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/nlib/samples/Isotropic_Sqw.comp

    r2923 r2927  
    6767*   transparently, so that it can be used like a regular sample object. 
    6868*   It supports the OFF and NOFF file format but not COFF (colored faces).  
    69 *   Such files may be generated from XYZ data using qhull/powercrust, and  
    70 *   viewed with geomview 
     69*   Such files may be generated from XYZ data using: 
     70*     qhull < coordinates.xyz Qx Qv Tv o > geomview.off  
     71*   and viewed with geomview or java -jar jroff.jar (see below). 
    7172*   The default size of the object depends of the OFF file data, but its  
    7273*   bounding box may be resized using xwidth,yheight and zdepth. 
     
    167168* sigma_inc:[barns] Incoherent Scattering cross-section. Use -1 to unactivate. 
    168169* sigma_abs:[barns] Absorption cross-section at 2200 m/s. Use -1 to unactivate. 
    169 * V_rho:     [AA-3] Density of atoms (nb atoms/unit cell V_0). 
     170* V_rho:     [AA-3] Density of scattering elements (nb atoms/unit cell V_0). 
    170171* T:            [K] Temperature of sample, detailed balance 
    171172* 
     
    236237* Cross sections for compounds:       http://www.ncnr.nist.gov/resources/sldcalc.html 
    237238* %L 
     239* Web Elements                        http://www.webelements.com/ 
     240* %L 
     241* Fullprof powder refinement:         http://www.ill.eu/sites/fullprof/index.html 
     242* %L 
     243* Crystallographica software:         http://www.crystallographica.com/ 
     244* %L 
    238245* Example data file <a href="../data/He4_liq_coh.sqw">He4_liq_coh.sqw</a> 
    239246* %L 
    240247* The <a href="PowderN.html">PowderN</a> component. 
    241248* %L 
    242 * Web Elements                        http://www.webelements.com/ 
    243 * %L 
    244249* The test/example instrument <a href="../examples/Test_Isotropic_Sqw.instr">Test_Isotropic_Sqw.instr</a>. 
    245250* %L 
    246 * Geomview and Object File Format (OFF) <http|://www.geomview.org> 
     251* Geomview and Object File Format (OFF) <http://www.geomview.org> 
    247252* %L 
    248 * Powercrust/qhull <http://www.cs.utexas.edu/users/amenta/powercrust> 
     253* Java version of Geomview (display only) jroff.jar <http://www.holmes3d.net/graphics/roffview/>  
     254* %L 
     255* Powercrust/qhull <http://qhull.org> 
    249256* %E 
    250257*****************************************************************************/ 
     
    754761    "density", 
    755762    "weight", 
    756     "nb_atoms", 
     763    "nb_atoms","multiplicity", 
    757764    NULL); 
    758765  if (parsing) { 
     
    781788    if (parsing[22] )     mat_weight  =atof(parsing[22]); 
    782789    if (parsing[23] )     mat_at_nb   =atof(parsing[23]); 
    783     for (i=0; i<=23; i++) if (parsing[i]) free(parsing[i]); 
     790    if (parsing[24] )     mat_at_nb   =atof(parsing[24]); 
     791    for (i=0; i<=24; i++) if (parsing[i]) free(parsing[i]); 
    784792    free(parsing); 
    785793  } 
    786  
     794   
     795  /* compute the scattering unit density from material weight and density */ 
     796  /* the weight of the scattering element is the chemical formula molecular weight  
     797   * times the nb of chemical formulae in the scattering element (nb_atoms) */ 
    787798  if (!Sqw->rho && mat_density > 0 && mat_weight > 0 && mat_at_nb > 0) { 
    788799    /* molar volume [cm^3/mol] = weight [g/mol] / density [g/cm^3] */ 
    789800    /* atom density per Angs^3 = [mol/cm^3] * N_Avogadro *(1e-8)^3 */ 
    790     Sqw->rho = mat_density/mat_weight/1e24*6.02214199e23/mat_at_nb; 
    791     if (Sqw->verbose_output > 0) printf("Isotropic_Sqw: %s: Computing atom density V_rho=%g [AA^-3] from file %s\n", Sqw->compname, Sqw->rho, file); 
     801    Sqw->rho = mat_density/(mat_weight*mat_at_nb)/1e24*6.02214199e23; 
     802    if (Sqw->verbose_output > 0) printf("Isotropic_Sqw: %s: Computing scattering unit density V_rho=%g [AA^-3] from file %s\n", Sqw->compname, Sqw->rho, file); 
     803  } 
     804   
     805  /* the scattering unit cross sections are the chemical formula onces  
     806   * times the nb of chemical formulae in the scattering element */ 
     807  if (mat_at_nb > 0) {  
     808    Sqw->s_abs *= mat_at_nb; Sqw->s_inc *= mat_at_nb; Sqw->s_coh *= mat_at_nb;  
    792809  } 
    793810 
  • trunk/nlib/samples/PowderN.comp

    r2923 r2927  
    4949*   transparently, so that it can be used like a regular sample object. 
    5050*   It supports the OFF and NOFF file format but not COFF (colored faces).  
    51 *   Such files may be generated from XYZ data using qhull/powercrust, and  
    52 *   viewed with geomview 
     51*   Such files may be generated from XYZ data using: 
     52*     qhull < coordinates.xyz Qx Qv Tv o > geomview.off  
     53*   and viewed with geomview or java -jar jroff.jar (see below). 
    5354*   The default size of the object depends of the OFF file data, but its  
    5455*   bounding box may be resized using xwidth,yheight and zdepth. 
     
    158159* weight:   Atomic/molecular weight of material [g/mol] 
    159160* density:  Density of material. rho=density/weight/1e24*N_A. [g/cm^3] 
    160 * nb_atoms: Number of atoms per unit cell [1] 
     161* nb_atoms: Number of sub-unit per unit cell, that is ratio of sigma for chemical formula to sigma per unit cell [1] 
    161162* 
    162163* %L 
     
    171172* Cross sections for compounds:       http://www.ncnr.nist.gov/resources/sldcalc.html 
    172173* %L 
    173 * Fullprof powder refinement:         http://www-llb.cea.fr/fullweb/fp2k/fp2k.htm 
    174 * %L 
    175174* Web Elements                        http://www.webelements.com/ 
    176175* %L 
    177 * Geomview and Object File Format (OFF) <http|://www.geomview.org> 
    178 * %L 
    179 * Powercrust/qhull <http://www.cs.utexas.edu/users/amenta/powercrust> 
     176* Fullprof powder refinement:         http://www.ill.eu/sites/fullprof/index.html 
     177* %L 
     178* Crystallographica software:         http://www.crystallographica.com/ 
     179* %L 
     180* Geomview and Object File Format (OFF) <http://www.geomview.org> 
     181* %L 
     182* Java version of Geomview (display only) jroff.jar <http://www.holmes3d.net/graphics/roffview/>  
     183* %L 
     184* Powercrust/qhull <http://qhull.org> 
    180185* 
    181186* %E 
     
    276281      "density", 
    277282      "weight", 
    278       "nb_atoms", 
     283      "nb_atoms","multiplicity", 
    279284      NULL); 
    280285 
     
    303308      if (parsing[21] && !info->at_weight)     info->at_weight    =atof(parsing[21]); 
    304309      if (parsing[22] && info->at_nb <= 1)  info->at_nb    =atof(parsing[22]); 
    305       for (i=0; i<=22; i++) if (parsing[i]) free(parsing[i]); 
     310      if (parsing[23] && info->at_nb <= 1)  info->at_nb    =atof(parsing[23]); 
     311      for (i=0; i<=23; i++) if (parsing[i]) free(parsing[i]); 
    306312      free(parsing); 
    307313    } 
     
    535541  } 
    536542 
     543  /* compute the scattering unit density from material weight and density */ 
     544  /* the weight of the scattering element is the chemical formula molecular weight  
     545   * times the nb of chemical formulae in the scattering element (nb_atoms) */ 
    537546  if (!line_info.V_0 && line_info.at_nb > 0 
    538547    && line_info.at_weight > 0 && line_info.rho > 0) { 
     
    541550    line_info.V_0 = line_info.at_nb 
    542551      /(line_info.rho/line_info.at_weight/1e24*6.02214199e23); 
     552  } 
     553   
     554  /* the scattering unit cross sections are the chemical formula onces  
     555   * times the nb of chemical formulae in the scattering element */ 
     556  if (line_info.at_nb > 0) {  
     557    line_info.sigma_a *= line_info.at_nb; line_info.sigma_i *= line_info.at_nb; 
    543558  } 
    544559 
  • trunk/nlib/samples/Single_crystal.comp

    r2923 r2927  
    3636*   transparently, so that it can be used like a regular sample object. 
    3737*   It supports the OFF and NOFF file format but not COFF (colored faces).  
    38 *   Such files may be generated from XYZ data using qhull/powercrust, and  
    39 *   viewed with geomview 
     38*   Such files may be generated from XYZ data using: 
     39*     qhull < coordinates.xyz Qx Qv Tv o > geomview.off  
     40*   and viewed with geomview or java -jar jroff.jar (see below). 
    4041*   The default size of the object depends of the OFF file data, but its  
    4142*   bounding box may be resized using xwidth,yheight and zdepth. 
     
    8687*           ax=3.0282, by=3.0282, cz=3.0282/2) 
    8788* 
    88 * %BUGS: 
    89 * The component is known not to work properly as a Bragg monochromator. The  
    90 * reason is likely to relate to the internal definition of reciprocal space  
    91 * orientation. Investigation undergoing.  
    92 * 
    9389* Also, always use a non-zero value of delta_d_d. 
    9490* 
     
    105101*               The OFF file may be generated from XYZ coordinates using qhull/powercrust [str] 
    106102* 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] 
     103* mosaic:    Crystal mosaic (isotropic), gaussian RMS. Puts the crystal in the  
     104*            isotropic mosaic model state, thus disregarding other mosaicity parameters. [arc minutes] 
    108105* mosaic_a:  Horizontal (rotation around lattice vector a) mosaic (anisotropic), gaussian RMS.  
    109 * Put the crystal in the anisotropic crystal vector state. I.e. model mosaicity 
    110 * through rotation around the crystal lattice vectors. Has precedence over 
    111 * 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. Puts the crystal 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] 
     106*            Put the crystal in the anisotropic crystal vector state. I.e. model mosaicity 
     107*            through rotation around the crystal lattice vectors. Has precedence over 
     108*            in-plane mosaic model. [arc minutes] 
     109* mosaic_b:  Vertical (rotation around lattice vector b) mosaic (anisotropic),  
     110*            gaussian RMS. [arc minutes] 
     111* mosaic_c:  Out-of-plane (Rotation around lattice vector c) mosaic (anisotropic),  
     112*            gaussian RMS [arc minutes] 
     113* mosaic_AB: In Plane mosaic rotation and plane vectors (anisotropic),  
     114*            mosaic_A, mosaic_B, A_h,A_k,A_l, B_h,B_k,B_l. Puts the crystal in  
     115*            the in-plane mosaic state. Vectors A and B define plane in which  
     116*            the crystal roation is defined, and mosaic_A, mosaic_B, denotes the  
     117*            resp. mosaicities (gaussian RMS) with respect to the the two  
     118*            reflections chosen by A and B (Miller indices). [arc_minutes, arc_minutes,1, 1, 1, 1, 1, 1] 
    115119*  
    116120* recip_cell: Choice of direct/reciprocal (0/1) unit cell definition [1] 
     
    152156* Cross sections for compounds:       http://www.ncnr.nist.gov/resources/sldcalc.html 
    153157* %L 
    154 * Geomview and Object File Format (OFF) <http|://www.geomview.org> 
     158* Fullprof powder refinement:         http://www.ill.eu/sites/fullprof/index.html 
    155159* %L 
    156 * Powercrust/qhull <http://www.cs.utexas.edu/users/amenta/powercrust> 
     160* Crystallographica software:         http://www.crystallographica.com/ 
     161* %L 
     162* Geomview and Object File Format (OFF) <http://www.geomview.org> 
     163* %L 
     164* Java version of Geomview (display only) jroff.jar <http://www.holmes3d.net/graphics/roffview/>  
     165* %L 
     166* Powercrust/qhull <http://qhull.org> 
    157167* 
    158168* %E 
     
    333343        "lattice_bb", 
    334344        "lattice_cc", 
    335         "nb_atoms", 
     345        "nb_atoms","multiplicity", 
    336346        NULL); 
    337347 
     
    354364        if (parsing[15] && !info->m_cc)   info->m_cc=atof(parsing[15]); 
    355365        if (parsing[16])   nb_atoms=atof(parsing[16]); 
    356         for (i=0; i<=16; i++) if (parsing[i]) free(parsing[i]); 
     366        if (parsing[17])   nb_atoms=atof(parsing[17]); 
     367        for (i=0; i<=17; i++) if (parsing[i]) free(parsing[i]); 
    357368        free(parsing); 
    358369      } 
    359370    } 
     371     
     372    if (nb_atoms > 1) { info->sigma_a *= nb_atoms; info->sigma_i *= nb_atoms; } 
    360373 
    361374    /* special cases for the structure definition */ 
     
    685698    } 
    686699    return(info->count = i); 
    687   } 
     700  } /* read_hkl_data */ 
    688701#endif /* !SINGLE_CRYSTAL_DECL */ 
    689702 
     
    719732  hkl_info.sigma_a = sigma_abs; 
    720733  hkl_info.sigma_i = sigma_inc; 
    721   hkl_info.recip = recip_cell; 
     734  hkl_info.recip   = recip_cell; 
    722735 
    723736  /* default format h,k,l,F,F2  */