I am trying to run a code, but there appears this error message:
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : mat035
issued by : G4Material::AddMaterial()
Attempt to add more than the declared number of components.
*** Fatal Exception *** core dump ***
**** Track information is not available at this moment
**** Step information is not available at this moment
Hello @pico , In fact, i have defined it, see, i will post here the complete code envolving the definitions of materials and etc.
auto Aluminio = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al");
auto Ouro = G4NistManager::Instance()->FindOrBuildMaterial("G4_Au");
auto Ar = G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR");
auto Niquel = G4NistManager::Instance()->FindOrBuildMaterial("G4_Ni");
auto Cromo = G4NistManager::Instance()->FindOrBuildMaterial("G4_Cr");
auto Nicromo = new G4Material("Nichrome", densidadenicr, 2);
Nicromo->AddMaterial(Niquel,77.0*perCent);
Nicromo->AddMaterial(Cromo,23.0*perCent);
auto Argonio = G4NistManager::Instance()->FindOrBuildMaterial("G4_Ne");
auto Metano = G4NistManager::Instance()->FindOrBuildMaterial("G4_METHANE");
double temperaturagas = 300*kelvin;
double pressaogas = 1*atmosphere;
double densidadegas = 20.17976*760/(62,3637*300)*g/L;
auto Gas = new G4Material("Gás", 10,20,densidadegas,kStateGas,temperaturagas,pressaogas);
Gas->AddMaterial(Argonio,90.0*perCent);
Gas->AddMaterial(Metano,10.0*perCent);
auto Vacuo = G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic");
As you can see, i have defined everything, but i don’t know yet why the error is happening.
I am afraid that the problem has nothing to do with the materials in fact.
I think the problem is with the “Gás”. By using the constructor with string, int, int … you are using a constructor that will try to be a z=10, A=20 (Ne-20) gas.
You want to use it as:
auto Gas = new G4Material("Gás", densidadegas, 2, kStateGas,temperaturagas,pressaogas);
Notice that I do not have 10 and 20 (what are they supposed to represent?) and I have a 2 where the number of components go.