Message: Re: successively subtracting -> memory limit Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: successively subtracting -> memory limit 

Forum: Geometry
Re: Question successively subtracting -> memory limit (Yen-Yung Chang)
Date: 24 Oct, 2012
From: Vladimir Grichine <Vladimir Grichine>

>     for (int i=0;i<=7;i++){
>        for (int j=0;j<=7;j++){
>             G4double pxl_PosZ = 0.0*mm;
>             G4double pxl_PosX = 2.88*(i-3.5)*mm;
>             G4double pxl_PosY = 2.88*(j-3.5)*mm;
>             G4ThreeVector hole_pos = G4ThreeVector(pxl_PosX,pxl_PosY,pxl_PosZ);
>             char numHole[4];sprintf(numHole,"%d%d",j+1+(i*8));
> Mask_solid = 
> new G4SubtractionSolid(numHole,Mask_solid,MaskHole_box,0,hole_pos);}}
> 
> in order to make a 8*8 array of holes on the mask. I could make at most
> 5 rows of holes, which was 40 times recursively using the function
> 
> the_mask = new G4SubtractionSolid(..., the_mask, the_hole, ...)
> 
> , without problem. If I made more, it just caused memory problem and
> stocked there. Do you have any better way to do this without so many
> "new" declaration occupies memory? Thank you all in advance!
> 
Can you show more code of the construction? You should prepare new solid (MaskHole ?) for each new hole and subtract it from prepared in advance Mask_solid.

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

1 None: Re: successively subtracting -> memory limit   (Yen-Yung Chang - 24 Oct, 2012)
2 None: Re: successively subtracting -> memory limit   (Yen-Yung Chang - 24 Oct, 2012)
1 None: Re: successively subtracting -> memory limit   (Vladimir Grichine - 24 Oct, 2012)
 Add Message Add Message
to: "Re: successively subtracting -> memory limit"

 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 ]