Chombo + EB  3.2
NodeMGInterp.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 // NodeMGInterp.H
12 // petermc, 20 Jun 2001
13 #ifndef _NODEMGINTERP_H_
14 #define _NODEMGINTERP_H_
15 
16 #include "REAL.H"
17 #include "LevelData.H"
18 #include "NodeFArrayBox.H"
19 #include "NamespaceHeader.H"
20 
21 /// Class to interpolate coarse-level data to a fine level
22 /**
23  NodeMGInterp manages the interpolation of coarse-level data
24  to fine-level data for multigrid.
25  This class should be considered internal
26  to AMRNodeSolver and not a part of the Chombo API.
27 */
29 {
30 public:
31 
32  /**
33  \name Constructors, destructor and defines
34  */
35  /*@{*/
36 
37  ///
38  /** Default constructor. User must subsequently call define().
39  */
40  NodeMGInterp();
41 
42  ///
43  /** Destructor.
44  */
45  ~NodeMGInterp();
46 
47  ///
48  /** Defining constructor. Calls define() function with
49  identical arguments.
50  */
51  NodeMGInterp(const DisjointBoxLayout& a_grids,
52  int a_numcomps,
53  int a_refRatio,
54  const Box& a_domain);
55 
56  ///
57  /** Defining constructor. Calls define() function with
58  identical arguments.
59  */
60  NodeMGInterp(const DisjointBoxLayout& a_grids,
61  int a_numcomps,
62  int a_refRatio,
63  const ProblemDomain& a_domain);
64 
65  ///
66  /** Defines this object. Existing information is overridden.
67  */
68  void define(/// CELL-centered grids at the finer level
69  const DisjointBoxLayout& a_grids,
70  /// number of components of data
71  int a_numcomps,
72  /// refinement ratio between the two levels
73  int a_refRatio,
74  /// CELL-centered physical domain at the finer level
75  const ProblemDomain& a_domain);
76 
77  ///
78  /** Defines this object. Existing information is overridden.
79  */
80  void define(/// CELL-centered grids at the finer level
81  const DisjointBoxLayout& a_grids,
82  /// number of components of data
83  int a_numcomps,
84  /// refinement ratio between the two levels
85  int a_refRatio,
86  /// CELL-centered physical domain at the finer level
87  const Box& a_domain);
88 
89  /*@}*/
90 
91  /**
92  \name Access functions
93  */
94  /*@{*/
95 
96  ///
97  /** Returns <tt>true</tt> if this object was created with the defining
98  constructor or if define() has been called.
99  */
100  bool isDefined() const;
101 
102  /*@}*/
103 
104  /**
105  \name Data modification functions
106  */
107  /*@{*/
108 
109  ///
110  /** Adds interpolated coarse-level data to fine-level data.
111  */
112  void interpToFine(/// data at the finer level
113  LevelData<NodeFArrayBox>& a_fine,
114  /// data at the coarser level
115  const LevelData<NodeFArrayBox>& a_coarse,
116  /// whether the finer-level grids are refinements of the coarser-level grids
117  bool a_sameGrids = false);
118 
119  /*@}*/
120 
121 protected:
122 
123  /** has this NodeMGInterp object been defined yet?
124  */
126 
127  /** the refinement ratio between the two levels
128  */
130 
131  /** work array for the coarse-level data in a domain that is the
132  outline of the fine level domain on the coarse level
133  */
135 
136  /** CELL-centered grids at the finer level
137  */
139 
140  /** CELL-centered physical domain at the finer level
141  */
143 
144  /** reference box used in interpolation
145  */
147 
148  /** weights of corners in interpolation
149  */
151 };
152 
153 #include "NamespaceFooter.H"
154 #endif
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
ProblemDomain m_domain
Definition: NodeMGInterp.H:142
FArrayBox m_weights
Definition: NodeMGInterp.H:150
Class to interpolate coarse-level data to a fine level.
Definition: NodeMGInterp.H:28
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
BoxLayoutData< NodeFArrayBox > m_coarsenedFine
Definition: NodeMGInterp.H:134
int m_refRatio
Definition: NodeMGInterp.H:129
Definition: FArrayBox.H:45
Box m_boxRef
Definition: NodeMGInterp.H:146
bool is_defined
Definition: NodeMGInterp.H:125
bool isDefined() const
DisjointBoxLayout m_grids
Definition: NodeMGInterp.H:138
void define(const DisjointBoxLayout &a_grids, int a_numcomps, int a_refRatio, const ProblemDomain &a_domain)
void interpToFine(LevelData< NodeFArrayBox > &a_fine, const LevelData< NodeFArrayBox > &a_coarse, bool a_sameGrids=false)