  A method for constructing first integral preserving numerical schemes for
time-dependent partial differential equations on non-uniform grids is
presented. The method can be used with both finite difference and partition of
unity approaches, thereby also including finite element approaches. The schemes
are then extended to accommodate $r$-, $h$- and $p$-adaptivity. The method is
applied to the Korteweg-de Vries equation and the Sine-Gordon equation and
results from numerical experiments are presented.
