BISICLES AMR ice sheet model  0.9
IntFineInterp.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 _INTFINEINTERP_H_
12 #define _INTFINEINTERP_H_
13 
14 #include "BaseFab.H"
15 #include "LevelData.H"
16 #include "NamespaceHeader.H"
17 
19 /***
20  This class replaces data at a fine level of refinement with data
21  given at a coarser level of refinement. In that sense, it is
22  an integer analogue of FineInterp, except that it only supports
23  piecewise constant interpolation.
24  */
26 {
27 public:
29 
32  IntFineInterp();
33 
35 
39 
41 
53  IntFineInterp(const DisjointBoxLayout& a_fine_domain,
54  const int& a_numcomps,
55  const int& a_ref_ratio,
56  const IntVect& a_ghost,
57  const Box& a_fine_problem_domain);
58 
60 
71  IntFineInterp(const DisjointBoxLayout& a_fine_domain,
72  const int& a_numcomps,
73  const int& a_ref_ratio,
74  const IntVect& a_ghost,
75  const ProblemDomain& a_fine_problem_domain);
76 
78 
92  void
93  define(const DisjointBoxLayout& a_fine_domain, // the fine level domain
94  const int& a_numcomps, // the number of components
95  const int& a_ref_ratio, // the refinement ratio
96  const IntVect& a_ghost, // the ghost region
97  const Box& a_fine_problem_domain); // problem domain
98 
100 
114  void
115  define(const DisjointBoxLayout& a_fine_domain, // the fine level domain
116  const int& a_numcomps, // the number of components
117  const int& a_ref_ratio, // the refinement ratio
118  const IntVect& a_ghost,
119  const ProblemDomain& a_fine_problem_domain);
120 
122 
129  bool
130  isDefined() const;
131 
132  void pwcInterpToFine(LevelData<BaseFab<int> >& a_fine_data,
133  const LevelData<BaseFab<int> >& a_coarse_data) ;
134 
135 private:
136  void pwcinterpGridData(BaseFab<int>& a_fine,
137  const BaseFab<int>& a_coarse,
138  const Box& a_coarsened_fine_box,
139  int a_ref_ratio) const;
140 
141 protected:
143  // the refinement ratio
145  // work array for the coarse level data in a domain that is the
146  // outline of the fine level domain on the coarse level
147  LevelData<BaseFab<int> > m_coarsened_fine_data;
148  // coarse level problem domain
149  ProblemDomain m_coarse_problem_domain;
150  // ghost vector on the fine domain
151  IntVect m_fineGhost;
152 };
153 
154 
155 #include "NamespaceFooter.H"
156 #endif
void pwcInterpToFine(LevelData< BaseFab< int > > &a_fine_data, const LevelData< BaseFab< int > > &a_coarse_data)
Definition: IntFineInterp.cpp:95
replaces fine level BaseFAB<int> data with coarse level data
Definition: IntFineInterp.H:25
bool isDefined() const
Definition: IntFineInterp.cpp:90
int m_ref_ratio
Definition: IntFineInterp.H:144
IntFineInterp()
Definition: IntFineInterp.cpp:16
void define(const DisjointBoxLayout &a_fine_domain, const int &a_numcomps, const int &a_ref_ratio, const IntVect &a_ghost, const Box &a_fine_problem_domain)
Definition: IntFineInterp.cpp:50
bool is_defined
Definition: IntFineInterp.H:142
ProblemDomain m_coarse_problem_domain
Definition: IntFineInterp.H:149
IntVect m_fineGhost
Definition: IntFineInterp.H:151
~IntFineInterp()
Definition: IntFineInterp.cpp:22
LevelData< BaseFab< int > > m_coarsened_fine_data
Definition: IntFineInterp.H:147