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

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

Files:
1 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