Chombo + EB + MF  3.2
ParticleValidRegion.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 _PARTICLEVALIDREGION_H_
14 #define _PARTICLEVALIDREGION_H_
15 
16 #include "REAL.H"
17 #include "BaseFab.H"
18 #include "DisjointBoxLayout.H"
19 #include "LevelData.H"
20  #include "NamespaceHeader.H"
21 
22 /// This class defines the region in which the particle data is valid.
23 /// The invalid region is a layer of a_buffer cells abutting the next
24 /// coarser level. The buffer is computed in such a way that during
25 /// two successive synchronization points the particles
26 /// deposition/interpolation stencil remains fully contained on this level
27 
29 {
30 public:
31 
32  /// Default constructor. User must subsequently call define().
34  : m_isDefined(false) {}
35 
36  /// Destructor.
38 
39  /// Full constructor.
40  ParticleValidRegion(const DisjointBoxLayout& a_domain,
41  const LevelData<BaseFab<bool> >* a_crseValid,
42  const int a_refRatio,
43  const int a_buffer);
44 
45  /// Like the full constructor.
46  void define(const DisjointBoxLayout& a_domain,
47  const LevelData<BaseFab<bool> >* a_crseValid,
48  const int a_refRatio,
49  const int a_buffer);
50 
51  /// Return pointer to valid region.
52  const LevelData<BaseFab<bool> >* mask() const
53  {
54 
55  CH_TIME("ParticleValidRegion::mask");
56 
57  if (m_isDefined) return &m_valid;
58  else return NULL;
59  }
60 
61 protected:
62 
63  /// internal use only
64  inline void bufferGhostJob(BaseFab<bool>& a_valid,
65  const Box& a_box,
66  const Box& a_domain,
67  const int a_buffer,
68  const int a_dir);
69 protected:
70 
72 
73  /// levelData mask of valid region
75 
76 };
77 
78 #include "NamespaceFooter.H"
79 
80 #endif
Definition: ParticleValidRegion.H:28
bool m_isDefined
Definition: ParticleValidRegion.H:71
~ParticleValidRegion()
Destructor.
Definition: ParticleValidRegion.H:37
LevelData< BaseFab< bool > > m_valid
levelData mask of valid region
Definition: ParticleValidRegion.H:74
void define(const DisjointBoxLayout &a_domain, const LevelData< BaseFab< bool > > *a_crseValid, const int a_refRatio, const int a_buffer)
Like the full constructor.
ParticleValidRegion()
Default constructor. User must subsequently call define().
Definition: ParticleValidRegion.H:33
#define CH_TIME(name)
Definition: CH_Timer.H:82
new code
Definition: BoxLayoutData.H:170
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
const LevelData< BaseFab< bool > > * mask() const
Return pointer to valid region.
Definition: ParticleValidRegion.H:52
void bufferGhostJob(BaseFab< bool > &a_valid, const Box &a_box, const Box &a_domain, const int a_buffer, const int a_dir)
internal use only