Thursday, March 16, 2017

Kranc

"Kranc is a suite of Mathematica-based computer-algebra packages, which comprise a toolbox to convert certain (tensorial) systems of partial differential evolution equations to parallelized C code for solving initial boundary value problems. Kranc can be used as a rapid prototyping system for physicists or mathematicians handling complicated systems of partial differential equations, but through integration into the Cactus computational toolkit it is also possible to produce efficient parallelized production codes. Our work is motivated by the field of numerical relativity, where Kranc is used as a research tool by the authors. The initial version of Kranc was described in [?], and subsequent enhancements in [?]. The user-visible portion of Kranc has subsequently been redesigned. The material in this document is drawn from these two sources, and has been updated to be consistent with the current version of Kranc.

Kranc provides a Mathematica function called CreateThorn. The user must construct arguments and data structures for this function describing the thorn they wish to create. Kranc generates code and Cactus CCL files for:
  • Declaring the grid functions which the simulation will use;
  • Registering the grid functions for the evolved variables with the MoL thorn;
  • Computing the right hand sides of evolution equations so that the time integrator can compute the evolved variables at the next time step;
  • Computing finite differences, both using built-in definitions of standard centred finite differencing operators, as well as allowing the user to create customised operators;
  • Performing a user-specified calculation at each point of the grid.
User-specified calculations will typically set certain grid variables as functions of others, and can be used for various purposes including making a change of variables or computing intermediate or analysis quantities from evolved variables.
The most important data structure in Kranc is a Calculation structure. It encapsulates the idea of assigning new values to grid functions in a loop over grid points based upon evaluating expressions involving other grid functions. Calculations contain lists of assignment statements for different grid functions, and these are evaluated at each point on the grid. Calculations can also contain temporary variables called shorthands into which are placed intermediate expressions which are used later in the calculation. Calculations also contain additional information needed by the Kranc system, such as a name for the calculation"






No comments:

Post a Comment