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