template.class_template.SymmetryOrbitEQN._pad

SymmetryOrbitEQN._pad(size, axis=0)[source]

Increase the size of the discretization along an axis.

Parameters
sizeint

The new size of the discretization (not the current shape), restrictions typically imposed by equations.

axisint

Axis to pad along per numpy conventions.

Returns
Orbit :

Orbit instance whose state in the physical along numpy axis ‘axis’ basis has a number of discretization points equal to ‘size’, (self.bases_labels()[0][axis] == size after method call).

Notes

This function is typically an interpolation method, i.e. Fourier mode zero-padding. However, in the general case when we cannot assume the basis, the best we can do is pad the current basis, which is done in a symmetric fashion when possible.

That is, if we have a 4x4 array, then calling this with size=6 and axis=0 would yield a 6x4 array, wherein the first and last rows are uniformly zero. I.e. a “border” of zeroes has been added. The choice to make this symmetric matters in the case of non-periodic boundary conditions.

When writing this function for spectral interpolation methods BE SURE TO ACCOUNT FOR NORMALIZATION of your transforms. Also, in this instance the interpolation basis and the return basis are the same, as there is no way of specifying otherwise for the general Orbit class. For the KSe, the padding basis is ‘modes’ and the return basis is whatever the state was originally in. This is the preferred implementation.