| 661 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
| 662 | |
| 663 | G4Material* G4Material::GetMaterial(const G4String& materialName, G4bool warn) |
| 664 | { |
| 665 | // search the material by its name |
| 666 | for (auto const & j : *GetMaterialTable()) { |
| 667 | if (j->GetName() == materialName) { |
| 668 | return j; |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | // the material does not exist in the table |
| 673 | if (warn) { |
| 674 | G4cout << "G4Material::GetMaterial() WARNING: The material: " << materialName |
| 675 | << " does not exist in the table. Return NULL pointer." << G4endl; |
| 676 | } |
| 677 | return nullptr; |
| 678 | } |
| 679 | |
| 680 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
| 681 |
no test coverage detected