Chombo + EB + MF  3.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Private Attributes | Static Private Attributes | List of all members
IndexedMoments< Dim, P > Class Template Reference

#include <IndexedMoments.H>

Inheritance diagram for IndexedMoments< Dim, P >:
Inheritance graph
[legend]

Public Member Functions

 IndexedMoments ()
 constructor—make statics first time called More...
 
 ~IndexedMoments ()
 Destructor. More...
 
Realoperator[] (int a_i)
 
const Realoperator[] (int a_i) const
 
Realoperator[] (const IndexTM< int, Dim > &a_index)
 
const Realoperator[] (const IndexTM< int, Dim > &a_index) const
 
IndexedMoments< Dim, P > & operator+= (const IndexedMoments< Dim, P > &increment)
 add compoenentwise More...
 
IndexedMoments< Dim, P > & operator*= (const Real &a_factor)
 multiply each component by constant More...
 
void linearOut (void *const a_outbuf) const
 
void linearIn (const void *const a_inbuf)
 
void setRegular (const Real a_dx)
 set to a regular IndexTM More...
 
void setToRegular (const Real a_dx)
 
bool isRegular () const
 
IndexedMoments< Dim, P > & operator= (const map< IndexTM< int, Dim >, Real > &a_mapin)
 for use with irregnode More...
 
IndexedMoments< Dim, P > & operator= (const IndexedMoments< Dim, P > &a_input)
 
void shift (const IndexTM< Real, Dim > &a_distance)
 shift moment by the input distance. More...
 
void setToZero ()
 
void spout () const
 outputs the current state to pout() (a la parstream.H) More...
 
void setToTruncatedMultiply (const IndexedMoments< Dim, P > &a_CA, const IndexedMoments< Dim, P > &a_CB)
 
void divideByFactorial ()
 divides each entry by p! More...
 
void multiplyByFactorial ()
 multiply each entry by p! More...
 

Static Public Member Functions

static int size ()
 number of reals in the vector More...
 
static size_t linearSize ()
 for linearization More...
 
static const Vector< IndexTM< int, Dim > > & getMonomialPowers ()
 monomial powers More...
 
static int indexOf (IndexTM< int, Dim > a_index)
 Calculate what linear index this multi-index is. More...
 
static IndexTM< int, Dim > getIndex (const int &a_linearIndex)
 

Protected Member Functions

Real getMoment (const IndexTM< int, Dim > &a_mono, const map< IndexTM< int, Dim >, Real > &a_mapin) const
 

Static Protected Member Functions

static void setStatics ()
 
static void setMultiIndicies ()
 
static void setSize ()
 

Static Protected Attributes

static bool s_staticsSet = false
 
static int s_size = 0
 
static Vector< IndexTM< int, Dim > > s_multiIndicies = Vector<IndexTM<int, Dim> >()
 

Private Attributes

int m_isRegular
 
Vector< Realm_moms
 

Static Private Attributes

static const int s_max_sizes [][CH_IM_MAX_POWER+1]
 

Detailed Description

template<int Dim, int P>
class IndexedMoments< Dim, P >

Vector-like container for multi-indexed Real values up to some max multi-index P (sum of indicies <= P). Layout is 0th dim first, then 1st, etc.

Template Parameters
DThe Dimension of the container

Constructor & Destructor Documentation

◆ IndexedMoments()

template<int Dim, int P>
IndexedMoments< Dim, P >::IndexedMoments ( )

constructor—make statics first time called

Referenced by IndexedMoments< SpaceDim, CH_EBIS_ORDER >::setStatics().

◆ ~IndexedMoments()

template<int Dim, int P>
IndexedMoments< Dim, P >::~IndexedMoments ( )
inline

Destructor.

Member Function Documentation

◆ operator[]() [1/4]

template<int Dim, int P>
Real& IndexedMoments< Dim, P >::operator[] ( int  a_i)
inline

Retrieve the moment from the index a_index The lexigraphical index to the data

◆ operator[]() [2/4]

template<int Dim, int P>
const Real& IndexedMoments< Dim, P >::operator[] ( int  a_i) const
inline

Retrieve the moment from the index a_index The lexigraphical index to the data

◆ operator[]() [3/4]

template<int Dim, int P>
Real& IndexedMoments< Dim, P >::operator[] ( const IndexTM< int, Dim > &  a_index)
inline

Retrieve the moment from the index a_index The multi-index that's needed

◆ operator[]() [4/4]

template<int Dim, int P>
const Real& IndexedMoments< Dim, P >::operator[] ( const IndexTM< int, Dim > &  a_index) const
inline

Retrieve the moment from the index a_index The multi-index that's needed

◆ operator+=()

template<int Dim, int P>
IndexedMoments< Dim, P > & IndexedMoments< Dim, P >::operator+= ( const IndexedMoments< Dim, P > &  increment)

◆ operator*=()

template<int Dim, int P>
IndexedMoments< Dim, P > & IndexedMoments< Dim, P >::operator*= ( const Real a_factor)

multiply each component by constant

multiply each component by factor

Referenced by IndexedMoments< SpaceDim, CH_EBIS_ORDER >::getMoment(), and IndexedMoments< SpaceDim, CH_EBIS_ORDER >::operator[]().

◆ size()

template<int Dim, int P>
static int IndexedMoments< Dim, P >::size ( )
inlinestatic

