Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/materials/src/G4NistMaterialBuilder.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NistMaterialBuilder.cc,v 1.23 2009/11/24 17:19:10 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4NistMaterialBuilder.cc,v 1.27 2010/05/20 13:08:22 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
     
    9595
    9696  G4String name = matname;
    97   if("G4_NYLON-6/6" == matname)  name = "G4_NYLON-6-6";
    98   if("G4_NYLON-6/10" == matname) name = "G4_NYLON-6-10";
     97  if("G4_NYLON-6/6" == matname)  { name = "G4_NYLON-6-6"; }
     98  if("G4_NYLON-6/10" == matname) { name = "G4_NYLON-6-10";}
    9999
    100100  if (verbose > 1) {
     
    107107  G4Material* mat = 0;
    108108
    109   for (G4int i=0; i<nMaterials; i++) {
     109  for (G4int i=0; i<nMaterials; ++i) {
    110110
    111111    // Is inside NIST DB?
     
    124124  // Check the list of all materials
    125125  if (nmat > 0) {
    126     for (G4int i=0; i<nmat; i++) {
     126    for (G4int i=0; i<nmat; ++i) {
    127127      if(name == ((*theMaterialTable)[i])->GetName()) {
    128128        mat = (*theMaterialTable)[i];
     
    152152  if (nMaterials == 0)  return mat;
    153153
    154   for (G4int i=0; i<nMaterials; i++) {
     154  for (G4int i=0; i<nMaterials; ++i) {
    155155    if (name == names[i]) {
    156156      mat = BuildMaterial(i, isotopes);
     
    226226  AddMaterial(name,dens*cm3/g,0,0.,nm,state,temp,pressure);
    227227
    228   for (G4int i=0; i<nm; i++) {
     228  for (G4int i=0; i<nm; ++i) {
    229229    G4int Z = G4int((elmBuilder->FindOrBuildElement(elm[i]))->GetZ());
    230230    AddElementByAtomCount(Z, nbAtoms[i]);
     
    258258  AddMaterial(name,dens*cm3/g,0,0.,nm,state,temp,pressure);
    259259
    260   for (G4int i=0; i<nm; i++) {
     260  for (G4int i=0; i<nm; ++i) {
    261261    G4int Z = G4int((elmBuilder->FindOrBuildElement(elm[i]))->GetZ());
    262262    AddElementByWeightFraction(Z, w[i]);
     
    276276{
    277277  G4int idx = -1;
    278   for (G4int i=0; i<nMaterials; i++) {
     278  for (G4int i=0; i<nMaterials; ++i) {
    279279    if (name == names[i]) {
    280280      G4cout << "G4NistMaterialBuilder::ConstructNewMaterial:"
     
    350350//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    351351
    352 void G4NistMaterialBuilder::ListMaterials(const G4String& list)
    353 {
    354   if (list == "simple")   ListNistSimpleMaterials();
    355   if (list == "compound") ListNistCompoundMaterials();
    356   if (list == "hep")      ListHepMaterials();
    357 
    358   if (list == "all") {
     352void G4NistMaterialBuilder::ListMaterials(const G4String& mnam)
     353{
     354  if (mnam == "simple")        { ListNistSimpleMaterials(); }
     355  else if (mnam == "compound") { ListNistCompoundMaterials(); }
     356  else if (mnam == "hep")      { ListHepMaterials(); }
     357  else if (mnam == "space")    { ListSpaceMaterials(); }
     358
     359  else if (mnam == "all") {
    359360    ListNistSimpleMaterials();
    360361    ListNistCompoundMaterials();
    361362    ListHepMaterials();
     363    ListSpaceMaterials();
    362364  }
    363365}
     
    372374  G4cout << " Z Name  ChFormula        density(g/cm^3)  I(eV)       " << G4endl;
    373375  G4cout << "=======================================================" << G4endl;
    374   for (G4int i=0; i<nElementary; i++) {DumpElm(i);}
     376  for (G4int i=0; i<nElementary; ++i) {DumpElm(i);}
    375377  G4cout << "=======================================================" << G4endl;
    376378}
     
    384386  G4cout << " Ncomp Name  ChFormula        density(g/cm^3)  I(eV)   " << G4endl;
    385387  G4cout << "=======================================================" << G4endl;
    386   for (G4int i=nElementary; i<nNIST; i++) {DumpMix(i);}
     388  for (G4int i=nElementary; i<nNIST; ++i) {DumpMix(i);}
    387389  G4cout << "=======================================================" << G4endl;
    388390}
     
    397399  G4cout << " Ncomp Name  ChFormula        density(g/cm^3)  I(eV)   " << G4endl;
    398400  G4cout << "=======================================================" << G4endl;
    399   for (G4int i=nNIST; i<nMaterials; i++) {DumpMix(i);}
     401  for (G4int i=nNIST; i<nHEP; ++i) {DumpMix(i);}
     402  G4cout << "=======================================================" << G4endl;
     403}
     404
     405//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     406
     407void G4NistMaterialBuilder::ListSpaceMaterials()
     408{
     409  G4cout << "=======================================================" << G4endl;
     410  G4cout << "###           Space ISS Materials                    ##" << G4endl;
     411  G4cout << "=======================================================" << G4endl;
     412  G4cout << " Ncomp Name  ChFormula        density(g/cm^3)  I(eV)   " << G4endl;
     413  G4cout << "=======================================================" << G4endl;
     414  for (G4int i=nHEP; i<nMaterials; ++i) {DumpMix(i);}
    400415  G4cout << "=======================================================" << G4endl;
    401416}
     
    470485  }
    471486
    472   nMaterials++;
     487  ++nMaterials;
    473488
    474489  if(verbose > 1) {
     
    497512    return;
    498513  } else {
    499     for(G4int i=0; i<nMaterials; i++) {
     514    for(G4int i=0; i<nMaterials; ++i) {
    500515      if(nameMat == names[i]) {
    501516        chFormulas[i] = ch;
     
    526541    return;
    527542  } else {
    528     for(G4int i=0; i<nMaterials; i++) {
     543    for(G4int i=0; i<nMaterials; ++i) {
    529544      if(nameMat == names[i]) {
    530545        temperatures[i] = t;
     
    545560  elements.push_back(Z);
    546561  fractions.push_back(w);
    547   nCurrent--;
    548   nComponents++;
     562  --nCurrent;
     563  ++nComponents;
    549564  if (nCurrent == 0) {
    550565    G4int n = nMaterials - 1;
     
    553568    G4int imax = imin + components[n];
    554569
    555     for(G4int i=imin; i<imax; i++) {sum += fractions[i];}
    556     if (sum > 0.0) for (G4int i=imin; i<imax; i++) {fractions[i] /= sum;}
     570    for(G4int i=imin; i<imax; ++i) {sum += fractions[i];}
     571    if (sum > 0.0) for (G4int i=imin; i<imax; ++i) {fractions[i] /= sum;}
    557572  }
    558573}
     
    590605void G4NistMaterialBuilder::Initialise()
    591606{
    592   if (verbose > 0)
     607  if (verbose > 0) {
    593608    G4cout << "### G4NistMaterialBuilder::Initialise()" << G4endl;
    594 
     609  }
    595610  NistSimpleMaterials();
    596611  NistCompoundMaterials();
    597612  HepAndNuclearMaterials();
    598 
    599   if (verbose > 1) ListMaterials("all");
     613  SpaceMaterials();
     614
     615  if (verbose > 1) { ListMaterials("all"); }
    600616}
    601617
     
    13191335  AddElementByWeightFraction( 7, 0.035451);
    13201336  AddElementByWeightFraction( 8, 0.7101  );
    1321 
     1337 
    13221338  AddMaterial("G4_MUSCLE_WITHOUT_SUCROSE", 1.07, 0, 74.2, 4);
    13231339  AddElementByWeightFraction( 1, 0.101969);
     
    14431459
    14441460  AddMaterial("G4_POLYTRIFLUOROCHLOROETHYLENE", 2.1, 0, 120.7, 3);
     1461  // correct chemical name Polychlorotrifluoroethylene [CF2CClF]n, IvantchenkoA.
    14451462  AddElementByWeightFraction( 6, 0.20625 );
    14461463  AddElementByWeightFraction( 9, 0.489354);
     
    17131730
    17141731  AddMaterial("G4_GRAPHITE", 2.21, 6, 78.);
     1732  AddChemicalFormula("G4_GRAPHITE","Graphite");
     1733
    17151734  nNIST = nMaterials;
    1716   AddChemicalFormula("G4_GRAPHITE","Graphite");
    17171735}
    17181736
     
    17381756
    17391757  AddMaterial("G4_GRAPHITE_POROUS", 1.7, 6, 78.);
    1740   AddChemicalFormula("G4_GRAPHITE","Graphite");
    1741 
    1742 }
    1743 
    1744 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    1745 
     1758  AddChemicalFormula("G4_GRAPHITE_POROUS","Graphite");
     1759
     1760  // LUCITE is equal to plustiglass
     1761  AddMaterial("G4_LUCITE", 1.19, 0, 74., 3);
     1762  AddElementByWeightFraction( 1, 0.080538);
     1763  AddElementByWeightFraction( 6, 0.599848);
     1764  AddElementByWeightFraction( 8, 0.319614);
     1765
     1766  // SRIM-2008 materials
     1767  AddMaterial("G4_BRASS", 8.52, 0, 0.0, 3);
     1768  AddElementByAtomCount("Cu", 62);
     1769  AddElementByAtomCount("Zn", 35);
     1770  AddElementByAtomCount("Pb" , 3);
     1771
     1772  AddMaterial("G4_BRONZE", 8.82, 0, 0.0, 3);
     1773  AddElementByAtomCount("Cu", 89);
     1774  AddElementByAtomCount("Zn",  9);
     1775  AddElementByAtomCount("Pb" , 2);
     1776
     1777  AddMaterial("G4_STAINLESS-STEEL", 8.00, 0, 0.0, 3);
     1778  AddElementByAtomCount("Fe", 74);
     1779  AddElementByAtomCount("Cr",  8);
     1780  AddElementByAtomCount("Ni" ,18);
     1781
     1782  nHEP = nMaterials;
     1783}
     1784
     1785//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     1786
     1787void G4NistMaterialBuilder::SpaceMaterials()
     1788{
     1789  // density in g/cm3
     1790
     1791  AddMaterial("G4_KEVLAR" , 1.44, 0, 0.0, 4);
     1792  AddElementByAtomCount("C", 14);
     1793  AddElementByAtomCount("H", 10);
     1794  AddElementByAtomCount("O", 2);
     1795  AddElementByAtomCount("N", 2);
     1796
     1797  AddMaterial("G4_DACRON" , 1.40, 0, 0.0, 3);   // G4_POLYETHYLENE_TEREPHTALATE
     1798  AddElementByAtomCount("C", 10);
     1799  AddElementByAtomCount("H", 8);
     1800  AddElementByAtomCount("O", 4);
     1801
     1802  AddMaterial("G4_NEOPRENE" , 1.23, 0, 0.0, 3);   // POLYCLOROPRENE
     1803  AddElementByAtomCount("C", 4);
     1804  AddElementByAtomCount("H", 5);
     1805  AddElementByAtomCount("Cl", 1);
     1806}
     1807
     1808
     1809
     1810
Note: See TracChangeset for help on using the changeset viewer.