magnum.create_controller(run, params, *args, **kwargs)

Create a controller object, depending on the environment in which the script was executed: TODO: Explain.

This function creates a controller object that is responsible for starting multiple simulations e.g. for parameter sweeps. Depending on how the simulation script is started, an instance of one of the following controller classes is created:

  • LocalController
  • (more to follow)

If the script is started locally, a LocalController instance is returned.

Example on how to use controllers:

mesh = RectangularMesh(...)
world = World(mesh, ...)

def run(n):
  print "Running with parameter", n
  solver = Solver(world)
  # etc...

controller = Controller(run, [100, 200, 300, 400])

This will run 4 simulations, printing:

Running with parameter 100
Running with parameter 200
Running with parameter 300
Running with parameter 400