Chombo + EB + MF  3.2
ListBoxFactoryI.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 _LISTBOXFACTORYI_H_
14 #define _LISTBOXFACTORYI_H_
15 #include "ListBoxFactory.H"
16 #include "NamespaceHeader.H"
17 
18 template <class T>
20 
21 template <class T>
23  const RealVect& a_origin)
24 {
25  define(a_meshSpacing, a_origin);
26 }
27 
28 template <class T>
30 {
31  define(a_meshSpacing * RealVect::Unit, RealVect::Zero);
32 }
33 
34 template <class T>
35 void
36 ListBoxFactory<T>::define(const RealVect& a_meshSpacing,
37  const RealVect& a_origin)
38 {
39  m_mesh_spacing = a_meshSpacing;
40  m_origin = a_origin;
41 }
42 
43 template <class T>
44 ListBox<T>*
45 ListBoxFactory<T>::create(const Box& a_box, int a_numComps,
46  const DataIndex& a_datInd) const
47 {
48  return new ListBox<T>(a_box, m_mesh_spacing, m_origin);
49 }
50 
51 /// Destructor
52 template <class T>
54 {}
55 
56 template <class T>
59 {
60  return m_mesh_spacing;
61 }
62 
63 template <class T>
66 {
67  return m_origin;
68 }
69 
70 #include "NamespaceFooter.H"
71 #endif
virtual ListBox< T > * create(const Box &a_box, int a_numComps, const DataIndex &a_datInd) const
Factory function. Note that both a_numComps and a_dit are ignored.
Definition: ListBoxFactoryI.H:45
Definition: ListBox.H:31
static const RealVect Unit
Definition: RealVect.H:427
static const RealVect Zero
Definition: RealVect.H:421
RealVect origin() const
Retrieve the origin.
Definition: ListBoxFactoryI.H:65
double Real
Definition: REAL.H:33
ListBoxFactory()
Weak constructor.
Definition: ListBoxFactoryI.H:19
virtual ~ListBoxFactory()
Destructor.
Definition: ListBoxFactoryI.H:53
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Definition: DataIndex.H:114
RealVect meshSpacing() const
Retrieve the cell size.
Definition: ListBoxFactoryI.H:58
void define(const RealVect &a_meshSpacing, const RealVect &a_origin)
Use these parameters for all manufactured ListBox instances.
Definition: ListBoxFactoryI.H:36