next up previous contents
Next: Arithmetic expressions Up: Variables Previous: Variables   Contents

Defining variables from outside

Both gd1 and gd1.pp can be supplied options that define variables from outside an inputfile. The syntax is gd1 -Dname=value. This way, you can eg. compute dispersion relations with simple shell scripts. Variables defined in this way are not automatically evaluated.
Example
#!/bin/sh
  # Given the proper "inputfile.gdf", this shell-script computes the
  # dispersion relation of some periodic structure.
  for PHASE in 0 20 40 60 80 100 120 140 160 180
  do
      gd1 -DThisPhase=$PHASE < inputfile.gdf > out.Phase=$PHASE
  done