#include <MiniIVFAB.H>
Implemented as just a raw vector of vofs and data, more optimized for smaller memory footprint and faster linearIn/linearOut. will be more brutal for vof-by-vof indexing. bvs
Public Member Functions | |
MiniIVFAB () | |
MiniIVFAB (const IntVectSet &a_region, const EBGraph &a_ebgraph, const int &a_nvarin) | |
bool | hasVoFs () const |
MiniIVFAB (const Interval &a_comps, MiniIVFAB< T > &a_original) | |
virtual | ~MiniIVFAB () |
virtual void | define (const IntVectSet &a_region, const EBGraph &a_ebgraph, const int &a_nvarin) |
void | copy (const Box &a_fromBox, const Interval &a_dstInterval, const Box &a_toBox, const MiniIVFAB< T > &a_src, const Interval &a_srcInterval) |
int | size (const Box &R, const Interval &comps) const |
void | linearOut (void *buf, const Box &R, const Interval &comps) const |
void | linearIn (void *buf, const Box &R, const Interval &comps) |
Vector< VolIndex > | getVoFs () const |
T * | dataPtr (int a_ivar) |
const T * | dataPtr (int a_ivar) const |
void | setVal (const T &a_val) |
void | setVal (int a_comp, const T &a_val) |
void | setVal (const T &a_val, const Box &a_box, int a_startcomp, int a_ncomp) |
virtual T * | getIndex (const VolIndex &a_vof, const int &a_comp) const |
get index into vector | |
long | offset (const BaseIndex &a_vof, const int &a_ivar) const |
for AggStencil | |
T & | operator() (const VolIndex &a_vof, int a_comp) |
const T & | operator() (const VolIndex &a_vof, int a_comp) const |
template<typename F> | |
void | forall (const MiniIVFAB &a_src, const Box &a_box, int a_srccomp, int a_destcomp, int a_numcomp, bool sameRegBox, const F &func) |
int | numVoFs () const |
int | nComp () const |
Protected Attributes | |
shared_ptr< Vector< VolIndex > > | m_vofs |
shared_ptr< Vector< T > > | m_Memory |
int | m_nComp = 0 |
T * | m_data = nullptr |
MiniIVFAB< T >::MiniIVFAB | ( | const IntVectSet & | a_region, | |
const EBGraph & | a_ebgraph, | |||
const int & | a_nvarin | |||
) | [inline] |
Defining constructor. Specifies the irregular domain and the number of data components per VoF. The irregular domain must lie completely within the EBGraph. The contents are uninitialized. Calls full define function.
References MiniIVFAB< T >::define().
MiniIVFAB< T >::MiniIVFAB | ( | const Interval & | a_comps, | |
MiniIVFAB< T > & | a_original | |||
) | [inline] |
This aliased MiniIVFAB will have a_comps.size() components, starting at zero.
bool MiniIVFAB< T >::hasVoFs | ( | ) | const [inline] |
void MiniIVFAB< T >::define | ( | const IntVectSet & | a_region, | |
const EBGraph & | a_ebgraph, | |||
const int & | a_nvarin | |||
) | [inline, virtual] |
Full define function. Specifies the irregular domain and the number of data components per VoF. The irregular domain must lie completely within the EBGraph. The contents are uninitialized. If it has previously been defined, the old definition data is overwritten and lost.
References CH_assert, VoFIterator::getVector(), IntVectSet::isEmpty(), MiniIVFAB< T >::m_data, MiniIVFAB< T >::m_Memory, MiniIVFAB< T >::m_nComp, MiniIVFAB< T >::m_vofs, EBGraph::numVoFs(), IVSIterator::ok(), and IVSIterator::reset().
Referenced by MiniIVFAB< T >::MiniIVFAB().
References Box::contains(), linearSize(), MiniIVFAB< T >::m_vofs, and Interval::size().
void MiniIVFAB< T >::linearIn | ( | void * | buf, | |
const Box & | R, | |||
const Interval & | comps | |||
) | [inline] |
References Interval::begin(), Interval::end(), MiniIVFAB< T >::getIndex(), linearIn(), and linearSize().
References MiniIVFAB< T >::m_vofs.
T* MiniIVFAB< T >::dataPtr | ( | int | a_ivar | ) | [inline] |
Referenced by MiniIVFAB< T >::forall(), and MiniIVFAB< T >::getIndex().
const T* MiniIVFAB< T >::dataPtr | ( | int | a_ivar | ) | const [inline] |
void MiniIVFAB< T >::setVal | ( | const T & | a_val | ) | [inline] |
References MiniIVFAB< T >::m_data, MiniIVFAB< T >::m_nComp, and MiniIVFAB< T >::m_vofs.
void MiniIVFAB< T >::setVal | ( | int | a_comp, | |
const T & | a_val | |||
) | [inline] |
References MiniIVFAB< T >::m_data, MiniIVFAB< T >::m_nComp, and MiniIVFAB< T >::m_vofs.
void MiniIVFAB< T >::setVal | ( | const T & | a_val, | |
const Box & | a_box, | |||
int | a_startcomp, | |||
int | a_ncomp | |||
) | [inline] |
References MiniIVFAB< T >::forall(), and MiniIVFAB< T >::m_vofs.
T * MiniIVFAB< T >::getIndex | ( | const VolIndex & | a_vof, | |
const int & | a_comp | |||
) | const [inline, virtual] |
get index into vector
needs to be public so that bulk stencils can be constructed
References CH_assert, MiniIVFAB< T >::dataPtr(), MiniIVFAB< T >::m_data, MiniIVFAB< T >::m_nComp, and MiniIVFAB< T >::m_vofs.
Referenced by MiniIVFAB< T >::copy(), MiniIVFAB< T >::linearIn(), and MiniIVFAB< double >::operator()().
long MiniIVFAB< T >::offset | ( | const BaseIndex & | a_vof, | |
const int & | a_ivar | |||
) | const [inline] |
for AggStencil
const T& MiniIVFAB< T >::operator() | ( | const VolIndex & | a_vof, | |
int | a_comp | |||
) | const [inline] |
void MiniIVFAB< T >::forall | ( | const MiniIVFAB< T > & | a_src, | |
const Box & | a_box, | |||
int | a_srccomp, | |||
int | a_destcomp, | |||
int | a_numcomp, | |||
bool | sameRegBox, | |||
const F & | func | |||
) | [inline] |
References Box::contains(), MiniIVFAB< T >::dataPtr(), VolIndex::gridIndex(), MiniIVFAB< T >::m_vofs, and Vector< T >::size().
Referenced by MiniIVFAB< T >::setVal().
int MiniIVFAB< T >::numVoFs | ( | ) | const [inline] |
References MiniIVFAB< T >::m_vofs.
int MiniIVFAB< T >::nComp | ( | ) | const [inline] |
Referenced by MiniIVFAB< T >::copy(), MiniIVFAB< double >::dataPtr(), MiniIVFAB< T >::define(), MiniIVFAB< T >::forall(), MiniIVFAB< T >::getIndex(), MiniIVFAB< T >::getVoFs(), MiniIVFAB< double >::hasVoFs(), MiniIVFAB< T >::linearOut(), MiniIVFAB< T >::numVoFs(), MiniIVFAB< double >::offset(), MiniIVFAB< T >::setVal(), and MiniIVFAB< T >::size().
Referenced by MiniIVFAB< T >::define().