| Message: Materials Definition | Not Logged In (login) |
|
Good Evening all,
I am not sure I am posting this in the correct section of the forum for this I apologise. I am having a few issues definine my materials in my DetectorConstruct file for lines 87 through 107 I have written
G4double a, z; G4double density, temperature, pressure; G4int nel;
//Water
G4Element* H = new G4Element("Hydrogen", "H", z=2., a= 1.0079*g/mole);
G4Element* O = new G4Element("Oxygen" , "O", z=8., a= 16.00*g/mole);
G4Material* Water = new G4Material("Water", density= 1*g/cm3);
Water->AddElement(H, natoms=2);
Water->AddElement(O, natoms=1);
//Steel
G4Element* Fe = new G4Element("Iron", "Fe", z=26., a= 55.845*g/mole);
G4Element* Cr = new G4Element("Chromium" , "Cr", z=24., a= 51.9961*g/mole);
G4Element* Ni = new G4Element("Nickel", "Ni", z=28., a= 58.6934*g/mole);
G4Material* SSteel = new G4Material("SSteel", density= 8.03*g/cm3);
SSteel->AddElement(Fe, 74*perCent);
SSteel->AddElement(Cr, 18*perCent);
SSteel->AddElement(Ni, 8*perCent);
I am being returned two errors one reading error C2661:'G4Material::G4Material' : no overloaded function takes 2 arguments which relates to lines 95 and 104 of my code and another reading error C2065:'natoms' : undeclared identifier which relates to 96 and 97. I was wondering if anybody has a quick fix to this problem could advise me to where Ive gone wrong. Im pretty new to C++ (or programming of any nature) so I apologise for my rubbishness gratitude in advance Nick
|
| Inline Depth: | Outline Depth: | Add message: |
|
to: |