Compact Finite Differences
- class findiff.compact.CompactScheme(deriv, left: dict, right: list)
Represents compact finite difference as in Lele, J. Comp. Phys 103, 16-42 (1992)
A more appropriate name for the scheme would be “implicite finite differences”.
Normal, i.e. “explicit” finite differences express the n-th derivative as a linear combination neighboring function values:
\[f^{(n)}_i = \sum_k c_k f_{i+k}\]- The compact/implicit finite difference scheme, however uses:
sum_k alpha_k f^{(n)}_{i+k} = sum_k c_k f_{i+k}
So, in order to apply implicit finite differences, one has to solve a (sparse) linear equation system.
The big advantage of the implicit scheme is that for the same accuracy order, one needs fewer neighboring points than in the explicit schemes.
Initializes a CompactScheme instance.
The compact/implicit finite difference scheme is defined by:
\[\sum_k \alpha_k f^{(n)}_{i+k} = \sum_k c_k f_{i+k}\]- Args:
- deriv: int
The order of the derivative
- left: dict
Defines the alphas in the formula above. Keys: k, Values: alpha_k
- right: list|tuple
Which neighboring points to use (the k’s in the formula above)