Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

LevelData< T > Class Template Reference

#include <LevelData.H>

Inheritance diagram for LevelData< T >:

Inheritance graph
[legend]
Collaboration diagram for LevelData< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LevelData ()
 LevelData (const DisjointBoxLayout &dp, int comps, const IntVect &ghost=IntVect::Zero, const DataFactory< T > &a_factory=DefaultDataFactory< T >())
virtual ~LevelData ()
virtual void define (const DisjointBoxLayout &dp, int comps, const IntVect &ghost=IntVect::Zero, const DataFactory< T > &a_factory=DefaultDataFactory< T >())
virtual void define (const LevelData< T > &da, const DataFactory< T > &a_factory=DefaultDataFactory< T >())
virtual void define (const LevelData< T > &da, const Interval &comps, const DataFactory< T > &a_factory=DefaultDataFactory< T >())
virtual void copyTo (const Interval &srcComps, BoxLayoutData< T > &dest, const Interval &destComps) const
virtual void copyTo (BoxLayoutData< T > &dest) const
 Simplest case -- assumes source and dest have same interval.
virtual void copyTo (const Interval &srcComps, BoxLayoutData< T > &dest, const Interval &destComps, const Copier &copier) const
virtual void copyTo (BoxLayoutData< T > &dest, const Copier &copier) const
 Simplest case -- assumes source and dest have same interval.
virtual void copyTo (const Interval &srcComps, LevelData< T > &dest, const Interval &destComps) const
virtual void copyTo (LevelData< T > &dest) const
 Simplest case -- assumes source and dest have same interval.
virtual void copyTo (const Interval &srcComps, LevelData< T > &dest, const Interval &destComps, const Copier &copier, const LDOperator< T > &a_op=LDOperator< T >()) const
virtual void copyTo (LevelData< T > &dest, const Copier &copier, const LDOperator< T > &a_op=LDOperator< T >()) const
 Simplest case -- assumes source and dest have same interval.
virtual void exchange (const Interval &comps)
virtual void exchange (void)
 Simplest case -- do all components.
virtual void exchange (const Interval &comps, const Copier &copier)
virtual void exchange (const Copier &copier)
 Simplest case -- do all components.
const IntVectghostVect () const
const DisjointBoxLayoutgetBoxes () const
const DisjointBoxLayoutdisjointBoxLayout () const
virtual void apply (void(*a_Function)(const Box &box, int comps, T &t))
overidden virtual functions
These functions will invoke error messages when invoked. C++ will ensure that constructors are not called for the base class by a user, but a 'define' function has no such protection, hence the need to prevent such usage. A runtime error is not a perfect solution...(strong construction gets around this *sigh*). classes that derive from LevelData will have to turn it's valid defines into runtime errors also and make it's own defines. Thus taking over the job of the compiler.

virtual void define (const BoxLayout &dp, int comps, const DataFactory< T > &factory)
virtual void define (const BoxLayoutData< T > &da, const DataFactory< T > &factory=DefaultDataFactory< T >())
virtual void define (const BoxLayoutData< T > &da, const Interval &comps, const DataFactory< T > &factory=DefaultDataFactory< T >())
virtual void define (const BoxLayout &deadFunction)
 overridden and throws an error.

Protected Attributes

DisjointBoxLayout m_disjointBoxLayout
IntVect m_ghost

Friends

void aliasLevelData (LevelData< T > &a_alias, LevelData< T > *a_original, const Interval &a_interval)
 Data over a disjoint union of rectangles.

template<class T>
class LevelData< T >


Constructor & Destructor Documentation

template<class T>
LevelData< T >::LevelData  ) 
 

template<class T>
LevelData< T >::LevelData const DisjointBoxLayout dp,
int  comps,
const IntVect ghost = IntVect::Zero,
const DataFactory< T > &  a_factory = DefaultDataFactory< T >()
 

template<class T>
LevelData< T >::~LevelData  )  [virtual]
 


Member Function Documentation

template<class T>
void LevelData< T >::apply void(*)(const Box &box, int comps, T &t)  a_Function  )  [virtual]
 

User writes a function with the signature:

     void myfunction(const Box& box, int comps, T& t){ your code here;}

