Message: Modify geometry by changing material Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Modify geometry by changing material 

Forum: Geometry
Date: 22 Oct, 2012
From: C Mos <C Mos>

Hi I was looking at changing the density of an object already loaded in my universe. I notice that G4Material does not allow me to change the density of an already defined material

  //Water  G4_WATER  H_2O
  water = new G4Material("Water",density=1.*kg/m3,nElem=2);
  water->AddElement(elH, nElem=2);
  water->AddElement(elO, nElem=1);

  //Next, definition of denserWater....

  (...)

  //Through detector messenger:
  water->ChangeDensity(...) //Function not available in geant

However I found I could do something like this:

myLogicalVolume->SetMaterial(denserWater);

// OR

myLogicalVolume->UpdateMaterial(denserWater);

//I am guessing I should call G4RunManager::GetRunManager()->GeometryHasBeenModified();

Is there a difference between these functions? Which is correct? Thank you!

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Idea: Re: Modify geometry by changing material   (Vladimir Ivanchenko - 24 Oct, 2012)
1 More: Re: Modify geometry by changing material   (C Mos - 04 Nov, 2012)
2 Feedback: Re: Modify geometry by changing material   (C Mos - 05 Nov, 2012)
1 Idea: Re: Modify geometry by changing material   (Michael H. Kelsey - 06 Nov, 2012)
 Add Message Add Message
to: "Modify geometry by changing material"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]