Chombo + EB  3.0
AMRPoissonOp.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 _AMRPOISSONOP_H_
12 #define _AMRPOISSONOP_H_
13 
14 #include "REAL.H"
15 #include "Box.H"
16 #include "FArrayBox.H"
17 #include "FluxBox.H"
18 #include "QuadCFInterp.H"
19 #include "LevelFluxRegister.H"
20 #include "LevelDataOps.H"
21 #include "AMRMultiGrid.H"
22 #include "BCFunc.H"
23 #include "BaseLevelTGA.H"
24 #include "CFRegion.H"
25 #include "AMRIO.H"
26 
27 #include "NamespaceHeader.H"
28 
29 ///
30 /**
31  Operator for solving (alpha I + beta*Laplacian)(phi) = rho
32  over an AMR hierarchy.
33 */
34 class AMRPoissonOp : public LevelTGAHelmOp<LevelData<FArrayBox> , FluxBox>
35 {
36 public:
37  /**
38  \name AMRPoissonOp functions */
39  /*@{*/
40 
41  ///
42  /**
43  */
45  {
46  }
47 
48  ///
49  /**
50  */
51  virtual ~AMRPoissonOp()
52  {
53  }
54 
55  ///
56  /** full define function for AMRLevelOp with both coarser and finer levels */
57  void define(const DisjointBoxLayout& a_grids,
58  const DisjointBoxLayout& a_gridsFiner,
59  const DisjointBoxLayout& a_gridsCoarser,
60  const Real& a_dxLevel,
61  int a_refRatio,
62  int a_refRatioFiner,
63  const ProblemDomain& a_domain,
64  BCHolder a_bc,
65  const Copier& a_exchange,
66  const CFRegion& a_cfregion);
67 
68  /** full define function for AMRLevelOp with finer levels, but no coarser */
69  void define(const DisjointBoxLayout& a_grids,
70  const DisjointBoxLayout& a_gridsFiner,
71  const Real& a_dxLevel,
72  int a_refRatio, // dummy arg, send in 1
73  int a_refRatioFiner,
74  const ProblemDomain& a_domain,
75  BCHolder a_bc,
76  const Copier& a_exchange,
77  const CFRegion& a_cfregion);
78 
79  ///
80  /**
81  define function for AMRLevelOp which has no finer AMR level
82  */
83  void define(const DisjointBoxLayout& a_grids,
84  const DisjointBoxLayout& a_baseBAPtr,
85  const Real& a_dxLevel,
86  int a_refRatio,
87  const ProblemDomain& a_domain,
88  BCHolder a_bc,
89  const Copier& a_exchange,
90  const CFRegion& a_cfregion);
91 
92  ///
93  /**
94  define function for AMRLevelOp which has no finer or coarser AMR level
95  */
96  void define(const DisjointBoxLayout& a_grids,
97  const Real& a_dx,
98  const ProblemDomain& a_domain,
99  BCHolder a_bc,
100  const Copier& a_exchange,
101  const CFRegion& a_cfregion);
102 
103  ///
104  /**
105  define function for AMRLevelOp which has no finer or coarser AMR level
106  */
107  void define(const DisjointBoxLayout& a_grids,
108  const Real& a_dx,
109  const ProblemDomain& a_domain,
110  BCHolder a_bc);
111 
112  /// Full define function that mimics the old PoissonOp.
113  /**
114  Makes all coarse-fine information and sets internal variables
115  */
116  void define(const DisjointBoxLayout& a_grids,
117  const DisjointBoxLayout* a_baseBAPtr,
118  Real a_dxLevel,
119  int a_refRatio,
120  const ProblemDomain& a_domain,
121  BCHolder a_bc);
122 
123  virtual void residual(LevelData<FArrayBox>& a_lhs,
124  const LevelData<FArrayBox>& a_phi,
125  const LevelData<FArrayBox>& a_rhs,
126  bool a_homogeneous = false);
127 
128  /// despite what you might think, the "I" here means "Ignore the coarse-fine boundary"
129  virtual void residualI(LevelData<FArrayBox>& a_lhs,
130  const LevelData<FArrayBox>& a_phi,
131  const LevelData<FArrayBox>& a_rhs,
132  bool a_homogeneous = false);
133 
134  virtual void preCond(LevelData<FArrayBox>& a_correction,
135  const LevelData<FArrayBox>& a_residual);
136 
137  virtual void applyOp(LevelData<FArrayBox>& a_lhs,
138  const LevelData<FArrayBox>& a_phi,
139  bool a_homogeneous = false);
140 
141  /// despite what you might think, the "I" here means "Ignore the coarse-fine boundary"
142  virtual void applyOpI(LevelData<FArrayBox>& a_lhs,
143  const LevelData<FArrayBox>& a_phi,
144  bool a_homogeneous = false);
145 
146  virtual void applyOpNoBoundary(LevelData<FArrayBox>& a_lhs,
147  const LevelData<FArrayBox>& a_rhs) ;
148 
149  virtual void create(LevelData<FArrayBox>& a_lhs,
150  const LevelData<FArrayBox>& a_rhs);
151 
152  virtual void createCoarsened(LevelData<FArrayBox>& a_lhs,
153  const LevelData<FArrayBox>& a_rhs,
154  const int& a_refRat);
155 
156  virtual void assign(LevelData<FArrayBox>& a_lhs,
157  const LevelData<FArrayBox>& a_rhs);
158 
159  virtual void assignLocal(LevelData<FArrayBox>& a_lhs,
160  const LevelData<FArrayBox>& a_rhs);
161 
162  virtual void buildCopier(Copier& a_copier,
163  const LevelData<FArrayBox>& a_lhs,
164  const LevelData<FArrayBox>& a_rhs);
165 
166  virtual void assignCopier(LevelData<FArrayBox>& a_lhs,
167  const LevelData<FArrayBox>& a_rhs,
168  const Copier& a_copier);
169 
170  virtual void zeroCovered(LevelData<FArrayBox>& a_lhs,
171  LevelData<FArrayBox>& a_rhs,
172  const Copier& a_copier);
173 
174  virtual Real dotProduct(const LevelData<FArrayBox>& a_1,
175  const LevelData<FArrayBox>& a_2);
176  /* multiple dot products (for GMRES) */
177  virtual void mDotProduct(const LevelData<FArrayBox>& a_1,
178  const int a_sz,
179  const LevelData<FArrayBox> a_2[],
180  Real a_mdots[]);
181 
182  virtual void incr(LevelData<FArrayBox>& a_lhs,
183  const LevelData<FArrayBox>& a_x,
184  Real a_scale);
185 
186  virtual void axby(LevelData<FArrayBox>& a_lhs,
187  const LevelData<FArrayBox>& a_x,
188  const LevelData<FArrayBox>& a_y,
189  Real a_a,
190  Real a_b);
191 
192  virtual void scale(LevelData<FArrayBox>& a_lhs,
193  const Real& a_scale);
194 
195  virtual Real norm(const LevelData<FArrayBox>& a_x,
196  int a_ord);
197 
198  virtual Real localMaxNorm(const LevelData<FArrayBox>& a_x);
199 
200  virtual void setToZero( LevelData<FArrayBox>& a_x);
201  /*@}*/
202 
203  /**
204  \name MGLevelOp functions */
205  /*@{*/
206 
207  virtual void relax(LevelData<FArrayBox>& a_e,
208  const LevelData<FArrayBox>& a_residual,
209  int a_iterations);
210 
211  virtual void createCoarser(LevelData<FArrayBox>& a_coarse,
212  const LevelData<FArrayBox>& a_fine,
213  bool a_ghosted);
214  /**
215  calculate restricted residual
216  a_resCoarse[2h] = I[h->2h] (rhsFine[h] - L[h](phiFine[h])
217  */
218  virtual void restrictResidual(LevelData<FArrayBox>& a_resCoarse,
219  LevelData<FArrayBox>& a_phiFine,
220  const LevelData<FArrayBox>& a_rhsFine);
221 
222  /**
223  correct the fine solution based on coarse correction
224  a_phiThisLevel += I[2h->h](a_correctCoarse)
225  */
226  virtual void prolongIncrement(LevelData<FArrayBox>& a_phiThisLevel,
227  const LevelData<FArrayBox>& a_correctCoarse);
228 
229  /*@}*/
230 
231  /**
232  \name AMRLevelOp functions */
233  /*@{*/
234 
235  /** returns 1 when there are no coarser AMRLevelOp objects */
236  virtual int refToCoarser()
237  {
238  return m_refToCoarser;
239  }
240 
241  /** a_residual = a_rhs - L(a_phi, a_phiFine, a_phiCoarse) */
242  virtual void AMRResidual(LevelData<FArrayBox>& a_residual,
243  const LevelData<FArrayBox>& a_phiFine,
244  const LevelData<FArrayBox>& a_phi,
245  const LevelData<FArrayBox>& a_phiCoarse,
246  const LevelData<FArrayBox>& a_rhs,
247  bool a_homogeneousPhysBC,
248  AMRLevelOp<LevelData<FArrayBox> >* a_finerOp);
249 
250  /** residual assuming no more coarser AMR levels */
251 
252  virtual void AMRResidualNC(LevelData<FArrayBox>& a_residual,
253  const LevelData<FArrayBox>& a_phiFine,
254  const LevelData<FArrayBox>& a_phi,
255  const LevelData<FArrayBox>& a_rhs,
256  bool a_homogeneousPhysBC,
257  AMRLevelOp<LevelData<FArrayBox> >* a_finerOp);
258 
259  /** a_residual = a_rhs - L(a_phi, a_phiCoarse) */
260  virtual void AMRResidualNF(LevelData<FArrayBox>& a_residual,
261  const LevelData<FArrayBox>& a_phi,
262  const LevelData<FArrayBox>& a_phiCoarse,
263  const LevelData<FArrayBox>& a_rhs,
264  bool a_homogeneousPhysBC);
265 
266  ///
267  /**
268  Apply the AMR operator, including coarse-fine matching
269  */
270  virtual void AMROperator(LevelData<FArrayBox>& a_LofPhi,
271  const LevelData<FArrayBox>& a_phiFine,
272  const LevelData<FArrayBox>& a_phi,
273  const LevelData<FArrayBox>& a_phiCoarse,
274  bool a_homogeneousDomBC,
275  AMRLevelOp<LevelData<FArrayBox> >* a_finerOp);
276 
277  ///
278  /**
279  Apply the AMR operator, including coarse-fine matching
280  assume no coarser AMR level
281  */
282  virtual void AMROperatorNC(LevelData<FArrayBox>& a_LofPhi,
283  const LevelData<FArrayBox>& a_phiFine,
284  const LevelData<FArrayBox>& a_phi,
285  bool a_homogeneousBC,
286  AMRLevelOp<LevelData<FArrayBox> >* a_finerOp);
287 
288 
289  ///
290  /**
291  Apply the AMR operator, including coarse-fine matching.
292  assume no finer AMR level
293  */
294  virtual void AMROperatorNF(LevelData<FArrayBox>& a_LofPhi,
295  const LevelData<FArrayBox>& a_phi,
296  const LevelData<FArrayBox>& a_phiCoarse,
297  bool a_homogeneousBC);
298 
299  /**
300  a_resCoarse = I[h-2h]( a_residual - L(a_correction, a_coarseCorrection))
301  it is assumed that a_resCoarse has already been filled in with the coarse
302  version of AMRResidualNF and that this operation is free to overwrite
303  in the overlap regions.
304  */
305  virtual void AMRRestrict(LevelData<FArrayBox>& a_resCoarse,
306  const LevelData<FArrayBox>& a_residual,
307  const LevelData<FArrayBox>& a_correction,
308  const LevelData<FArrayBox>& a_coarseCorrection);
309 
310  virtual void AMRRestrictS(LevelData<FArrayBox>& a_resCoarse,
311  const LevelData<FArrayBox>& a_residual,
312  const LevelData<FArrayBox>& a_correction,
313  const LevelData<FArrayBox>& a_coarseCorrection,
314  LevelData<FArrayBox>& a_scratch);
315 
316  /**
317  a_correction += I[h->h](a_coarseCorrection)
318  */
319  virtual void AMRProlong(LevelData<FArrayBox>& a_correction,
320  const LevelData<FArrayBox>& a_coarseCorrection);
321 
322  /**
323  optimization of AMRProlong that sends in the existing temporary and copier
324  */
325  virtual void AMRProlongS(LevelData<FArrayBox>& a_correction,
326  const LevelData<FArrayBox>& a_coarseCorrection,
327  LevelData<FArrayBox>& a_temp,
328  const Copier& a_copier);
329 
330  /**
331  a_residual = a_residual - L(a_correction, a_coarseCorrection)
332  */
333  virtual void AMRUpdateResidual(LevelData<FArrayBox>& a_residual,
334  const LevelData<FArrayBox>& a_correction,
335  const LevelData<FArrayBox>& a_coarseCorrection);
336 
337  ///
338  /**
339  compute norm over all cells on coarse not covered by finer
340  */
341  virtual Real AMRNorm(const LevelData<FArrayBox>& a_coarseResid,
342  const LevelData<FArrayBox>& a_fineResid,
343  const int& a_refRat,
344  const int& a_ord);
345 
346 
347  /// For tga to reset stuff
348  /**
349  */
350  virtual void setAlphaAndBeta(const Real& a_alpha,
351  const Real& a_beta);
352 
353  /// Change boundary conditions
354  virtual void setBC(const BCHolder& a_bc);
355 
356  /// For tga stuff---in this case a noop
357  virtual void diagonalScale(LevelData<FArrayBox>& a_rhs,
358  bool a_kappaWeighted)
359  {
360  }
361 
362  /// For tga stuff---in this case a noop
364  {
365  }
366 
367  virtual void fillGrad(const LevelData<FArrayBox>& a_phi)
368  {
369  ;//does not apply here
370  }
371 
372  virtual void reflux(const LevelData<FArrayBox>& a_phiFine,
373  const LevelData<FArrayBox>& a_phi,
374  LevelData<FArrayBox>& a_residual,
375  AMRLevelOp<LevelData<FArrayBox> >* a_finerOp);
376 
377  virtual void getFlux(FluxBox& a_flux,
378  const LevelData<FArrayBox>& a_data,
379  const Box& a_grid,
380  const DataIndex& a_dit,
381  Real a_scale)
382  {
383  const FArrayBox& data = a_data[a_dit];
384  a_flux.define(a_grid, a_data.nComp());
385  for (int idir = 0; idir < SpaceDim; idir++)
386  {
387  getFlux(a_flux[idir], data, a_flux[idir].box(), idir, 1);
388  a_flux[idir] *= a_scale;
389  }
390  }
391 
392  virtual void write(const LevelData<FArrayBox>* a_data,
393  const char* a_filename);
394 
395  /*@}*/
396 
397  /// public constants
399 
400  // needed for homogeneous interpolation
401  // set by the factory
403 
405  static int s_exchangeMode;
406  static int s_relaxMode;
407  static int s_maxCoarse;
408 
409  virtual Real dx() const
410  {
411  return m_dx;
412  }
413 
414 protected:
417 
419 
421 
425 
427 
429 
432 
433  virtual void levelGSRB(LevelData<FArrayBox>& a_phi,
434  const LevelData<FArrayBox>& a_rhs);
435 
436  virtual void levelMultiColor(LevelData<FArrayBox>& a_phi,
437  const LevelData<FArrayBox>& a_rhs);
438 
439  virtual void looseGSRB(LevelData<FArrayBox>& a_phi,
440  const LevelData<FArrayBox>& a_rhs);
441 
442  virtual void overlapGSRB(LevelData<FArrayBox>& a_phi,
443  const LevelData<FArrayBox>& a_rhs);
444 
445  virtual void levelGSRBLazy(LevelData<FArrayBox>& a_phi,
446  const LevelData<FArrayBox>& a_rhs);
447 
448  virtual void levelJacobi(LevelData<FArrayBox>& a_phi,
449  const LevelData<FArrayBox>& a_rhs);
450 
451  virtual void homogeneousCFInterp(LevelData<FArrayBox>& a_phif);
452 
453  virtual void homogeneousCFInterp(LevelData<FArrayBox>& a_phif,
454  const DataIndex& a_datInd,
455  int a_idir,
456  Side::LoHiSide a_hiorlo);
457 
458  virtual void singleBoxCFInterp(FArrayBox& a_phi);
459 
460  virtual void interpOnIVSHomo(LevelData<FArrayBox>& a_phif,
461  const DataIndex& a_datInd,
462  const int a_idir,
463  const Side::LoHiSide a_hiorlo,
464  const IntVectSet& a_interpIVS);
465 
466  virtual void getFlux(FArrayBox& a_flux,
467  const FArrayBox& a_data,
468  const Box& a_edgebox,
469  int a_dir,
470  int a_ref = 1) const ;
471 
472  virtual void getFlux(FArrayBox& a_flux,
473  const FArrayBox& a_data,
474  int a_dir,
475  int a_ref = 1) const ;
476 };
477 
478 ///
479 /**
480  Factory to create AMRPoissonOps
481  */
482 class AMRPoissonOpFactory: public AMRLevelOpFactory<LevelData<FArrayBox> >
483 {
484 public:
486  {
487  }
488 
489  ///
490  /**
491  a_coarseDomain is the domain at the coarsest level.
492  a_grids is the AMR hierarchy.
493  a_refRatios are the refinement ratios between levels. The ratio lives
494  with the coarser level so a_refRatios[ilev] is the ratio between
495  ilev and ilev+1
496  a_coarseDx is the grid spacing at the coarsest level.
497  a_bc holds the boundary conditions.
498  a_alpha is the identity coefficient
499  a_beta is the laplacian coefficient.
500  */
501  void define(const ProblemDomain& a_coarseDomain,
502  const Vector<DisjointBoxLayout>& a_grids,
503  const Vector<int>& a_refRatios,
504  const Real& a_coarsedx,
505  BCHolder a_bc,
506  Real a_alpha = 0.0,
507  Real a_beta = 1.0);
508 
509  // regular multigrid definition function --deprecated
510  void define(const ProblemDomain& a_domain,
511  const DisjointBoxLayout& a_grid,
512  const Real& a_dx,
513  BCHolder a_bc,
514  int a_maxDepth = -1,
515  Real a_alpha = 0.0,
516  Real a_beta = 1.0);
517 
518  ///
519  virtual MGLevelOp<LevelData<FArrayBox> >* MGnewOp(const ProblemDomain& a_FineindexSpace,
520  int a_depth,
521  bool a_homoOnly = true);
522 
523  ///
524  virtual AMRLevelOp<LevelData<FArrayBox> >* AMRnewOp(const ProblemDomain& a_indexSpace);
525 
526  ///
527  virtual int refToFiner(const ProblemDomain& a_domain) const;
528 
529 private:
532 
534  Vector<int> m_refRatios; // refinement to next coarser level
535 
537 
540 
543 };
544 
545 #include "NamespaceFooter.H"
546 #endif
void define(const DisjointBoxLayout &a_grids, const DisjointBoxLayout &a_gridsFiner, const DisjointBoxLayout &a_gridsCoarser, const Real &a_dxLevel, int a_refRatio, int a_refRatioFiner, const ProblemDomain &a_domain, BCHolder a_bc, const Copier &a_exchange, const CFRegion &a_cfregion)
virtual void assignLocal(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
virtual void setAlphaAndBeta(const Real &a_alpha, const Real &a_beta)
For tga to reset stuff.
virtual void reflux(const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, LevelData< FArrayBox > &a_residual, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
virtual void incr(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_x, Real a_scale)
virtual Real dx() const
Definition: AMRPoissonOp.H:409
virtual void AMRResidualNF(LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_phiCoarse, const LevelData< FArrayBox > &a_rhs, bool a_homogeneousPhysBC)
virtual void residualI(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs, bool a_homogeneous=false)
despite what you might think, the "I" here means "Ignore the coarse-fine boundary" ...
virtual void AMRResidual(LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_phiCoarse, const LevelData< FArrayBox > &a_rhs, bool a_homogeneousPhysBC, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
virtual void assign(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
virtual Real AMRNorm(const LevelData< FArrayBox > &a_coarseResid, const LevelData< FArrayBox > &a_fineResid, const int &a_refRat, const int &a_ord)
virtual void write(const LevelData< FArrayBox > *a_data, const char *a_filename)
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
virtual void AMRProlongS(LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection, LevelData< FArrayBox > &a_temp, const Copier &a_copier)
virtual void mDotProduct(const LevelData< FArrayBox > &a_1, const int a_sz, const LevelData< FArrayBox > a_2[], Real a_mdots[])
Real m_dx
Definition: AMRPoissonOp.H:415
BCHolder m_bc
Definition: AMRPoissonOp.H:536
Definition: BCFunc.H:138
virtual void levelJacobi(LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs)
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
Definition: AMRPoissonOp.H:482
virtual void fillGrad(const LevelData< FArrayBox > &a_phi)
These functions are part of the LevelTGA interface......
Definition: AMRPoissonOp.H:367
Vector< int > m_refRatios
Definition: AMRPoissonOp.H:534
virtual void axby(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_x, const LevelData< FArrayBox > &a_y, Real a_a, Real a_b)
virtual void createCoarser(LevelData< FArrayBox > &a_coarse, const LevelData< FArrayBox > &a_fine, bool a_ghosted)
static int s_maxCoarse
Definition: AMRPoissonOp.H:407
AMRPoissonOp()
Definition: AMRPoissonOp.H:44
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:137
Real m_alpha
public constants
Definition: AMRPoissonOp.H:398
virtual void prolongIncrement(LevelData< FArrayBox > &a_phiThisLevel, const LevelData< FArrayBox > &a_correctCoarse)
Vector< CFRegion > m_cfregion
Definition: AMRPoissonOp.H:542
Real m_bCoef
Definition: AMRPoissonOp.H:398
virtual void restrictResidual(LevelData< FArrayBox > &a_resCoarse, LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_rhsFine)
virtual void preCond(LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_residual)
Vector< Copier > m_exchangeCopiers
Definition: AMRPoissonOp.H:541
virtual void singleBoxCFInterp(FArrayBox &a_phi)
virtual void overlapGSRB(LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs)
virtual void AMROperatorNF(LevelData< FArrayBox > &a_LofPhi, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_phiCoarse, bool a_homogeneousBC)
virtual void homogeneousCFInterp(LevelData< FArrayBox > &a_phif)
virtual Real localMaxNorm(const LevelData< FArrayBox > &a_x)
virtual int refToCoarser()
Definition: AMRPoissonOp.H:236
DisjointBoxLayout m_coarsenedMGrids
Definition: AMRPoissonOp.H:428
virtual void scale(LevelData< FArrayBox > &a_lhs, const Real &a_scale)
virtual void levelGSRB(LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs)
virtual void looseGSRB(LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs)
virtual void create(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
const int SpaceDim
Definition: SPACE.H:39
CFRegion m_cfregion
Definition: AMRPoissonOp.H:422
Definition: AMRMultiGrid.H:35
Definition: EBInterface.H:45
Definition: AMRPoissonOp.H:34
virtual void applyOp(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, bool a_homogeneous=false)
virtual void residual(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs, bool a_homogeneous=false)
Vector< ProblemDomain > m_domains
Definition: AMRPoissonOp.H:530
A FArrayBox-like container for face-centered fluxes.
Definition: FluxBox.H:22
Real m_beta
Definition: AMRPoissonOp.H:539
virtual void setBC(const BCHolder &a_bc)
Change boundary conditions.
Vector< IntVect > m_colors
Definition: AMRPoissonOp.H:404
virtual void AMRResidualNC(LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs, bool a_homogeneousPhysBC, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
virtual void getFlux(FluxBox &a_flux, const LevelData< FArrayBox > &a_data, const Box &a_grid, const DataIndex &a_dit, Real a_scale)
Definition: AMRPoissonOp.H:377
Vector< DisjointBoxLayout > m_boxes
Definition: AMRPoissonOp.H:531
double Real
Definition: REAL.H:33
virtual void divideByIdentityCoef(LevelData< FArrayBox > &a_rhs)
For tga stuff—in this case a noop.
Definition: AMRPoissonOp.H:363
virtual void diagonalScale(LevelData< FArrayBox > &a_rhs, bool a_kappaWeighted)
For tga stuff—in this case a noop.
Definition: AMRPoissonOp.H:357
BCHolder m_bc
Definition: AMRPoissonOp.H:420
Definition: MultiGrid.H:30
LevelFluxRegister m_levfluxreg
Definition: AMRPoissonOp.H:426
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
LoHiSide
Definition: LoHiSide.H:27
virtual ~AMRPoissonOp()
Definition: AMRPoissonOp.H:51
virtual void buildCopier(Copier &a_copier, const LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
Class that represents the edge region around a DisjointBoxLayout.
Definition: CFRegion.H:28
LevelFluxRegister-A class to encapsulate a levels worth of flux registers.
Definition: LevelFluxRegister.H:29
ProblemDomain m_domain
Definition: AMRPoissonOp.H:416
static int s_exchangeMode
Definition: AMRPoissonOp.H:405
virtual void applyOpNoBoundary(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
virtual void levelGSRBLazy(LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
virtual void zeroCovered(LevelData< FArrayBox > &a_lhs, LevelData< FArrayBox > &a_rhs, const Copier &a_copier)
virtual void createCoarsened(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs, const int &a_refRat)
int nComp() const
Definition: BoxLayoutData.H:258
Definition: DataIndex.H:112
virtual void AMROperatorNC(LevelData< FArrayBox > &a_LofPhi, const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, bool a_homogeneousBC, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
virtual void setToZero(LevelData< FArrayBox > &a_x)
Real m_beta
Definition: AMRPoissonOp.H:398
Definition: FArrayBox.H:44
Definition: AMRTGA.H:159
virtual Real norm(const LevelData< FArrayBox > &a_x, int a_ord)
int m_refToFiner
Definition: AMRPoissonOp.H:431
static int s_relaxMode
Definition: AMRPoissonOp.H:406
virtual void AMRProlong(LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection)
virtual void levelMultiColor(LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs)
Vector< Real > m_dx
Definition: AMRPoissonOp.H:533
void define(const Box &bx, int n=1)
Define function.
Real m_dxCrse
Definition: AMRPoissonOp.H:402
virtual void assignCopier(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs, const Copier &a_copier)
int m_refToCoarser
Definition: AMRPoissonOp.H:430
Real m_alpha
Definition: AMRPoissonOp.H:538
Definition: AMRMultiGrid.H:231
virtual void applyOpI(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, bool a_homogeneous=false)
despite what you might think, the "I" here means "Ignore the coarse-fine boundary" ...
LevelDataOps< FArrayBox > m_levelOps
Definition: AMRPoissonOp.H:418
virtual Real dotProduct(const LevelData< FArrayBox > &a_1, const LevelData< FArrayBox > &a_2)
virtual ~AMRPoissonOpFactory()
Definition: AMRPoissonOp.H:485
virtual void AMRUpdateResidual(LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection)
virtual void AMRRestrictS(LevelData< FArrayBox > &a_resCoarse, const LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection, LevelData< FArrayBox > &a_scratch)
virtual void AMROperator(LevelData< FArrayBox > &a_LofPhi, const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_phiCoarse, bool a_homogeneousDomBC, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
QuadCFInterp m_interpWithCoarser
Definition: AMRPoissonOp.H:424
Real m_aCoef
Definition: AMRPoissonOp.H:398
virtual void interpOnIVSHomo(LevelData< FArrayBox > &a_phif, const DataIndex &a_datInd, const int a_idir, const Side::LoHiSide a_hiorlo, const IntVectSet &a_interpIVS)
Copier m_exchangeCopier
Definition: AMRPoissonOp.H:423
virtual void AMRRestrict(LevelData< FArrayBox > &a_resCoarse, const LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection)
Quadratic coarse-fine interpolation utility.
Definition: QuadCFInterp.H:36
virtual void relax(LevelData< FArrayBox > &a_e, const LevelData< FArrayBox > &a_residual, int a_iterations)