Chombo + EB + MF  3.2
BaseIVFactoryI.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 // ANAG, LBNL
12 
13 #ifndef _BASEIVFACTORYI_H_
14 #define _BASEIVFACTORYI_H_
15 #include "NamespaceHeader.H"
16 
17 /***************/
18 /***************/
19 template <class T> inline
21 {
22 }
23 /***************/
24 /***************/
25 template <class T> inline
27  const LayoutData<IntVectSet>& a_sets)
28 {
29  m_ebisl = a_ebisl;
30  m_sets.define(a_sets.boxLayout());
31  for (DataIterator dit = m_sets.dataIterator(); dit.ok(); ++dit)
32  {
33  m_sets[dit()] = a_sets[dit()];
34  }
35 }
36 
37 template <class T> inline
39 {
40  m_ebisl = a_ebisl;
41  m_sets.define(a_ebisl.getDisjointLayout());
42  DisjointBoxLayout layout = a_ebisl.getDisjointLayout();
43  for (DataIterator dit = m_sets.dataIterator(); dit.ok(); ++dit)
44  {
45  Box region = m_ebisl[dit()].getRegion();
46  m_sets[dit()] = m_ebisl[dit()].getIrregIVS(region);
47  }
48 }
49 /***************/
50 /***************/
51 template <class T> inline
53 BaseIVFactory<T>::create(const Box& a_box, int a_ncomps,
54  const DataIndex& a_dit) const
55 {
56  //intersects with input box because leveldata will expect
57  //that anyway when it tries to do a copy or a linearization.
58  IntVectSet ivsInter = m_sets[a_dit];
59  ivsInter &= a_box;
60  return new BaseIVFAB<T>(ivsInter, m_ebisl[a_dit].getEBGraph(), a_ncomps);
61 }
62 /***************/
63 /***************/
64 
65 #include "NamespaceFooter.H"
66 #endif
virtual ~BaseIVFactory()
Definition: BaseIVFactoryI.H:20
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
void define(const ProblemDomain &a_domain, const DisjointBoxLayout &a_grids, const int &a_nghost, const LevelData< EBGraph > &a_graph, const LevelData< EBData > &a_data)
const BoxLayout & boxLayout() const
Definition: LayoutData.H:107
virtual BaseIVFAB< T > * create(const Box &a_box, int a_ncomps, const DataIndex &a_dit) const
factory function.
Definition: BaseIVFactoryI.H:53
virtual bool ok() const
return true if this iterator is still in its Layout
Definition: LayoutIterator.H:117
Definition: DataIterator.H:190
BaseIVFactory()
Definition: BaseIVFactory.H:77
const DisjointBoxLayout & getDisjointLayout() const
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
Definition: DataIndex.H:114
Definition: EBISLayout.H:39
Definition: BaseIVFAB.H:32