Chombo + EB + MF  3.2
MBAggStencil.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 #ifndef _MBAGGSTENCIL_H_
12 #define _MBAGGSTENCIL_H_
13 
14 #include "Vector.H"
15 #include "REAL.H"
16 #include "CH_Timer.H"
17 #include "IVSFAB.H"
18 #include "FArrayBox.H"
19 #include "MBStencil.H"
20 #include "NamespaceHeader.H"
21 
22 ///
23 /**
24  Aggregated stencil for multiblock stuff.
25  Takes IVSFAB<MBStencil> and turns that into
26  arrays of offsets and weights so the stencil
27  can be evaluated very quickly in comparison
28  with fab(iv, ivar) over and over.
29  */
31 {
32 public:
33  ///
34  /**
35  IVS sent in separately because of the removeNoValid fiasco.
36  sometimes the input stencil has extra cells.
37  */
38  MBAggStencil(const RefCountedPtr<IVSFAB<MBStencil> > & a_stencil,
39  const IntVectSet & a_region,
40  const Box & a_srcBox,
41  const Box & a_dstBox,
42  const int & a_stencilDim);
43 
44  ///
46  {
47  }
48 
49 
50  ///
51  /**
52  for applying a scalar operator to multiple operators.
53  Sets the initial variable for destination to a_varDest
54  Sets dataPtr for a_phi initial variable to a_varSrc
55  Runs over ncomp components
56  */
57  void apply(FArrayBox & a_lph,
58  const Vector<FArrayBox*> & a_phi,
59  const int & a_src,
60  const int & a_dst,
61  const int & a_nco,
62  const bool & a_incrementOnly) const;
63 
64  typedef struct
65  {
66  size_t m_offset;
68  int m_blockid;
69  } stenelem_t;
70 
72 
73 protected:
74 
75  size_t getOffset(const IntVect& a_iv, const Box& a_grid);
76  void computeSlabSizes();
77  void computeOffsets(const RefCountedPtr<IVSFAB<MBStencil> > & a_stencil,
78  const IntVectSet & a_region,
79  const Box & a_srcBox,
80  const Box & a_dstBox);
81 
82  //cached offsets and weights and such
85 
86  // input data
90  //derived
95 private:
96  ///weak construction is bad.
97  MBAggStencil();
98 
99  ///deep copy for this object would kill performance
100  MBAggStencil& operator=(const MBAggStencil& stenin);
101 
102  ///no reason to allow this one either.
103  MBAggStencil(const MBAggStencil& stenin);
104 
105 };
106 
107 #include "NamespaceFooter.H"
108 #endif
Vector< size_t > m_dstAccess
Definition: MBAggStencil.H:84
A reference-counting handle class.
Definition: RefCountedPtr.H:173
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
void computeOffsets(const RefCountedPtr< IVSFAB< MBStencil > > &a_stencil, const IntVectSet &a_region, const Box &a_srcBox, const Box &a_dstBox)
int m_blockid
Definition: MBAggStencil.H:68
one dimensional dynamic array
Definition: Vector.H:53
Definition: MBAggStencil.H:30
Vector< stencil_t > m_mbstencil
Definition: MBAggStencil.H:83
Definition: IVSFAB.H:31
MBAggStencil & operator=(const MBAggStencil &stenin)
deep copy for this object would kill performance
bool m_reducedDimStencil
Definition: MBAggStencil.H:91
MBAggStencil()
weak construction is bad.
int m_stencilDim
Definition: MBAggStencil.H:89
void apply(FArrayBox &a_lph, const Vector< FArrayBox *> &a_phi, const int &a_src, const int &a_dst, const int &a_nco, const bool &a_incrementOnly) const
int m_numSlabs
Definition: MBAggStencil.H:94
~MBAggStencil()
Definition: MBAggStencil.H:45
double Real
Definition: REAL.H:33
size_t getOffset(const IntVect &a_iv, const Box &a_grid)
size_t m_srcSlabLinearSize
Definition: MBAggStencil.H:92
Vector< stenelem_t > stencil_t
Definition: MBAggStencil.H:71
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
IntVect m_srcBoxSize
Definition: MBAggStencil.H:87
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
size_t m_dstSlabLinearSize
Definition: MBAggStencil.H:93
size_t m_offset
Definition: MBAggStencil.H:66
IntVect m_dstBoxSize
Definition: MBAggStencil.H:88
Definition: MBAggStencil.H:64
void computeSlabSizes()
Real m_weight
Definition: MBAggStencil.H:67