## PUGHReduce

Date

Abstract

Reductions operations which are performed using the PUGH driver

### 1 Purpose

This thorn registers a number of reduction operators with the ﬂesh. The reductions are performed using internals of the PUGH driver, so that this thorn can only be used when CactusPUGH/PUGH is active.

The reduction operations this thorn registers are

 Reduction Operator Calculates By average${}^{\ast }$, mean${}^{\ast }$ the average/mean of a grid variable $\sum GV∕N$ count the number of grid points in a grid variable $N$ maximum${}^{\ast }$ the maximum of a grid variable $maxGV$ minimum${}^{\ast }$ the minimum of a grid variable $minGV$ norm1, L1Norm the L1 norm of a grid variable $\left(\Sigma |GV|\right)∕N$ norm2, L2Norm the L2 norm of a grid variable $\sqrt{\left(\Sigma |GV{|}^{2}\right)∕N}$ norm3, L3Norm the L3 norm of a grid variable $\sqrt{\left(\Sigma |GV{|}^{3}\right)∕N}$ norm4, L4Norm the L4 norm of a grid variable $\sqrt{\left(\Sigma |GV{|}^{4}\right)∕N}$ norm_inf, LinfNorm the Inﬁnitity norm of a grid variable $max|GV|$ sum${}^{\ast }$ the sum of the elements of a grid variable $\sum GV$

Reduction operators with multiple names are just synonyms for the same kind of reduction operation. In the formulas $GV$ is the grid variable to be reduced, and $N$ denotes the number of its elements. Reduction operators marked with ${}^{\ast }$ cannot be applied to grid variables of complex datatype.

### 2 Examples

The following C example illustrates how the get the maximum value of a grid function.