Message: Re: Replicas inside replicas Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: Replicas inside replicas 

Forum: Geometry
Re: Question Replicas inside replicas (Ivan Konobeev)
Date: 24 Oct, 2012
From: Gabriele Cosmo <Gabriele Cosmo>

Hi Ivan,

you cannot use G4PVReplica for filling your parallelepiped with spheres.
As specified in the documentation, replicas represent -slices- along the
Cartesian axes of a given volume...
You should G4PVPlacement or G4PVParameterisation instead.

Cheers, Gabriele

---------------
On Sat, 29 Sep 2012 14:01:34 GMT, Ivan Konobeev wrote:
> Hello,
> Could anyone, please, help me. I need to fill a volume - cube with
> identical spheres, distributed uniformly. I'm trying to use G4PVReplica
> for this purpose: firstly I create a sphere, then I create a
> parallelepiped (box in terms of Geant4) and fill it with spheres in one
> direction (one axis, 1 dimension) with G4PVReplica. This works
> perfectly. But then I try to replicate this parallelepiped with
> G4PVReplica in another parallelepiped to get parallelepiped with 2
> dimension filled with spheres and then I do the same to get 3 dimension
> filled with spheres. Here I get this:
> *********************************************************************************************************
> * G4Track Information: Particle = proton, Track ID = 1, Parent ID = 0
> *********************************************************************************************************
> 
> Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume
> ProcName
>     0 -100 0 0 25 0 0 0 nucleus initStep
>     1 -100 0 0 25 0.000218 0.000215 0.000215 nucleus hIoni
>     2 -100 0 0 25 0 0 0.000215 nucleus Transportation
>     3 -100 0 0 25 0 0 0.000215 nucleus Transportation
>     4 -100 0 0 25 0 0 0.000215 nucleus Transportation
>     5 -100 0 0 25 0 0 0.000215 nucleus Transportation
>     6 -100 0 0 25 0 0 0.000215 nucleus Transportation
>     7 -100 0 0 25 0 0 0.000215 nucleus Transportation
>     8 -100 0 0 25 0 0 0.000215 nucleus Transportation
>     9 -100 0 0 25 0 0 0.000215 nucleus Transportation
>    10 -100 0 0 25 0 0 0.000215 nucleus Transportation
> 
> -------- WWWW ------- G4Exception-START -------- WWWW -------
> *** G4Exception : GeomNav1002
>       issued by : G4Navigator::ComputeStep()
> Track stuck or not moving.
>           Track stuck, not moving for 10 steps
>           in volume -nucleus- at point (-99.9998,0,0)
>           direction: (1,1.22269e-005,-0.000127861).
>           Potential geometry or navigation problem !
>           Trying pushing it of 1e-007 mm ...Potential overlap in
> geometry!
> 
> *** This is just a warning message. ***
> -------- WWWW -------- G4Exception-END --------- WWWW -------
> 
>    11 -100 1.22e-012 -1.28e-011 25 2.08e-007 1e-007 0.000215 nucleus
> Transportation
>    12 -100 3.51e-008 -3.67e-007 25 0.00655 0.00287 0.00309 nucleus hIoni
>    13 -100 7e-016 -3.74e-007 25 0.00067 3.59e-005 0.00312 nucleus
> Transportation
>    14 -100 -3.43e-006 -9.31e-007 24.9 0.00865 0.00358 0.0067 nucleus
> hIoni
> e.t.c.
> 
> And program runs with absolutely wrong geometry. I really get stuck with
> this, I checked geometry several times, but I didn't see no overlaps
> there. It looks like simple mistake in my program. Please, help me.
> Here is the part of program with geometry:
>   //------------------------------ world volume
> 
>   G4double world_x = 101.0*m;
>   G4double world_y = 101.0*m;
>   G4double world_z = 101.0*m;
>   G4Box* world = new G4Box("world",world_x,world_y,world_z);
>   world_log = new G4LogicalVolume(world,Air,"world_log");
>   world_phys = new
> G4PVPlacement(0,G4ThreeVector(),world_log,"world",0,false,0);
>    
>   //------------------------------ cube
>   
>   G4double cube_x = 0.1*m;
>   G4double cube_y = 0.1*m;
>   G4double cube_z = 0.1*m;
>   G4Box* cube = new G4Box("cube",cube_x,cube_y,cube_z);
>   cube_log = new G4LogicalVolume(cube,Water,"cube_log");
>   cube_phys = new
> G4PVPlacement(0,G4ThreeVector(0.,0.,0.),cube_log,"cube",world_log,false,0);
>   
>  //--------------------------------nuclei of cells (material = protein)
>  
>   G4double Rmin_nucl=0;
>   G4double Rmax_nucl=0.01*m;
>   G4double Phi_nucl=0;
>   G4double DPhi_nucl=twopi;
>   G4double Theta_nucl=0;
>   G4double DTheta_nucl=pi;
>   G4double gap=0.1*m;
>   
>   G4Sphere* nucleus = new G4Sphere
> ("nucleus",Rmin_nucl,Rmax_nucl,Phi_nucl,DPhi_nucl,Theta_nucl,DTheta_nucl);
>   nucleus_log = new G4LogicalVolume(nucleus,Protein,"nucleus_log");
> 
>  //--------------------------------box for replication along Z axis
>   G4double box_z_x = gap/2;
>   G4double box_z_y = gap/2;
>   G4double box_z_z = cube_z;
>   G4Box* box_z = new G4Box("box_z",box_z_x,box_z_y,box_z_z);
>   box_z_log = new G4LogicalVolume(box_z,Water,"box_z_log");
>   G4PVReplica* nucleus_phys = new G4PVReplica("nucleus", nucleus_log,
> box_z_log, kZAxis, box_z_z/gap*2, gap);
>  
>  //--------------------------------box for replication in XZ plane
>   G4double box_xz_x = cube_x;
>   G4double box_xz_y = gap/2;
>   G4double box_xz_z = cube_z;
>   G4Box* box_xz = new G4Box("box_xz",box_xz_x,box_xz_y,box_xz_z);
>   box_xz_log = new G4LogicalVolume(box_xz,Water,"box_xz_log");
>   G4PVReplica* box_z_phys = new G4PVReplica("box_z", box_z_log,
> box_xz_log, kXAxis, box_xz_x/box_z_x, gap);
>  
>  //--------------------------------replication of plane in cube to fill
> it with nuclei
>   G4PVReplica* box_xz_phys = new G4PVReplica("box_xz", box_xz_log,
> cube_log, kYAxis, cube_y/box_xz_y, gap);
> 

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

1 None: Re: Replicas inside replicas   (Ivan Konobeev - 24 Oct, 2012)
 Add Message Add Message
to: "Re: Replicas inside replicas"

 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 ]