next up previous contents
Next: Defining Material properties Up: Using macros to model Previous: Macro 'InnerPlunger'   Contents

Macro 'OuterPlunger'

Since the tubes where the plungers are in are of different radii, and they are at different angles, we must supply these parameters. For the tube where the plunger is in, we define a macro 'OuterPlunger' that expects two arguments: The first is the radius of the tube, the second one is the angle of the axis of the tube:
 macro OuterPlunger
    define(PlungerOuterRadius, @arg1 )
    define(PlungerAngle,   (@arg2)*@pi/180 )  # Argument of the call

    -gbor
        material= 0
        origin= ( cos(PlungerAngle)*OuterRadius,\
                  sin(PlungerAngle)*OuterRadius,\
                  0 )
        zprimedirection= ( -cos(PlungerAngle),\
                           -sin(PlungerAngle),\
                          0 )
        rprimedirection= (0,0,1)
        range= (0,360)

        clear
           # point= (z,r)
        point= (  50e-3, 0 )
        point= (  50e-3, PlungerOuterRadius )
        point= (  50e-3, PlungerOuterRadius )
        point= ( -235.39e-3, PlungerOuterRadius )
        point= ( -235.39e-3, 50e-3)
        point= ( -235.39e-3, 0)
        doit
 endmacro # OuterPlunger
We now model each of our two plungers with two calls:
 #
 # Model the tube and the plunger at phi=17 degrees:
 #
 call OuterPlunger( (130.75e-3/2)      , 17 )
 call InnerPlunger( (OuterRadius-50e-3), 17 )

 #
 # model the tube and the plunger at phi=-90+22.5 degrees:
 #
 call OuterPlunger( (110e-3/2)         , (-90+22.5) )
 call InnerPlunger( (OuterRadius-50e-3), (-90+22.5) )
The so edited inputfile can be found as /usr/local/gd1/Tutorial-SRRC/wPlunger01.gdf. When we feed gd1 with this inputfile, we get a screen as shown in figure 5.6.

Figure 5.6: Screenshot of the desktop when the inputfile wPlunger01.gdf has been fed into gd1. Shown is a zoom of the interesting region near the plungers.
\begin{figure}\centerline{
\psfig{figure=plunger-screen01.PS,width=723.0pt} %% 1276/3 = 425.333333
}\end{figure}