◆ linearSize()

template<int Dim, int P>
static size_t IndexedMoments< Dim, P >::linearSize ( void  )
inlinestatic

for linearization

◆ linearOut()

template<int Dim, int P>
void IndexedMoments< Dim, P >::linearOut ( void *const  a_outbuf) const
inline

◆ linearIn()

template<int Dim, int P>
void IndexedMoments< Dim, P >::linearIn ( const void *const  a_inbuf)
inline

◆ setRegular()

template<int Dim, int P>
void IndexedMoments< Dim, P >::setRegular ( const Real  a_dx)

◆ setToRegular()

template<int Dim, int P>
void IndexedMoments< Dim, P >::setToRegular ( const Real  a_dx)
inline

◆ getMonomialPowers()

template<int Dim, int P>
static const Vector<IndexTM<int,Dim> >& IndexedMoments< Dim, P >::getMonomialPowers ( )
inlinestatic

◆ isRegular()

template<int Dim, int P>
bool IndexedMoments< Dim, P >::isRegular ( ) const
inline

◆ operator=() [1/2]

template<int Dim, int P>
IndexedMoments< Dim, P > & IndexedMoments< Dim, P >::operator= ( const map< IndexTM< int, Dim >, Real > &  a_mapin)

◆ operator=() [2/2]

template<int Dim, int P>
IndexedMoments<Dim, P>& IndexedMoments< Dim, P >::operator= ( const IndexedMoments< Dim, P > &  a_input)
inline

◆ shift()

template<int Dim, int P>
void IndexedMoments< Dim, P >::shift ( const IndexTM< Real, Dim > &  a_distance)

shift moment by the input distance.

shift moment by the input vector distance. this changes the current object from integral(x^p) to integral((x+x0)^p), where x0 = a_distance

Referenced by checkMoments(), IndexedMoments< SpaceDim, CH_EBIS_ORDER >::operator+=(), and IndexedMoments< SpaceDim, CH_EBIS_ORDER >::operator=().

◆ setToZero()

template<int Dim, int P>
void IndexedMoments< Dim, P >::setToZero ( )
inline

◆ indexOf()

template<int Dim, int P>
int IndexedMoments< Dim, P >::indexOf ( IndexTM< int, Dim >  a_index)
static

◆ getIndex()

template<int Dim, int P>
static IndexTM<int,Dim> IndexedMoments< Dim, P >::getIndex ( const int &  a_linearIndex)
inlinestatic

Referenced by getIndMomMultiIndex().

◆ spout()

template<int Dim, int P>
void IndexedMoments< Dim, P >::spout ( ) const

◆ setToTruncatedMultiply()

template<int Dim, int P>
void IndexedMoments< Dim, P >::setToTruncatedMultiply ( const IndexedMoments< Dim, P > &  a_CA,
const IndexedMoments< Dim, P > &  a_CB 
)

Say = sum_p(CA m^p), and = sum_q(CB m^q).

This sets the current data to the set of coefficents M such that <AB> = sum_r(M m^r) + O(h^P+1).

We drop all coefficents for powers s.t. p + q > P.

Referenced by IndexedMoments< SpaceDim, CH_EBIS_ORDER >::getIndex(), and IndexedMoments< SpaceDim, CH_EBIS_ORDER >::setMultiIndicies().

◆ divideByFactorial()

template<int Dim, int P>
void IndexedMoments< Dim, P >::divideByFactorial ( )

◆ multiplyByFactorial()

template<int Dim, int P>
void IndexedMoments< Dim, P >::multiplyByFactorial ( )

◆ getMoment()

template<const int Dim, const int P>
Real IndexedMoments< Dim, P >::getMoment ( const IndexTM< int, Dim > &  a_mono,
const map< IndexTM< int, Dim >, Real > &  a_mapin 
) const
protected

◆ setStatics()

template<int Dim, int P>
void IndexedMoments< Dim, P >::setStatics ( )
staticprotected

◆ setMultiIndicies()

template<int Dim, int P>
void IndexedMoments< Dim, P >::setMultiIndicies ( )
staticprotected

◆ setSize()

template<int Dim, int P>
void IndexedMoments< Dim, P >::setSize ( )
staticprotected

Member Data Documentation

◆ s_staticsSet

template<int Dim, int P>
bool IndexedMoments< Dim, P >::s_staticsSet = false
staticprotected

◆ s_size

template<int Dim, int P>
int IndexedMoments< Dim, P >::s_size = 0
staticprotected

◆ s_multiIndicies

template<int Dim, int P>
Vector< IndexTM< int, Dim > > IndexedMoments< Dim, P >::s_multiIndicies = Vector<IndexTM<int, Dim> >()
staticprotected

◆ m_isRegular

template<int Dim, int P>
int IndexedMoments< Dim, P >::m_isRegular
private

◆ m_moms

template<int Dim, int P>
Vector<Real> IndexedMoments< Dim, P >::m_moms
private

◆ s_max_sizes

template<int Dim, int P>
const int IndexedMoments< Dim, P >::s_max_sizes
staticprivate
Initial value:
=
{
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{1, 3, 6, 10, 15, 21, 28, 36, 45},
{1, 4, 10, 20, 35, 56, 84, 120, 165}
}

The documentation for this class was generated from the following files: