Chombo + EB + MF  3.2
ListBoxFactory.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 _LISTBOXFACTORY_H_
14 #define _LISTBOXFACTORY_H_
15 
16 #include "BoxLayoutData.H"
17 #include "ListBox.H"
18 #include "DataIndex.H"
19 #include "NamespaceHeader.H"
20 
21 /// Factory class to produce one or more instances of \p ListBox on the
22 /// same level.
23 /**
24  The mesh and \p ProblemDomain will be the same for all instances created
25  by the factory. This is needed for LevelData construction.
26 */
27 template <class T>
28 class ListBoxFactory : public DataFactory<ListBox<T> >
29 {
30 public:
31 
32  /// Weak constructor
34 
35  /// Constructor. Use these parameters for all manufactured \p ListBox instances.
36  ListBoxFactory(const RealVect& a_meshSpacing,
37  const RealVect& a_origin);
38 
39  /// Alternative constructor that assumes the mesh spacing is the same in all
40  /// directions and that the domain offset is zero.
41  ListBoxFactory(const Real& a_meshSpacing);
42 
43  /// Use these parameters for all manufactured \p ListBox instances.
44  void define(const RealVect& a_meshSpacing,
45  const RealVect& a_origin);
46 
47  /// Factory function. Note that both a_numComps and a_dit are ignored.
48  virtual ListBox<T>* create(const Box& a_box, int a_numComps,
49  const DataIndex& a_datInd) const;
50  /// Destructor
51  virtual ~ListBoxFactory();
52 
53  /// Retrieve the cell size
54  RealVect meshSpacing() const;
55 
56  /// Retrieve the origin
57  RealVect origin() const;
58 
59 private:
60  /// cell size in physical coordinates
62 
63  /// location in physical space of the lower corner of the 0 cell
65 };
66 
67 #include "NamespaceFooter.H"
68 
69 // Implementation
70 #include "ListBoxFactoryI.H"
71 
72 #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
RealVect m_origin
location in physical space of the lower corner of the 0 cell
Definition: ListBoxFactory.H:64
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
Definition: ListBoxFactory.H:28
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 m_mesh_spacing
cell size in physical coordinates
Definition: ListBoxFactory.H:61
Factory object to data members of a BoxLayoutData container.
Definition: BoxLayoutData.H:30
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