chombo-discharge
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MultiIndex Class Reference

SpaceDim multi-index type for use with higher order Taylor series. More...

#include <CD_MultiIndex.H>

Public Member Functions

 MultiIndex ()=delete
 Weak construction is bad.
 
 MultiIndex (const MultiIndex &a_index)=default
 Copy constructor.
 
 MultiIndex (const int a_order)
 Full constructor. More...
 
 ~MultiIndex ()=default
 Destructor.
 
void define (const int a_order)
 Define function.
 
int factorial () const
 Factorial function.
 
IntVect getCurrentIndex () const
 Get index.
 
int getOrder () const
 Get highest order for this index.
 
int getLinearIndex (const IntVect a_MultiIndex) const
 Get the linear index (i.e. column number) for a given multi-index.
 
IntVect getMultiIndex (const int a_linearIndex) const
 Get a multi-index corresponding to the linear index (i.e. column number)
 
MultiIndexoperator= (const MultiIndex &a_other)=default
 Assignment operator.
 
int operator[] (const int a_dir) const
 Get one index.
 
void operator++ ()
 Increment multi-index lexigraphically.
 
void reset ()
 Reset multi-index to point to the first index.
 
bool ok () const
 Check that multi-index is ok.
 
int norm () const
 Get norm of multi-index. More...
 
int getNumIndices () const
 Return number of indices in MultiIndex range.
 
Real pow (const RealVect &a_vec)
 Power function for multi-indices.
 

Protected Member Functions

int factorial (const int a_n) const
 Base factorial function.
 
void makeIndices ()
 Fill m_indices.
 
void makeMaps ()
 Fill maps.
 

Protected Attributes

int m_order
 Maximum order representable by this multi-index.
 
IntVect m_curIndex
 Current idnex.
 
std::vector< IntVect >::iterator m_iter
 Pointer to index.
 
std::vector< IntVect > m_indices
 All indices.
 
std::map< IntVect, int > m_mapToLinearIndex
 Map for going from lexigraphically ordered multi-index to linear index.
 
std::map< int, IntVect > m_mapToMultiIndex
 Map going from linear index to multi-index.
 

Detailed Description

SpaceDim multi-index type for use with higher order Taylor series.

Note
The next() and hasNext() functions are just temporary functions; I'm just too lazy to write an iterator class (yet)

Constructor & Destructor Documentation

◆ MultiIndex()

MultiIndex::MultiIndex ( const int  a_order)

Full constructor.

Parameters
[i]a_order

Member Function Documentation

◆ norm()

int MultiIndex::norm ( ) const

Get norm of multi-index.

Returns |alpha| + |alpha2| + ....


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