Chombo + EB  3.0
BaseIFFactory.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 _BASEIFFACTORY_H_
14 #define _BASEIFFACTORY_H_
15 
16 #include <cmath>
17 #include <cstdlib>
18 #include "Vector.H"
19 #include "EBISLayout.H"
20 #include "BaseIFFAB.H"
21 #include "DataIndex.H"
22 #include "NamespaceHeader.H"
23 
24 
25 /// Factory class to produce BaseIVFABs.
26 /**
27  Factory class to produce BaseIVFABs.
28  This is needed for LevelData construction.
29  */
30 template <class T>
32  : public DataFactory<BaseIFFAB<T> >
33 {
34 public:
35  /// factory function.
36  /**
37  Creates a new baseivfab object
38  and returns a pointer to it. Responsiblitly
39  for calling operator 'delete' on this pointer
40  is passed to the user.
41  Intersects a_sets[a_dit] from construction
42  with input box because leveldata will expect
43  that anyway when it tries to do a copy or a linearization.
44  */
45  virtual BaseIFFAB<T>* create(const Box& a_box, int a_ncomps,
46  const DataIndex& a_dit) const;
47 
48  ///
49  /**
50  fills internal data with inputs
51  */
52  BaseIFFactory(const EBISLayout& a_ebisl,
53  const LayoutData<IntVectSet>& a_sets,
54  const int& a_facedir );
55 
56  ///
57  virtual ~BaseIFFactory();
58 
59 private:
60  ///
62 
63  ///
65 
66  ///
67  int m_facedir;
68 
69  //disallowed constructors and all that
71  {
72  MayDay::Error("disallowed constructor");
73  }
75  {
76  MayDay::Error("disallowed constructor");
77  }
78  void operator=(const BaseIFFactory<T>& a_inputs)
79  {
80  MayDay::Error("disallowed constructor");
81  }
82 
83 };
84 
85 #include "NamespaceFooter.H"
86 
87 //implementation
88 #include "BaseIFFactoryI.H"
89 #endif
BaseIFFactory(const BaseIFFactory< T > &a_inputs)
Definition: BaseIFFactory.H:70
virtual BaseIFFAB< T > * create(const Box &a_box, int a_ncomps, const DataIndex &a_dit) const
factory function.
Definition: BaseIFFactoryI.H:42
Factory class to produce BaseIVFABs.
Definition: BaseIFFactory.H:31
void operator=(const BaseIFFactory< T > &a_inputs)
Definition: BaseIFFactory.H:78
EBISLayout m_ebisl
Definition: BaseIFFactory.H:61
BaseIFFactory()
Definition: BaseIFFactory.H:74
virtual ~BaseIFFactory()
Definition: BaseIFFactoryI.H:20
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
int m_facedir
Definition: BaseIFFactory.H:67
Definition: DataIndex.H:112
Definition: BaseIFFAB.H:34
Factory object to data members of a BoxLayoutData container.
Definition: BoxLayoutData.H:30
Definition: EBISLayout.H:39
LayoutData< IntVectSet > m_sets
Definition: BaseIFFactory.H:64