They can then hand this off to LayoutData::apply. This class then cycles through all the T objects and invokes this function. Function must not be inline. (I'm still trying to figure out a nice way to send in non-static member functions).

for example:

  LevelData<FArrayBox> data(layout, 3, IntVect::Unit);
  struct val{
  static void set1(const Box& box, int comps, const FArrayBox& f)
  {
    f.setVal(box, box.smallEnd(0));
  }

  data.apply(val::set1);

Reimplemented from BoxLayoutData< T >.

template<class T>
void LevelData< T >::copyTo LevelData< T > &  dest,
const Copier copier,
const LDOperator< T > &  a_op = LDOperator< T >()
const [virtual]
 

Simplest case -- assumes source and dest have same interval.

template<class T>
void LevelData< T >::copyTo const Interval srcComps,
LevelData< T > &  dest,
const Interval destComps,
const Copier copier,
const LDOperator< T > &  a_op = LDOperator< T >()
const [virtual]
 

same as copyTo that takes a BoxLayoutData, except that it fills the ghost cells of 'dest' with data from 'this' also. USer passes in a prebuilt Copier object

template<class T>
void LevelData< T >::copyTo LevelData< T > &  dest  )  const [virtual]
 

Simplest case -- assumes source and dest have same interval.

template<class T>
void LevelData< T >::copyTo const Interval srcComps,
LevelData< T > &  dest,
const Interval destComps
const [virtual]
 

same as copyTo that takes a BoxLayoutData, except that it fills the ghost cells of 'dest' with data from 'this' also.

template<class T>
void LevelData< T >::copyTo BoxLayoutData< T > &  dest,
const Copier copier
const [virtual]
 

Simplest case -- assumes source and dest have same interval.

template<class T>
void LevelData< T >::copyTo const Interval srcComps,
BoxLayoutData< T > &  dest,
const Interval destComps,
const Copier copier
const [virtual]
 

template<class T>
void LevelData< T >::copyTo BoxLayoutData< T > &  dest  )  const [virtual]
 

Simplest case -- assumes source and dest have same interval.

template<class T>
void LevelData< T >::copyTo const Interval srcComps,
BoxLayoutData< T > &  dest,
const Interval destComps
const [virtual]
 

template<class T>
void LevelData< T >::define const BoxLayout deadFunction  )  [virtual]
 

overridden and throws an error.

Reimplemented from BoxLayoutData< T >.

template<class T>
void LevelData< T >::define const BoxLayoutData< T > &  da,
const Interval comps,
const DataFactory< T > &  factory = DefaultDataFactory< T >()
[virtual]
 

Define this BoxLayoutData to be the subset of the data in da defined by the Interval comps.

Reimplemented from BoxLayoutData< T >.

template<class T>
void LevelData< T >::define const BoxLayoutData< T > &  da,
const DataFactory< T > &  factory = DefaultDataFactory< T >()
[virtual]
 

Reimplemented from BoxLayoutData< T >.

template<class T>
void LevelData< T >::define const BoxLayout dp,
int  comps,
const DataFactory< T > &  factory
[virtual]
 

Reimplemented from BoxLayoutData< T >.

template<class T>
void LevelData< T >::define const LevelData< T > &  da,
const Interval comps,
const DataFactory< T > &  a_factory = DefaultDataFactory< T >()
[virtual]
 

Copy definer. 'this' LevelData thrown away and da's LevelData copied. This LevelData is now defined for the range [0, comps.size()] and filled with the data in da from [comps.begin(), comps.end()]

template<class T>
void LevelData< T >::define const LevelData< T > &  da,
const DataFactory< T > &  a_factory = DefaultDataFactory< T >()
[virtual]
 

copy definer. this LevelData thrown away and da's LevelData copied

template<class T>
void LevelData< T >::define const DisjointBoxLayout dp,
int  comps,
const IntVect ghost = IntVect::Zero,
const DataFactory< T > &  a_factory = DefaultDataFactory< T >()
[virtual]
 

template<class T>
const DisjointBoxLayout& LevelData< T >::disjointBoxLayout  )  const [inline]
 

template<class T>
void LevelData< T >::exchange const Copier copier  )  [virtual]
 

Simplest case -- do all components.

template<class T>
void LevelData< T >::exchange const Interval comps,
const Copier copier
[virtual]
 

template<class T>
void LevelData< T >::exchange void   )  [virtual]
 

Simplest case -- do all components.

template<class T>
void LevelData< T >::exchange const Interval comps  )  [virtual]
 

template<class T>
const DisjointBoxLayout& LevelData< T >::getBoxes  )  const [inline]
 

template<class T>
const IntVect& LevelData< T >::ghostVect  )  const [inline]
 


Friends And Related Function Documentation

template<class T>
void aliasLevelData LevelData< T > &  a_alias,
LevelData< T > *  a_original,
const Interval a_interval
[friend]
 

Data over a disjoint union of rectangles.

LevelData is-a BoxLayoutData. It is built from a DisjointBoxLayout instead though, thus making the data in a DisjointBoxLayout uniquely defined for all spatial indices defined by the underlying DisjointBoxLayout. It carries within it an inherent concept of ghost cells (which the user can choose to be empty).

Since LevelData is-a BoxLayoutData, all the methods required of the template class T for BoxLayoutData are also required for LevelData. LevelData does not have any extra requirements.


Member Data Documentation

template<class T>
DisjointBoxLayout LevelData< T >::m_disjointBoxLayout [protected]
 

template<class T>
IntVect LevelData< T >::m_ghost [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Oct 5 12:48:28 2005 for Chombo&AMRIdealMHD by  doxygen 1.4.1