Chombo + EB + MF
3.2
|
Supporting classes and routines for FourthOrderMappedFineInterp. More...
#include <cstring>
#include "NamespaceHeader.H"
#include "NamespaceFooter.H"
Go to the source code of this file.
Classes | |
class | CoordTransform |
Coordinate transformations. More... | |
Macros | |
#define | _FOURTHORDERMAPPEDFINEINTERPSUP_H_ |
Functions | |
int | binomial (const int n, int k) |
Calculate a binomial coefficient. More... | |
int | powerIndex (int a_m, IntVect a_p) |
Find the sequential index of a power. More... | |
Supporting classes and routines for FourthOrderMappedFineInterp.
#define _FOURTHORDERMAPPEDFINEINTERPSUP_H_ |
|
inline |
Calculate a binomial coefficient.
[in] | n | |
[in] | k |
References CH_assert.
Referenced by powerIndex().
|
inline |
Find the sequential index of a power.
The powers are indexed as follows (i.e for dimensions)
* int idx = 0 * for (px = 0; px <= m; ++px) * for (py = 0; px+py <= m; ++py) * for (pz = 0; px+py+pz <= m; ++py) * ++idx
where is the degree of the polynomial and we wish to find idx. To compute the sequential index of any given power, we can use the relations
and
With these, the amount to add to the sequential index for a power at a spatial index is total number of powers remaining at this spatial index (remainder of ) minus the number of powers not used at this spatial index. E.g, if , , and , there are 2 powers left for the remaining 2 dimensions,
The increment to the sequential index is then
In general, this can be written for direction index , in space dimensions, with giving the remaining available powers at , and giving the power used at index as
[in] | a_m | Degree of the polynomial |
[in] | a_p | Power for each direction |
References binomial(), and SpaceDim.