11 #ifndef _INDEXEDMOMENTS_H_ 12 #define _INDEXEDMOMENTS_H_ 20 #include "NamespaceHeader.H" 23 #define CH_IM_MAX_POWER 8 30 template <
int Dim,
int P>
90 int numReals =
size();
92 size_t retval = numReals*
sizeof(
Real);
95 retval +=
sizeof(int);
103 for(
int ivec = 0; ivec <
size(); ivec++)
108 int* intbuf = (
int *) realbuf;
115 for(
int ivec = 0; ivec <
size(); ivec++)
120 int* intbuf = (
int *) realbuf;
175 for(
int ivec = 0; ivec <
s_size; ivec++)
262 else if(a_order == 2)
266 else if(a_order == 3)
270 else if(a_order == 4)
276 MayDay::Error(
"need to add more cases to getIndMomLinearIndex");
292 else if(a_order == 2)
296 else if(a_order == 3)
300 else if(a_order == 4)
306 MayDay::Error(
"need to add more cases to getIndMomMultiIndex");
321 else if(a_order == 2)
325 else if(a_order == 3)
329 else if(a_order == 4)
345 for(
int idir = 0; idir < Dim; idir++)
362 for(
int idir = 0; idir < Dim; idir++)
364 for(
int iexp = 0; iexp < a_p[idir]; iexp++)
382 template<
int Dim,
int ORDER>
387 const Real & a_tolerance,
388 const bool & a_ebMoment,
389 const bool & a_bindMoments);
421 #include "NamespaceFooter.H" const Real & operator[](int a_i) const
Definition: IndexedMoments.H:51
Real & operator[](int a_i)
Definition: IndexedMoments.H:44
static int indexOf(IndexTM< int, Dim > a_index)
Calculate what linear index this multi-index is.
Definition: IndexedMomentsImplem.H:303
void linearOut(void *const a_outbuf) const
Definition: IndexedMoments.H:100
int getIndMomSize(const int &a_order)
Definition: IndexedMoments.H:314
Definition: IndexedMoments.H:31
int getIndMomLinearIndex(const IndexTM< int, Dim > &a_index, const int &a_order)
Definition: IndexedMoments.H:254
void setRegular(const Real a_dx)
set to a regular IndexTM
Definition: IndexedMomentsImplem.H:348
static int size()
number of reals in the vector
Definition: IndexedMoments.H:78
void setToZero()
Definition: IndexedMoments.H:173
void shift(const IndexTM< Real, Dim > &a_distance)
shift moment by the input distance.
Definition: IndexedMomentsImplem.H:222
IndexedMoments()
constructor—make statics first time called
Definition: IndexedMomentsImplem.H:333
Vector< Real > m_moms
Definition: IndexedMoments.H:246
one dimensional dynamic array
Definition: Vector.H:53
static int s_size
Definition: IndexedMoments.H:229
static const Vector< IndexTM< int, Dim > > & getMonomialPowers()
monomial powers
Definition: IndexedMoments.H:134
static size_t linearSize()
for linearization
Definition: IndexedMoments.H:88
static Vector< IndexTM< int, Dim > > s_multiIndicies
Definition: IndexedMoments.H:232
int m_isRegular
Definition: IndexedMoments.H:243
bool isRegular() const
Definition: IndexedMoments.H:144
IndexedMoments< Dim, P > & operator*=(const Real &a_factor)
multiply each component by constant
Definition: IndexedMomentsImplem.H:198
IndexedMoments< Dim, P > & operator=(const map< IndexTM< int, Dim >, Real > &a_mapin)
for use with irregnode
Definition: IndexedMomentsImplem.H:261
static void setStatics()
Definition: IndexedMomentsImplem.H:323
void setToRegular(const Real a_dx)
Definition: IndexedMoments.H:128
void multiplyByFactorial()
multiply each entry by p!
Definition: IndexedMomentsImplem.H:459
IndexedMoments< Dim, P > & operator=(const IndexedMoments< Dim, P > &a_input)
Definition: IndexedMoments.H:153
~IndexedMoments()
Destructor.
Definition: IndexedMoments.H:39
Real & operator[](const IndexTM< int, Dim > &a_index)
Definition: IndexedMoments.H:58
double Real
Definition: REAL.H:33
void setToTruncatedMultiply(const IndexedMoments< Dim, P > &a_CA, const IndexedMoments< Dim, P > &a_CB)
Definition: IndexedMomentsImplem.H:418
Real POW(const Real &a_x, const IndexTM< int, Dim > a_p)
computes x^p
Definition: IndexedMoments.H:359
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
void linearIn(const void *const a_inbuf)
Definition: IndexedMoments.H:112
void spout() const
outputs the current state to pout() (a la parstream.H)
Definition: IndexedMomentsImplem.H:276
static IndexTM< int, Dim > getIndex(const int &a_linearIndex)
Definition: IndexedMoments.H:185
static void setSize()
Definition: IndexedMomentsImplem.H:383
static bool s_staticsSet
Definition: IndexedMoments.H:226
void checkMoments(IndexedMoments< Dim, ORDER > &a_moments, Vector< IndexTM< int, Dim > > &a_bogusPowers, const Real &a_dx, const Real &a_tolerance, const bool &a_ebMoment, const bool &a_bindMoments)
Definition: IndexedMomentsImplem.H:40
IndexedMoments< Dim, P > & operator+=(const IndexedMoments< Dim, P > &increment)
add compoenentwise
Definition: IndexedMomentsImplem.H:210
static void setMultiIndicies()
Definition: IndexedMomentsImplem.H:397
bool allPositive(const IndexTM< int, Dim > &a_index)
Definition: IndexedMomentsImplem.H:286
bool allEven(const IndexTM< int, Dim > &a_p)
to see if all powers of p are even
Definition: IndexedMoments.H:342
const IndexTM< int, Dim > getIndMomMultiIndex(const int &a_index, const int &a_order)
Definition: IndexedMoments.H:284
void divideByFactorial()
divides each entry by p!
Definition: IndexedMomentsImplem.H:446
static const int s_max_sizes[][CH_IM_MAX_POWER+1]
Definition: IndexedMoments.H:248
#define CH_IM_MAX_POWER
Definition: IndexedMoments.H:23
const Real & operator[](const IndexTM< int, Dim > &a_index) const
Definition: IndexedMoments.H:65
Real getMoment(const IndexTM< int, Dim > &a_mono, const map< IndexTM< int, Dim >, Real > &a_mapin) const
Definition: IndexedMomentsImplem.H:167