00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 // ANAG, LBNL 00012 00013 #ifndef _BASEIFFACTORYI_H_ 00014 #define _BASEIFFACTORYI_H_ 00015 #include "NamespaceHeader.H" 00016 00017 /***************/ 00018 /***************/ 00019 template <class T> inline 00020 BaseIFFactory<T>::~BaseIFFactory() 00021 { 00022 } 00023 /***************/ 00024 /***************/ 00025 template <class T> inline 00026 BaseIFFactory<T>::BaseIFFactory(const EBISLayout& a_ebisl, 00027 const LayoutData<IntVectSet>& a_sets, 00028 const int& a_facedir) 00029 { 00030 m_ebisl = a_ebisl; 00031 m_facedir = a_facedir; 00032 m_sets.define(a_sets.boxLayout()); 00033 for (DataIterator dit = m_sets.dataIterator(); dit.ok(); ++dit) 00034 { 00035 m_sets[dit()] = a_sets[dit()]; 00036 } 00037 } 00038 /***************/ 00039 /***************/ 00040 template <class T> inline 00041 BaseIFFAB<T>* 00042 BaseIFFactory<T>::create(const Box& a_box, int a_ncomps, 00043 const DataIndex& a_dit) const 00044 { 00045 //intersects with input box because leveldata will expect 00046 //that anyway when it tries to do a copy or a linearization. 00047 IntVectSet ivsInter = m_sets[a_dit]; 00048 ivsInter &= a_box; 00049 return new BaseIFFAB<T>(ivsInter, m_ebisl[a_dit].getEBGraph(), m_facedir, a_ncomps); 00050 } 00051 /***************/ 00052 /***************/ 00053 00054 #include "NamespaceFooter.H" 00055 #endif