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

LevelData.H

Go to the documentation of this file.
00001 /* _______              __
00002   / ___/ /  ___  __ _  / /  ___
00003  / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00004  \___/_//_/\___/_/_/_/_.__/\___/
00005 */
00006 //
00007 // This software is copyright (C) by the Lawrence Berkeley
00008 // National Laboratory.  Permission is granted to reproduce
00009 // this software for non-commercial purposes provided that
00010 // this notice is left intact.
00011 //
00012 // It is acknowledged that the U.S. Government has rights to
00013 // this software under Contract DE-AC03-765F00098 between
00014 // the U.S.  Department of Energy and the University of
00015 // California.
00016 //
00017 // This software is provided as a professional and academic
00018 // contribution for joint exchange. Thus it is experimental,
00019 // is provided ``as is'', with no warranties of any kind
00020 // whatsoever, no support, no promise of updates, or printed
00021 // documentation. By using this software, you acknowledge
00022 // that the Lawrence Berkeley National Laboratory and
00023 // Regents of the University of California shall have no
00024 // liability with respect to the infringement of other
00025 // copyrights by any part of this software.
00026 //
00027 
00028 #ifndef _LEVELDATA_H_
00029 #define _LEVELDATA_H_
00030 
00031 #include "IntVect.H"
00032 #include "BoxLayoutData.H"
00033 #include "DisjointBoxLayout.H"
00034 #include "Copier.H"
00035 #include "SPMD.H"
00036 
00037 
00038 
00040 
00054 template <class T>
00055 void aliasLevelData(LevelData<T>& a_alias,
00056                     LevelData<T>* a_original,
00057                     const Interval& a_interval);
00058 
00059 template<class T> class LevelData : public BoxLayoutData<T>
00060 {
00061 public:
00062 
00064   LevelData();
00065 
00067   LevelData(const DisjointBoxLayout& dp, int comps,
00068             const IntVect& ghost = IntVect::TheZeroVector(),
00069             const DataFactory<T>& a_factory = DefaultDataFactory<T>());
00070 
00072   virtual ~LevelData();
00073 
00074 
00076   virtual void define(const DisjointBoxLayout& dp, int comps,
00077                       const IntVect& ghost = IntVect::TheZeroVector(),
00078                       const DataFactory<T>& a_factory = DefaultDataFactory<T>());
00079 
00080 
00082 
00085   virtual void define(const LevelData<T>& da,
00086                       const DataFactory<T>& a_factory = DefaultDataFactory<T>());
00087 
00089 
00094   virtual void define(const LevelData<T>& da, const Interval& comps,
00095                       const DataFactory<T>& a_factory = DefaultDataFactory<T>());
00096 
00098   virtual void copyTo(const Interval& srcComps,
00099                       BoxLayoutData<T>& dest,
00100                       const Interval& destComps) const;
00101 
00103   virtual void copyTo(const Interval& srcComps,
00104                       BoxLayoutData<T>& dest,
00105                       const Interval& destComps,
00106                       const Copier& copier) const;
00108 
00110   virtual void copyTo(const Interval& srcComps,
00111                       LevelData<T>& dest,
00112                       const Interval& destComps) const;
00113 
00115 
00118   virtual void copyTo(const Interval& srcComps,
00119                       LevelData<T>& dest,
00120                       const Interval& destComps,
00121                       const Copier& copier,
00122                       const LDOperator<T>& a_op = LDOperator<T>()) const;
00123 
00125   virtual void exchange(const Interval& comps);
00126 
00128   virtual void exchange(const Interval& comps,
00129                         const Copier& copier);
00130 
00132   const IntVect& ghostVect() const { return m_ghost;}
00133 
00147   virtual void define(const BoxLayout& dp, int comps,
00148                       const DataFactory<T>& factory);
00149 
00151   virtual void define(const BoxLayoutData<T>& da,
00152                       const DataFactory<T>& factory = DefaultDataFactory<T>());
00153 
00155   virtual void define(const BoxLayoutData<T>& da, const Interval& comps,
00156                       const DataFactory<T>& factory = DefaultDataFactory<T>());
00157 
00158   virtual void define(const BoxLayout& deadFunction);
00161 
00162   const DisjointBoxLayout& getBoxes() const
00163   {
00164     return m_disjointBoxLayout;
00165   }
00166 
00168   const DisjointBoxLayout& disjointBoxLayout() const
00169   {
00170     return m_disjointBoxLayout;
00171   }
00172 
00174 
00198   virtual void apply(void (*a_Function)(const Box& box, int comps, T& t));
00199 
00200 protected:
00201 
00202 
00203   DisjointBoxLayout m_disjointBoxLayout;
00204 
00205   IntVect   m_ghost;
00206 
00207   friend void aliasLevelData<T>(LevelData<T>& a_alias,
00208                                 LevelData<T>* a_original,
00209                                 const Interval& a_interval);
00210 
00211 };
00212 
00214 
00241 template <class T>
00242 void aliasLevelData(LevelData<T>& a_alias, LevelData<T>* a_original,
00243                     const Interval& a_interval)
00244 {
00245   AliasDataFactory<T> factory(a_original, a_interval);
00246   a_alias.define(a_original->disjointBoxLayout(), a_interval.size(), a_original->ghostVect(), factory);
00247 }
00248 
00249 
00250 // ====== inlined function definitions ================
00251 
00252 // As with the BoxLayoutData implementation file.  This file
00253 // just gives the interface and the inline implmentations
00254 // are given in LevelDataI.H
00255 
00256 #include "LevelDataI.H"
00257 
00258 
00259 
00260 #endif

Generated on Fri Jul 2 17:53:42 2004 for Chombo by doxygen 1.3.2