02.05.2014 Views

PENELOPE 2003 - OECD Nuclear Energy Agency

PENELOPE 2003 - OECD Nuclear Energy Agency

PENELOPE 2003 - OECD Nuclear Energy Agency

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

160 Chapter 5. Constructive quadric geometry<br />

where r and A ≡ (A x , A y , A z ) are considered here as one-column matrices. Notice that<br />

the matrix A is symmetric (A T = A). Expressing the scaled quadric (5.14) in the form<br />

(5.16), the equation for the rotated and shifted quadric is [see eq. (5.11)]<br />

(r − t) T RAR T (r − t) + (RA) T (r − t) + A 0 = 0, (5.17)<br />

which can be written in the generic form (5.16)<br />

with<br />

r T A ′ r + A ′T r + A ′ 0 = 0 (5.18)<br />

A ′ = RAR T , A ′ = RA − 2A ′ t, A ′ 0 = A 0 + t T (A ′ t − RA). (5.19)<br />

From these relations, the parameters of the implicit equation (5.12) are easily obtained.<br />

A quadric surface F (x, y, z) = 0 divides the space into two exclusive regions that are<br />

identified by the sign of F (x, y, z), the surface side pointer. A point with coordinates<br />

(x 0 , y 0 , z 0 ) is said to be inside the surface if F (x 0 , y 0 , z 0 ) ≤ 0 (side pointer = −1), and<br />

outside it if F (x 0 , y 0 , z 0 ) > 0 (side pointer = +1).<br />

5.3 Constructive quadric geometry<br />

A body is defined as a space volume limited by quadric surfaces and filled with a<br />

homogeneous material. To specify a body we have to define its limiting quadric surfaces<br />

F (r) = 0, with corresponding side pointers (+1 or −1), and its composition (i.e. the<br />

integer label used by penelope to identify the material). It is considered that bodies<br />

are defined in “ascending”, exclusive order so that previously defined bodies effectively<br />

delimit the new ones. This is convenient e.g. to describe bodies with inclusions. The<br />

work of the geometry routines is much easier when bodies are completely defined by their<br />

limiting surfaces, but this is not always possible or convenient for the user. The example<br />

in section 5.7 describes an arrow inside a sphere (fig. 5.2); the arrow is defined first so<br />

that it limits the volume filled by the material inside the sphere. It is impossible to define<br />

the hollow sphere (as a single body) by means of only its limiting quadric surfaces. It<br />

is clear that, by defining a conveniently large number of surfaces and bodies, we can<br />

describe any quadric geometry.<br />

The subroutine package pengeom contains a subroutine, named LOCATE, that “locates”<br />

a point r, i.e. determines the body that contains it, if any. The obvious method<br />

is to compute the side pointers [i.e. the sign of F (r)] for all surfaces and, then, explore<br />

the bodies in ascending order looking for the first one that fits the given side pointers.<br />

This brute force procedure was used in older versions of pengeom; it has the advantage<br />

of being robust (and easy to program) but becomes too slow for complex systems. A<br />

second subroutine, named STEP, “moves” the particle from a given position r 0 within<br />

a body B a certain distance s in a given direction ˆd. STEP also checks if the particle<br />

leaves the active medium and, when this occurs, stops the particle just after entering

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!