Chombo + EB + MF  3.2
FourthOrderMappedFineInterpSup.H File Reference

Supporting classes and routines for FourthOrderMappedFineInterp. More...

#include <cstring>
#include "NamespaceHeader.H"
#include "NamespaceFooter.H"
Include dependency graph for FourthOrderMappedFineInterpSup.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...

## Detailed Description

Supporting classes and routines for FourthOrderMappedFineInterp.

## ◆ _FOURTHORDERMAPPEDFINEINTERPSUP_H_

 #define _FOURTHORDERMAPPEDFINEINTERPSUP_H_

## ◆ binomial()

 int binomial ( const int n, int k )
inline

Calculate a binomial coefficient.

Parameters
 [in] n [in] k
Returns
Binomial coefficient

References CH_assert.

Referenced by powerIndex().

## ◆ powerIndex()

 int powerIndex ( int a_m, IntVect a_p )
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

Parameters
 [in] a_m Degree of the polynomial [in] a_p Power for each direction
Returns
Sequential index

References binomial(), and SpaceDim.