Changeset 1315 for trunk/source/materials/src/G4NistMaterialBuilder.cc
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/materials/src/G4NistMaterialBuilder.cc
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4NistMaterialBuilder.cc,v 1.2 3 2009/11/24 17:19:10vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3$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 $ 28 28 // 29 29 // … … 95 95 96 96 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";} 99 99 100 100 if (verbose > 1) { … … 107 107 G4Material* mat = 0; 108 108 109 for (G4int i=0; i<nMaterials; i++) {109 for (G4int i=0; i<nMaterials; ++i) { 110 110 111 111 // Is inside NIST DB? … … 124 124 // Check the list of all materials 125 125 if (nmat > 0) { 126 for (G4int i=0; i<nmat; i++) {126 for (G4int i=0; i<nmat; ++i) { 127 127 if(name == ((*theMaterialTable)[i])->GetName()) { 128 128 mat = (*theMaterialTable)[i]; … … 152 152 if (nMaterials == 0) return mat; 153 153 154 for (G4int i=0; i<nMaterials; i++) {154 for (G4int i=0; i<nMaterials; ++i) { 155 155 if (name == names[i]) { 156 156 mat = BuildMaterial(i, isotopes); … … 226 226 AddMaterial(name,dens*cm3/g,0,0.,nm,state,temp,pressure); 227 227 228 for (G4int i=0; i<nm; i++) {228 for (G4int i=0; i<nm; ++i) { 229 229 G4int Z = G4int((elmBuilder->FindOrBuildElement(elm[i]))->GetZ()); 230 230 AddElementByAtomCount(Z, nbAtoms[i]); … … 258 258 AddMaterial(name,dens*cm3/g,0,0.,nm,state,temp,pressure); 259 259 260 for (G4int i=0; i<nm; i++) {260 for (G4int i=0; i<nm; ++i) { 261 261 G4int Z = G4int((elmBuilder->FindOrBuildElement(elm[i]))->GetZ()); 262 262 AddElementByWeightFraction(Z, w[i]); … … 276 276 { 277 277 G4int idx = -1; 278 for (G4int i=0; i<nMaterials; i++) {278 for (G4int i=0; i<nMaterials; ++i) { 279 279 if (name == names[i]) { 280 280 G4cout << "G4NistMaterialBuilder::ConstructNewMaterial:" … … 350 350 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 351 351 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") { 352 void 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") { 359 360 ListNistSimpleMaterials(); 360 361 ListNistCompoundMaterials(); 361 362 ListHepMaterials(); 363 ListSpaceMaterials(); 362 364 } 363 365 } … … 372 374 G4cout << " Z Name ChFormula density(g/cm^3) I(eV) " << G4endl; 373 375 G4cout << "=======================================================" << G4endl; 374 for (G4int i=0; i<nElementary; i++) {DumpElm(i);}376 for (G4int i=0; i<nElementary; ++i) {DumpElm(i);} 375 377 G4cout << "=======================================================" << G4endl; 376 378 } … … 384 386 G4cout << " Ncomp Name ChFormula density(g/cm^3) I(eV) " << G4endl; 385 387 G4cout << "=======================================================" << G4endl; 386 for (G4int i=nElementary; i<nNIST; i++) {DumpMix(i);}388 for (G4int i=nElementary; i<nNIST; ++i) {DumpMix(i);} 387 389 G4cout << "=======================================================" << G4endl; 388 390 } … … 397 399 G4cout << " Ncomp Name ChFormula density(g/cm^3) I(eV) " << G4endl; 398 400 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 407 void 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);} 400 415 G4cout << "=======================================================" << G4endl; 401 416 } … … 470 485 } 471 486 472 nMaterials++;487 ++nMaterials; 473 488 474 489 if(verbose > 1) { … … 497 512 return; 498 513 } else { 499 for(G4int i=0; i<nMaterials; i++) {514 for(G4int i=0; i<nMaterials; ++i) { 500 515 if(nameMat == names[i]) { 501 516 chFormulas[i] = ch; … … 526 541 return; 527 542 } else { 528 for(G4int i=0; i<nMaterials; i++) {543 for(G4int i=0; i<nMaterials; ++i) { 529 544 if(nameMat == names[i]) { 530 545 temperatures[i] = t; … … 545 560 elements.push_back(Z); 546 561 fractions.push_back(w); 547 nCurrent--;548 nComponents++;562 --nCurrent; 563 ++nComponents; 549 564 if (nCurrent == 0) { 550 565 G4int n = nMaterials - 1; … … 553 568 G4int imax = imin + components[n]; 554 569 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;} 557 572 } 558 573 } … … 590 605 void G4NistMaterialBuilder::Initialise() 591 606 { 592 if (verbose > 0) 607 if (verbose > 0) { 593 608 G4cout << "### G4NistMaterialBuilder::Initialise()" << G4endl; 594 609 } 595 610 NistSimpleMaterials(); 596 611 NistCompoundMaterials(); 597 612 HepAndNuclearMaterials(); 598 599 if (verbose > 1) ListMaterials("all"); 613 SpaceMaterials(); 614 615 if (verbose > 1) { ListMaterials("all"); } 600 616 } 601 617 … … 1319 1335 AddElementByWeightFraction( 7, 0.035451); 1320 1336 AddElementByWeightFraction( 8, 0.7101 ); 1321 1337 1322 1338 AddMaterial("G4_MUSCLE_WITHOUT_SUCROSE", 1.07, 0, 74.2, 4); 1323 1339 AddElementByWeightFraction( 1, 0.101969); … … 1443 1459 1444 1460 AddMaterial("G4_POLYTRIFLUOROCHLOROETHYLENE", 2.1, 0, 120.7, 3); 1461 // correct chemical name Polychlorotrifluoroethylene [CF2CClF]n, IvantchenkoA. 1445 1462 AddElementByWeightFraction( 6, 0.20625 ); 1446 1463 AddElementByWeightFraction( 9, 0.489354); … … 1713 1730 1714 1731 AddMaterial("G4_GRAPHITE", 2.21, 6, 78.); 1732 AddChemicalFormula("G4_GRAPHITE","Graphite"); 1733 1715 1734 nNIST = nMaterials; 1716 AddChemicalFormula("G4_GRAPHITE","Graphite");1717 1735 } 1718 1736 … … 1738 1756 1739 1757 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 1787 void 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.