Chombo + EB  3.0
EBConductivityOp.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 _EBCONDUCTIVITYOP_H_
12 #define _EBCONDUCTIVITYOP_H_
13 
14 #include "REAL.H"
15 #include "Box.H"
16 #include "FArrayBox.H"
17 #include "Vector.H"
18 #include <map>
19 #include "RefCountedPtr.H"
20 
21 #include "AMRMultiGrid.H"
22 #include "EBAMRPoissonOp.H"
23 
24 #include "EBIndexSpace.H"
25 #include "EBCellFAB.H"
26 #include "EBCellFactory.H"
27 #include "EBStencil.H"
28 
29 #include "EBLevelDataOps.H"
30 #include "BaseEBBC.H"
31 #include "BaseDomainBC.H"
32 #include "CFIVS.H"
33 #include "EBFluxRegister.H"
34 #include "EBFastFR.H"
35 #include "EBMGAverage.H"
36 #include "EBMGInterp.H"
37 #include "PolyGeom.H"
38 #include "EBQuadCFInterp.H"
39 #include "EBLevelGrid.H"
40 #include "AMRTGA.H"
41 #include "AMRPoissonOp.H"
42 #include "CFRegion.H"
43 #include "NamespaceHeader.H"
44 
45 #if CH_SPACEDIM==2
46 #define EBAMRPOVC_NUMSTEN 4
47 #elif CH_SPACEDIM==3
48 #define EBAMRPOVC_NUMSTEN 8
49 #else
51 {
52  THIS_WILL_ONLY_COMPILE_WHEN_CH_SPACEDIM_IS_2_OR_3;
53 }
54 #endif
55 
56 //! \class EBConductivityOp
57 //! This class implements an operator that solves the equation
58 //! (alpha a + beta div (b grad) )phi = rhs
59 //! using the AMRLevelOp interface.
60 class EBConductivityOp: public LevelTGAHelmOp<LevelData<EBCellFAB>, EBFluxFAB >
61 {
62  public:
63 
64  ///for debugging
65  virtual void dumpAMR(Vector<LevelData<EBCellFAB>*>& a_data, string name)
66  {
67  writeEBAMRname(&a_data, name.c_str());
68  }
69 
70  ///for debugging
71  virtual void dumpLevel(LevelData<EBCellFAB>& a_data, string name)
72  {
73  writeEBLevelname(&a_data, name.c_str());
74  }
75 
76  //! Constructs a conductivity operator using the given data. This
77  //! constructor is for time-independent a and b coefficients.
78  //! If you are approaching this operator from this interface, consider backing away and using
79  //! EBConductivityOpFactory to generate these objects. Really.
80  //! Ghost cell arguments are there for caching reasons. Once you set them,
81  //! an error is thrown if you send in data that does not match.
82  //! \param a_eblgFine grid at finer level
83  //! \param a_eblg grid at this level
84  //! \param a_eblgCoar grid at coarser level
85  //! \param a_eblgCoarMG grid at intermediate multigrid level
86  //! \param a_domainBC domain boundary conditions at this level
87  //! \param a_ebBC eb boundary conditions at this level
88  //! \param a_dx grid spacing at this level
89  //! \param a_origin offset to lowest corner of the domain
90  //! \param a_refToFine refinement ratio to finer level
91  //! \param a_refToCoar refinement ratio to coarser level
92  //! \param a_hasFiner true if there is a finer AMR level, false otherwise.
93  //! \param a_hasCoarser true if there is a coarser AMR level.
94  //! \param a_hasCoarserMG true if there is a coarser MultiGrid level.
95  //! \param a_preCondIters number of iterations to do for pre-conditioning
96  //! \param a_relaxType 0 means point Jacobi, 1 is Gauss-Seidel.
97  //! \param a_acoef coefficent of identity
98  //! \param a_bcoef coefficient of gradient.
99  //! \param a_ghostCellsPhi Number of ghost cells in phi, correction
100  //! \param a_ghostCellsRhs Number of ghost cells in RHS, residual, lphi
101  EBConductivityOp(const EBLevelGrid & a_eblgFine,
102  const EBLevelGrid & a_eblg,
103  const EBLevelGrid & a_eblgCoar,
104  const EBLevelGrid & a_eblgCoarMG,
105  const RefCountedPtr<EBQuadCFInterp>& a_quadCFI,
106  const RefCountedPtr<ConductivityBaseDomainBC>& a_domainBC,
108  const Real & a_dx,
109  const Real & a_dxCoar,
110  const int& a_refToFine,
111  const int& a_refToCoar,
112  const bool& a_hasFine,
113  const bool& a_hasCoar,
114  const bool& a_hasMGObjects,
115  const bool& a_layoutChanged,
116  const Real& a_alpha,
117  const Real& a_beta,
118  const RefCountedPtr<LevelData<EBCellFAB> >& a_acoef,
119  const RefCountedPtr<LevelData<EBFluxFAB> >& a_bcoef,
120  const RefCountedPtr<LevelData<BaseIVFAB<Real> > >& a_bcoIrreg,
121  const IntVect& a_ghostCellsPhi,
122  const IntVect& a_ghostCellsRHS,
123  const int& a_relaxType);
124 
125  //! Constructs a conductivity operator using the given data. This
126  //! constructor is for a time-dependent a coefficient and a time-independent
127  //! b coefficient. Ghost cell arguments are there for caching reasons. Once
128  //! you set them, an error is thrown if you send in data that does not match.
129  //! \param a_eblgFine grid at finer level
130  //! \param a_eblg grid at this level
131  //! \param a_eblgCoar grid at coarser level
132  //! \param a_eblgCoarMG grid at intermediate multigrid level
133  //! \param a_domainBC domain boundary conditions at this level
134  //! \param a_ebBC eb boundary conditions at this level
135  //! \param a_dx grid spacing at this level
136  //! \param a_origin offset to lowest corner of the domain
137  //! \param a_refToFine refinement ratio to finer level
138  //! \param a_refToCoar refinement ratio to coarser level
139  //! \param a_hasFiner true if there is a finer AMR level, false otherwise.
140  //! \param a_hasCoarser true if there is a coarser AMR level.
141  //! \param a_hasCoarserMG true if there is a coarser MultiGrid level.
142  //! \param a_preCondIters number of iterations to do for pre-conditioning
143  //! \param a_relaxType 0 means point Jacobi, 1 is Gauss-Seidel.
144  //! \param a_acoef0 Beginning-of-step identity coefficient.
145  //! \param a_acoef1 End-of-step identity coefficient.
146  //! \param a_acoef Time-interpolated identity coefficient.
147  //! \param a_bcoef coefficient of gradient.
148  //! \param a_ghostCellsPhi Number of ghost cells in phi, correction
149  //! \param a_ghostCellsRhs Number of ghost cells in RHS, residual, lphi
150  EBConductivityOp(const EBLevelGrid & a_eblgFine,
151  const EBLevelGrid & a_eblg,
152  const EBLevelGrid & a_eblgCoar,
153  const EBLevelGrid & a_eblgCoarMG,
154  const RefCountedPtr<EBQuadCFInterp>& a_quadCFI,
155  const RefCountedPtr<ConductivityBaseDomainBC>& a_domainBC,
157  const Real & a_dx,
158  const Real & a_dxCoar,
159  const int& a_refToFine,
160  const int& a_refToCoar,
161  const bool& a_hasFine,
162  const bool& a_hasCoar,
163  const bool& a_hasMGObjects,
164  const bool& a_layoutChanged,
165  const Real& a_alpha,
166  const Real& a_beta,
167  const RefCountedPtr<LevelData<EBCellFAB> >& a_acoef0,
168  const RefCountedPtr<LevelData<EBCellFAB> >& a_acoef1,
169  const RefCountedPtr<LevelData<EBCellFAB> >& a_acoef,
170  const RefCountedPtr<LevelData<EBFluxFAB> >& a_bcoef,
171  const RefCountedPtr<LevelData<BaseIVFAB<Real> > >& a_bcoIrreg,
172  const IntVect& a_ghostCellsPhi,
173  const IntVect& a_ghostCellsRHS,
174  const int& a_relaxType);
175 
176  //! Destructor.
178 
179  Real getSafety();
180 
181  //! This sets the data storage for the a coefficient to a different
182  //! object. Use this only if you know what you're doing.
183  //! \param a_acoef The new object that stores the a coefficient.
185 
186  //only weights by kappa. time and tga have their demands.
187  virtual void kappaScale(LevelData<EBCellFAB> & a_rhs);
188 
189  ///
190  /** a_residual = a_rhs - L(a_phiFine, a_phi) no coaser AMR level*/
191  void AMRResidualNC(LevelData<EBCellFAB>& a_residual,
192  const LevelData<EBCellFAB>& a_phiFine,
193  const LevelData<EBCellFAB>& a_phi,
194  const LevelData<EBCellFAB>& a_rhs,
195  bool a_homogeneousBC,
196  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
197 
198 
199  ///
200  /** apply AMR operator no coaser AMR level*/
201  void AMROperatorNC(LevelData<EBCellFAB>& a_LofPhi,
202  const LevelData<EBCellFAB>& a_phiFine,
203  const LevelData<EBCellFAB>& a_phi,
204  bool a_homogeneousBC,
205  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
206 
207  //------------------------------------
208  // Overridden methods for base classes
209  //------------------------------------
210 
211  void setAlphaAndBeta(const Real& a_alpha,
212  const Real& a_beta);
213 
214  void diagonalScale(LevelData<EBCellFAB> & a_rhs,
215  bool a_kappaWeighted);
216 
218 
219  void fillGrad(const LevelData<EBCellFAB>& a_phi);
220 
221  void getFlux(EBFluxFAB& a_flux,
222  const LevelData<EBCellFAB>& a_data,
223  const Box& a_grid,
224  const DataIndex& a_dit,
225  Real a_scale);
226 
227  void getFlux(EBFaceFAB& a_fluxCentroid,
228  const EBCellFAB& a_phi,
229  const Box& a_ghostedBox,
230  const Box& a_fabBox,
231  const ProblemDomain& a_domain,
232  const EBISBox& a_ebisBox,
233  const Real& a_dx,
234  const DataIndex& a_datInd,
235  const int& a_idir);
236 
237  // This operator may be time-dependent.
238  void setTime(Real a_oldTime, Real a_mu, Real a_dt);
239 
240  //! This is called on multigrid operators when their AMR operators
241  //! are altered.
242  void finerOperatorChanged(const MGLevelOp<LevelData<EBCellFAB> >& a_operator,
243  int a_coarseningFactor);
244 
245  //MGOp operations. no finer or coarser
246 
247  ///
248  /**
249  */
250  virtual void residual(LevelData<EBCellFAB>& a_residual,
251  const LevelData<EBCellFAB>& a_phi,
252  const LevelData<EBCellFAB>& a_rhs,
253  bool a_homogeneousPhysBC=false);
254 
255  ///
256  /**
257  */
258  virtual void preCond(LevelData<EBCellFAB>& a_opPhi,
259  const LevelData<EBCellFAB>& a_phi);
260 
261  ///
262  /**
263  This function assumes that coarse-fine boundary condtions have
264  been dealt with.
265  */
266  virtual void applyOp(LevelData<EBCellFAB>& a_opPhi,
267  const LevelData<EBCellFAB>& a_phi,
268  const LevelData<EBCellFAB>* const a_phiCoarse,
269  const bool& a_homogeneousPhysBC,
270  const bool& a_homogeneousCFBC);
271 
272  /// virtual function called by LevelTGA
273  virtual void applyOpNoBoundary(LevelData<EBCellFAB>& a_opPhi,
274  const LevelData<EBCellFAB>& a_phi);
275 
276  ///
277  /**
278  this is the linearop function. CFBC is set to homogeneous. phic is null
279  */
280  virtual void applyOp(LevelData<EBCellFAB>& a_opPhi,
281  const LevelData<EBCellFAB>& a_phi,
282  bool a_homogeneousPhysBC);
283 
284  ///
285  /**
286  */
287  virtual void create(LevelData<EBCellFAB>& a_lhs,
288  const LevelData<EBCellFAB>& a_rhs);
289 
290  ///
291  virtual void createCoarsened(LevelData<EBCellFAB>& a_lhs,
292  const LevelData<EBCellFAB>& a_rhs,
293  const int& a_refRat);
294 
295  Real
296  AMRNorm(const LevelData<EBCellFAB>& a_coarResid,
297  const LevelData<EBCellFAB>& a_fineResid,
298  const int& a_refRat,
299  const int& a_ord);
300 
301  ///
302  /**
303  */
304  virtual void assign(LevelData<EBCellFAB>& a_lhs,
305  const LevelData<EBCellFAB>& a_rhs);
306 
307  ///
308  /**
309  */
310  virtual Real dotProduct(const LevelData<EBCellFAB>& a_1,
311  const LevelData<EBCellFAB>& a_2);
312 
313  ///
314  /**
315  */
316  virtual void incr(LevelData<EBCellFAB>& a_lhs,
317  const LevelData<EBCellFAB>& a_x,
318  Real a_scale);
319 
320  ///
321  /**
322  */
323  virtual void axby(LevelData<EBCellFAB>& a_lhs,
324  const LevelData<EBCellFAB>& a_x,
325  const LevelData<EBCellFAB>& a_y,
326  Real a_a,
327  Real a_b);
328 
329  ///
330  /**
331  */
332  virtual void scale(LevelData<EBCellFAB>& a_lhs,
333  const Real& a_scale);
334 
335  ///
336  /**
337  */
338  virtual Real norm(const LevelData<EBCellFAB>& a_rhs,
339  int a_ord);
340 
341  ///
342  /**
343  */
344  virtual void setToZero(LevelData<EBCellFAB>& a_lhs);
345 
346  ///
347  /**
348  */
349  virtual void setVal(LevelData<EBCellFAB>& a_lhs, const Real& a_value);
350 
351  ///
352  /**
353  */
354  virtual void createCoarser(LevelData<EBCellFAB>& a_coarse,
355  const LevelData<EBCellFAB>& a_fine,
356  bool a_ghosted);
357 
358  ///
359  /**
360  */
361  virtual void relax(LevelData<EBCellFAB>& a_e,
362  const LevelData<EBCellFAB>& a_residual,
363  int a_iterations);
364 
365 
366  virtual void relaxGauSai(LevelData<EBCellFAB>& a_e,
367  const LevelData<EBCellFAB>& a_residual,
368  int a_iterations);
369 
370  virtual void relaxPoiJac(LevelData<EBCellFAB>& a_e,
371  const LevelData<EBCellFAB>& a_residual,
372  int a_iterations);
373 
374 
375  virtual void relaxGSRBFast(LevelData<EBCellFAB>& a_e,
376  const LevelData<EBCellFAB>& a_residual,
377  int a_iterations);
378 
379  ///
380  /**
381  Calculate restricted residual:
382  a_resCoarse[2h] = I[h->2h] (a_rhsFine[h] - L[h](a_phiFine[h]))
383  */
384  virtual void restrictResidual(LevelData<EBCellFAB>& a_resCoarse,
385  LevelData<EBCellFAB>& a_phiFine,
386  const LevelData<EBCellFAB>& a_rhsFine);
387 
388  ///
389  /**
390  Correct the fine solution based on coarse correction:
391  a_phiThisLevel += I[2h->h] (a_correctCoarse)
392  */
393  virtual void prolongIncrement(LevelData<EBCellFAB>& a_phiThisLevel,
394  const LevelData<EBCellFAB>& a_correctCoarse);
395 
396  ///
397  /** Refinement ratio between this level and coarser level.
398  Returns 1 when there are no coarser AMRLevelOp objects */
399  virtual int refToCoarser();
400 
401  ///
402  /** Refinement ratio between this level and coarser level.
403  Returns 1 when there are no coarser AMRLevelOp objects */
404  virtual int refToFiner();
405 
406  ///
407  /** a_residual = a_rhs - L(a_phi, a_phiFine, a_phiCoarse) */
408  virtual void AMRResidual(LevelData<EBCellFAB>& a_residual,
409  const LevelData<EBCellFAB>& a_phiFine,
410  const LevelData<EBCellFAB>& a_phi,
411  const LevelData<EBCellFAB>& a_phiCoarse,
412  const LevelData<EBCellFAB>& a_rhs,
413  bool a_homogeneousBC,
414  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
415 
416  ///
417  /** a_residual = a_rhs - L(a_phi, a_phiCoarse) */
418  virtual void AMRResidualNF(LevelData<EBCellFAB>& a_residual,
419  const LevelData<EBCellFAB>& a_phi,
420  const LevelData<EBCellFAB>& a_phiCoarse,
421  const LevelData<EBCellFAB>& a_rhs,
422  bool a_homogeneousBC);
423 
424 
425  ///
426  /** a_residual = a_rhs - L(a_phi, a_phiFine, a_phiCoarse) */
427  virtual void AMROperator(LevelData<EBCellFAB>& a_LofPhi,
428  const LevelData<EBCellFAB>& a_phiFine,
429  const LevelData<EBCellFAB>& a_phi,
430  const LevelData<EBCellFAB>& a_phiCoarse,
431  bool a_homogeneousBC,
432  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
433 
434  ///
435  /** a_residual = a_rhs - L(a_phi, a_phiCoarse) */
436  virtual void AMROperatorNF(LevelData<EBCellFAB>& a_LofPhi,
437  const LevelData<EBCellFAB>& a_phi,
438  const LevelData<EBCellFAB>& a_phiCoarse,
439  bool a_homogeneousBC);
440 
441  ///
442  /** a_resCoarse = I[h-2h] (a_residual - L(a_correction, a_coarseCorrection)) */
443  virtual void AMRRestrict(LevelData<EBCellFAB>& a_resCoarse,
444  const LevelData<EBCellFAB>& a_residual,
445  const LevelData<EBCellFAB>& a_correction,
446  const LevelData<EBCellFAB>& a_coarseCorrection);
447 
448  ///
449  /** a_correction += I[2h->h](a_coarseCorrection) */
450  virtual void AMRProlong(LevelData<EBCellFAB>& a_correction,
451  const LevelData<EBCellFAB>& a_coarseCorrection);
452 
453  ///
454  /** a_residual = a_residual - L(a_correction, a_coarseCorrection) */
455  virtual void AMRUpdateResidual(LevelData<EBCellFAB>& a_residual,
456  const LevelData<EBCellFAB>& a_correction,
457  const LevelData<EBCellFAB>& a_coarseCorrection);
458 
459  void reflux(LevelData<EBCellFAB>& a_residual,
460  const LevelData<EBCellFAB>& a_phiFine,
461  const LevelData<EBCellFAB>& a_phi,
462  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
463 
464  void gsrbColor(LevelData<EBCellFAB>& a_phi,
465  const LevelData<EBCellFAB>& a_lph,
466  const LevelData<EBCellFAB>& a_rhs,
467  const IntVect& a_color);
468 
469  void getDivFStencil(VoFStencil& a_vofStencil,
470  const VolIndex& a_vof,
471  const DataIndex& a_dit);
472 
473  void getFluxStencil(VoFStencil& a_fluxStencil,
474  const FaceIndex& a_face,
475  const DataIndex& a_dit);
476 
477  void getFaceCenteredFluxStencil(VoFStencil& a_fluxStencil,
478  const FaceIndex& a_face,
479  const DataIndex& a_dit);
480 
481  void incrOpRegularDir(EBCellFAB& a_lhs,
482  const EBCellFAB& a_phi,
483  const bool& a_homogeneous,
484  const int& a_dir,
485  const DataIndex& a_datInd);
486  void applyOpIrregular(EBCellFAB& a_lhs,
487  const EBCellFAB& a_phi,
488  const bool& a_homogeneous,
489  const DataIndex& a_datInd);
490 
491  //this is needed to do wacky things like reset the a coefficient.
492  //not for the faint of heart
493  //but none but the brave deserve the fair
494  const EBLevelGrid& getEBLG() const
495  {
496  return m_eblg;
497  }
498 protected:
499  void incrOpRegularAllDirs(Box * a_loBox,
500  Box * a_hiBox,
501  int * a_hasLo,
502  int * a_hasHi,
503  Box & a_curDblBox,
504  Box & a_curPhiBox,
505  int a_nComps,
506  BaseFab<Real> & a_curOpPhiFAB,
507  const BaseFab<Real> & a_curPhiFAB,
508  bool a_homogeneousPhysBC,
509  const DataIndex& a_dit);
510 
511  void applyDomainFlux(Box * a_loBox,
512  Box * a_hiBox,
513  int * a_hasLo,
514  int * a_hasHi,
515  Box & a_dblBox,
516  int a_nComps,
517  BaseFab<Real> & a_phiFAB,
518  bool a_homogeneousPhysBC,
519  const DataIndex& a_dit);
520 
521  void GSColorAllIrregular(EBCellFAB& a_phi,
522  const EBCellFAB& a_rhs,
523  const int& a_icolor,
524  const DataIndex& a_dit);
525 
526  static bool s_turnOffBCs;
528  void dumpFABPoint(const EBCellFAB& a_fab, const DataIndex& a_dit, const string& a_blab);
529  void dumpLevelPoint(const LevelData<EBCellFAB>& a_res, const string& a_blab);
530 
531  void calculateAlphaWeight();
532  void defineStencils();
533  void defineColorStencils(Box a_ideBoxLo[SpaceDim],
534  Box a_ideBoxHi[SpaceDim]);
535  //EBCF gymnastics
536  void defineEBCFStencils();
537  void getFluxEBCF(EBFaceFAB& a_flux,
538  const EBCellFAB& a_phi,
539  const Box& a_ghostedBox,
540  Vector<FaceIndex>& a_faceitEBCF,
541  Vector<VoFStencil>& a_stenEBCF);
542 
543  void getFluxRegOnly(EBFaceFAB& a_fluxCentroid,
544  const EBCellFAB& a_phi,
545  const Box& a_ghostedBox,
546  const Real& a_dx,
547  const DataIndex& a_datInd,
548  const int& a_idir);
549 
550  //stuff to make EBCF go faster
553 
554  //stuff to make relaxation go faster
555  //not for the faint of heart
561 
562 
563 
567 
569 
575 
578 
582 
583  //! "Current" (time-interpolated) value of the a coefficient. For a
584  //! time-independent a coefficient, this is where the coefficient lives.
586 
587  //! The a coefficient at the beginning of the time step. This is NULL if
588  //! the conductivity operator is time independent.
590 
591  //! The a coefficient at the end of the time step. This is NULL if
592  //! the conductivity operator is time independent.
594 
595  //! "Current" (time-interpolated) value of the b coefficient. For a
596  //! time-independent a coefficient, this is where the coefficient lives.
598 
599  //! "Current" (time-interpolated) value of the b coefficient on irregular
600  //! cells.
602 
605  //weights that get multiplied by alpha
607  //weights that get multiplied by beta
611  bool m_hasEBCF;
612  bool m_hasFine;
614  bool m_hasCoar;
615 
616  //restriction object
618  //prolongation object
620 
621  //stencils for operator evaluation
623  //stencils for operator evaluation on gauss-seidel colors
624 
625  //! Multigrid relaxation coefficient
627 
628  //cache the vofiterators
629  //for irregular cell iteration (includes buffer around multivalued cells)
632  //for domain boundary conditions at ir regular cells
635 
637 
638  // Coarse-fine stencils for homogeneous CFInterp
641 
642  //flux register with finer level
644 
645  //special mg objects for when we do not have
646  //a coarser level or when the refinement to coarse
647  //is greater than two
648  //flag for when we need special MG objects
651  //stuff below is only defined if m_hasMGObjects==true
657 
659 
660 private:
661 
662  void incrementFRCoar(EBFastFR& a_fluxReg,
663  const LevelData<EBCellFAB>& a_phiFine,
664  const LevelData<EBCellFAB>& a_phi);
665 
666  void incrementFRFine(EBFastFR& a_fluxReg,
667  const LevelData<EBCellFAB>& a_phiFine,
668  const LevelData<EBCellFAB>& a_phi,
669  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
670 
671  void getFlux(FArrayBox& a_flux,
672  const FArrayBox& a_phi,
673  const Box& a_faceBox,
674  const int& a_idir,
675  const Real& a_dx,
676  const DataIndex& a_datInd);
677 
678 
679 
680  void applyCFBCs(LevelData<EBCellFAB>& a_phi,
681  const LevelData<EBCellFAB>* const a_phiCoarse,
682  bool a_homogeneousCFBC);
683 
684  void getOpVoFStencil(VoFStencil& a_stencil,
685  const EBISBox& a_ebisbox,
686  const VolIndex& a_vof);
687 
688  void getOpVoFStencil(VoFStencil& a_stencil,
689  const int& a_dir,
690  const Vector<VolIndex>& a_allMonotoneVoFs,
691  const EBISBox& a_ebisbox,
692  const VolIndex& a_vof,
693  const bool& a_lowOrder);
694 
695 
696  void getOpFaceStencil(VoFStencil& a_stencil,
697  const Vector<VolIndex>& a_allMonotoneVofs,
698  const EBISBox& a_ebisbox,
699  const VolIndex& a_vof,
700  int a_dir,
701  const Side::LoHiSide& a_side,
702  const FaceIndex& a_face,
703  const bool& a_lowOrder);
704 
705  void levelJacobi(LevelData<EBCellFAB>& a_phi,
706  const LevelData<EBCellFAB>& a_rhs);
707 
709 
710  void applyHomogeneousCFBCs(EBCellFAB& a_phi,
711  const DataIndex& a_datInd,
712  int a_idir,
713  Side::LoHiSide a_hiorlo);
714 private:
715 
716  //! Default constructor. Creates an undefined conductivity operator.
718 
719  //copy constructor and operator= disallowed for all the usual reasons
720  EBConductivityOp(const EBConductivityOp& a_opin)
721  {
722  MayDay::Error("invalid operator");
723  }
724 
725  void operator=(const EBConductivityOp& a_opin)
726  {
727  MayDay::Error("invalid operator");
728  }
729 };
730 
731 
732 #include "NamespaceFooter.H"
733 #endif
void operator=(const EBConductivityOp &a_opin)
Definition: EBConductivityOp.H:725
LayoutData< VoFIterator > m_vofIterDomLo[CH_SPACEDIM]
Definition: EBConductivityOp.H:633
LevelData< EBCellFAB > m_relCoef
Multigrid relaxation coefficient.
Definition: EBConductivityOp.H:626
EBLevelGrid m_eblgCoarMG
Definition: EBConductivityOp.H:573
void setAlphaAndBeta(const Real &a_alpha, const Real &a_beta)
virtual void setToZero(LevelData< EBCellFAB > &a_lhs)
virtual void restrictResidual(LevelData< EBCellFAB > &a_resCoarse, LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_rhsFine)
void fillGrad(const LevelData< EBCellFAB > &a_phi)
These functions are part of the LevelTGA interface......
LayoutData< BaseIVFAB< Real > > m_cacheEBxDomainFluxHi[EBAMRPOVC_NUMSTEN][SpaceDim]
Definition: EBConductivityOp.H:559
void levelJacobi(LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_rhs)
Vector< IntVect > m_colors
Definition: EBConductivityOp.H:658
void getFlux(EBFluxFAB &a_flux, const LevelData< EBCellFAB > &a_data, const Box &a_grid, const DataIndex &a_dit, Real a_scale)
LayoutData< BaseIVFAB< Real > > m_alphaDiagWeight
Definition: EBConductivityOp.H:606
EBFastFR-A class to encapsulate a levels worth of flux registers.
Definition: EBFastFR.H:39
bool m_hasMGObjects
Definition: EBConductivityOp.H:649
RefCountedPtr< ConductivityBaseEBBC > m_ebBC
Definition: EBConductivityOp.H:577
Real m_dx
Definition: EBConductivityOp.H:580
#define CH_SPACEDIM
Definition: SPACE.H:52
RefCountedPtr< ConductivityBaseDomainBC > m_domainBC
Definition: EBConductivityOp.H:576
virtual void AMRUpdateResidual(LevelData< EBCellFAB > &a_residual, const LevelData< EBCellFAB > &a_correction, const LevelData< EBCellFAB > &a_coarseCorrection)
void getFaceCenteredFluxStencil(VoFStencil &a_fluxStencil, const FaceIndex &a_face, const DataIndex &a_dit)
LayoutData< RefCountedPtr< EBStencil > > m_opEBStencil
Definition: EBConductivityOp.H:622
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
void THIS_IS_AN_ERROR_MESSAGE(void)
Definition: EBConductivityOp.H:50
void diagonalScale(LevelData< EBCellFAB > &a_rhs, bool a_kappaWeighted)
virtual void AMROperatorNF(LevelData< EBCellFAB > &a_LofPhi, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_phiCoarse, bool a_homogeneousBC)
RefCountedPtr< LevelData< EBCellFAB > > m_acoef0
Definition: EBConductivityOp.H:589
virtual void AMRProlong(LevelData< EBCellFAB > &a_correction, const LevelData< EBCellFAB > &a_coarseCorrection)
LayoutData< CFIVS > m_loCFIVS[SpaceDim]
Definition: EBConductivityOp.H:639
LayoutData< BaseIVFAB< Real > > m_betaDiagWeight
Definition: EBConductivityOp.H:608
one dimensional dynamic array
Definition: Vector.H:52
RefCountedPtr< LevelData< EBCellFAB > > m_acoef1
Definition: EBConductivityOp.H:593
Definition: FaceIndex.H:28
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: LayoutData.H:46
LayoutData< CFIVS > m_hiCFIVS[SpaceDim]
Definition: EBConductivityOp.H:640
Definition: EBISBox.H:46
void writeEBAMRname(const Vector< LevelData< EBCellFAB > * > *a_dataPtr, const char *a_filename)
LayoutData< VoFIterator > m_vofIterIrreg
Definition: EBConductivityOp.H:630
void calculateRelaxationCoefficient()
virtual void createCoarser(LevelData< EBCellFAB > &a_coarse, const LevelData< EBCellFAB > &a_fine, bool a_ghosted)
void getOpFaceStencil(VoFStencil &a_stencil, const Vector< VolIndex > &a_allMonotoneVofs, const EBISBox &a_ebisbox, const VolIndex &a_vof, int a_dir, const Side::LoHiSide &a_side, const FaceIndex &a_face, const bool &a_lowOrder)
Definition: EBLevelGrid.H:30
void getFluxEBCF(EBFaceFAB &a_flux, const EBCellFAB &a_phi, const Box &a_ghostedBox, Vector< FaceIndex > &a_faceitEBCF, Vector< VoFStencil > &a_stenEBCF)
EBFastFR m_fastFR
Definition: EBConductivityOp.H:643
virtual void dumpAMR(Vector< LevelData< EBCellFAB > *> &a_data, string name)
for debugging
Definition: EBConductivityOp.H:65
bool m_hasCoar
Definition: EBConductivityOp.H:614
void getOpVoFStencil(VoFStencil &a_stencil, const EBISBox &a_ebisbox, const VolIndex &a_vof)
virtual void applyOpNoBoundary(LevelData< EBCellFAB > &a_opPhi, const LevelData< EBCellFAB > &a_phi)
virtual function called by LevelTGA
void writeEBLevelname(const LevelData< EBCellFAB > *a_dataPtr, const char *a_filename)
virtual void relax(LevelData< EBCellFAB > &a_e, const LevelData< EBCellFAB > &a_residual, int a_iterations)
Definition: EBFaceFAB.H:28
RefCountedPtr< LevelData< BaseIVFAB< Real > > > m_bcoIrreg
Definition: EBConductivityOp.H:601
void resetACoefficient(RefCountedPtr< LevelData< EBCellFAB > > &a_acoef)
Piecewise constant interpolation.
Definition: EBMGInterp.H:33
const int SpaceDim
Definition: SPACE.H:39
void calculateAlphaWeight()
Real m_dxCoar
Definition: EBConductivityOp.H:581
void divideByIdentityCoef(LevelData< EBCellFAB > &a_rhs)
Definition: AMRMultiGrid.H:35
EBMGInterp m_ebInterpMG
Definition: EBConductivityOp.H:653
DisjointBoxLayout m_dblCoarMG
Definition: EBConductivityOp.H:654
VoF-centered stencil.
Definition: Stencils.H:59
EBLevelGrid m_eblg
Definition: EBConductivityOp.H:570
virtual void createCoarsened(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_rhs, const int &a_refRat)
A EBFaceFAB-like container for edge-centered fluxes.
Definition: EBFluxFAB.H:25
virtual void scale(LevelData< EBCellFAB > &a_lhs, const Real &a_scale)
static IntVect s_ivDebug
Definition: EBConductivityOp.H:527
virtual void applyOp(LevelData< EBCellFAB > &a_opPhi, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > *const a_phiCoarse, const bool &a_homogeneousPhysBC, const bool &a_homogeneousCFBC)
ProblemDomain m_domainCoarMG
Definition: EBConductivityOp.H:656
virtual int refToCoarser()
LayoutData< VoFIterator > m_vofItIrregColorDomLo[EBAMRPOVC_NUMSTEN][SpaceDim]
Definition: EBConductivityOp.H:556
EBLevelGrid m_eblgCoarsenedFine
Definition: EBConductivityOp.H:574
void AMROperatorNC(LevelData< EBCellFAB > &a_LofPhi, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi, bool a_homogeneousBC, AMRLevelOp< LevelData< EBCellFAB > > *a_finerOp)
virtual void AMRRestrict(LevelData< EBCellFAB > &a_resCoarse, const LevelData< EBCellFAB > &a_residual, const LevelData< EBCellFAB > &a_correction, const LevelData< EBCellFAB > &a_coarseCorrection)
virtual void residual(LevelData< EBCellFAB > &a_residual, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_rhs, bool a_homogeneousPhysBC=false)
EBMGInterp m_ebInterp
Definition: EBConductivityOp.H:619
~EBConductivityOp()
Destructor.
EBLevelGrid m_eblgCoar
Definition: EBConductivityOp.H:572
const char * name(const FArrayBox &a_dummySpecializationArg)
Definition: CH_HDF5.H:741
virtual int refToFiner()
Real m_alpha
Definition: EBConductivityOp.H:603
virtual void prolongIncrement(LevelData< EBCellFAB > &a_phiThisLevel, const LevelData< EBCellFAB > &a_correctCoarse)
Definition: EBCellFAB.H:29
virtual void AMRResidual(LevelData< EBCellFAB > &a_residual, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_phiCoarse, const LevelData< EBCellFAB > &a_rhs, bool a_homogeneousBC, AMRLevelOp< LevelData< EBCellFAB > > *a_finerOp)
void applyOpIrregular(EBCellFAB &a_lhs, const EBCellFAB &a_phi, const bool &a_homogeneous, const DataIndex &a_datInd)
void reflux(LevelData< EBCellFAB > &a_residual, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi, AMRLevelOp< LevelData< EBCellFAB > > *a_finerOp)
bool m_hasEBCF
Definition: EBConductivityOp.H:611
void dumpLevelPoint(const LevelData< EBCellFAB > &a_res, const string &a_blab)
double Real
Definition: REAL.H:33
Definition: MultiGrid.H:30
LayoutData< BaseIVFAB< Real > > m_cacheEBxDomainFluxLo[EBAMRPOVC_NUMSTEN][SpaceDim]
Definition: EBConductivityOp.H:558
const EBLevelGrid & getEBLG() const
Definition: EBConductivityOp.H:494
virtual void relaxGauSai(LevelData< EBCellFAB > &a_e, const LevelData< EBCellFAB > &a_residual, int a_iterations)
virtual void AMROperator(LevelData< EBCellFAB > &a_LofPhi, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_phiCoarse, bool a_homogeneousBC, AMRLevelOp< LevelData< EBCellFAB > > *a_finerOp)
virtual void relaxGSRBFast(LevelData< EBCellFAB > &a_e, const LevelData< EBCellFAB > &a_residual, int a_iterations)
int m_refToCoar
Definition: EBConductivityOp.H:610
void setTime(Real a_oldTime, Real a_mu, Real a_dt)
void getFluxStencil(VoFStencil &a_fluxStencil, const FaceIndex &a_face, const DataIndex &a_dit)
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
bool m_hasInterpAve
Definition: EBConductivityOp.H:613
LoHiSide
Definition: LoHiSide.H:27
Real AMRNorm(const LevelData< EBCellFAB > &a_coarResid, const LevelData< EBCellFAB > &a_fineResid, const int &a_refRat, const int &a_ord)
EBConductivityOp(const EBConductivityOp &a_opin)
Definition: EBConductivityOp.H:720
void applyCFBCs(LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > *const a_phiCoarse, bool a_homogeneousCFBC)
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
virtual void AMRResidualNF(LevelData< EBCellFAB > &a_residual, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_phiCoarse, const LevelData< EBCellFAB > &a_rhs, bool a_homogeneousBC)
EBISLayout m_ebislCoarMG
Definition: EBConductivityOp.H:655
EBMGAverage m_ebAverage
Definition: EBConductivityOp.H:617
LayoutData< VoFIterator > m_vofItIrregColorDomHi[EBAMRPOVC_NUMSTEN][SpaceDim]
Definition: EBConductivityOp.H:557
Definition: EBConductivityOp.H:60
EBConductivityOp()
Default constructor. Creates an undefined conductivity operator.
virtual void dumpLevel(LevelData< EBCellFAB > &a_data, string name)
for debugging
Definition: EBConductivityOp.H:71
virtual void preCond(LevelData< EBCellFAB > &a_opPhi, const LevelData< EBCellFAB > &a_phi)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
void finerOperatorChanged(const MGLevelOp< LevelData< EBCellFAB > > &a_operator, int a_coarseningFactor)
void incrementFRCoar(EBFastFR &a_fluxReg, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi)
const IntVect m_ghostCellsRHS
Definition: EBConductivityOp.H:566
virtual void create(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_rhs)
LayoutData< VoFIterator > m_vofIterMulti
Definition: EBConductivityOp.H:631
Definition: DataIndex.H:112
RefCountedPtr< LevelData< EBCellFAB > > m_acoef
Definition: EBConductivityOp.H:585
void gsrbColor(LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_lph, const LevelData< EBCellFAB > &a_rhs, const IntVect &a_color)
void getFluxRegOnly(EBFaceFAB &a_fluxCentroid, const EBCellFAB &a_phi, const Box &a_ghostedBox, const Real &a_dx, const DataIndex &a_datInd, const int &a_idir)
virtual void setVal(LevelData< EBCellFAB > &a_lhs, const Real &a_value)
Piecewise constant interpolation.
Definition: EBMGAverage.H:31
LayoutData< Vector< VoFStencil > > m_stencilCoar[2 *SpaceDim]
Definition: EBConductivityOp.H:552
Real m_beta
Definition: EBConductivityOp.H:604
virtual void relaxPoiJac(LevelData< EBCellFAB > &a_e, const LevelData< EBCellFAB > &a_residual, int a_iterations)
LayoutData< RefCountedPtr< EBStencil > > m_colorEBStencil[EBAMRPOVC_NUMSTEN]
Definition: EBConductivityOp.H:560
int m_relaxType
Definition: EBConductivityOp.H:564
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
bool m_hasFine
Definition: EBConductivityOp.H:612
EBMGAverage m_ebAverageMG
Definition: EBConductivityOp.H:652
Definition: FArrayBox.H:44
Definition: AMRTGA.H:159
virtual void kappaScale(LevelData< EBCellFAB > &a_rhs)
for eb only. kappa weight the rhs but do not multiply by the identity coefficient ...
Real m_dxFine
Definition: EBConductivityOp.H:579
void AMRResidualNC(LevelData< EBCellFAB > &a_residual, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_rhs, bool a_homogeneousBC, AMRLevelOp< LevelData< EBCellFAB > > *a_finerOp)
virtual void assign(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_rhs)
Volume of Fluid Index.
Definition: VolIndex.H:31
static bool s_turnOffBCs
Definition: EBConductivityOp.H:526
void incrementFRFine(EBFastFR &a_fluxReg, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi, AMRLevelOp< LevelData< EBCellFAB > > *a_finerOp)
void defineEBCFStencils()
void incrOpRegularAllDirs(Box *a_loBox, Box *a_hiBox, int *a_hasLo, int *a_hasHi, Box &a_curDblBox, Box &a_curPhiBox, int a_nComps, BaseFab< Real > &a_curOpPhiFAB, const BaseFab< Real > &a_curPhiFAB, bool a_homogeneousPhysBC, const DataIndex &a_dit)
RefCountedPtr< LevelData< EBFluxFAB > > m_bcoef
Definition: EBConductivityOp.H:597
Definition: EBISLayout.H:39
LayoutData< VoFIterator > m_vofIterDomHi[CH_SPACEDIM]
Definition: EBConductivityOp.H:634
void incrOpRegularDir(EBCellFAB &a_lhs, const EBCellFAB &a_phi, const bool &a_homogeneous, const int &a_dir, const DataIndex &a_datInd)
void getDivFStencil(VoFStencil &a_vofStencil, const VolIndex &a_vof, const DataIndex &a_dit)
virtual void incr(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_x, Real a_scale)
const IntVect m_ghostCellsPhi
Definition: EBConductivityOp.H:565
void GSColorAllIrregular(EBCellFAB &a_phi, const EBCellFAB &a_rhs, const int &a_icolor, const DataIndex &a_dit)
virtual void axby(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_x, const LevelData< EBCellFAB > &a_y, Real a_a, Real a_b)
bool m_layoutChanged
Definition: EBConductivityOp.H:650
void applyHomogeneousCFBCs(LevelData< EBCellFAB > &a_phi)
void dumpFABPoint(const EBCellFAB &a_fab, const DataIndex &a_dit, const string &a_blab)
void defineColorStencils(Box a_ideBoxLo[SpaceDim], Box a_ideBoxHi[SpaceDim])
EBLevelGrid m_eblgFine
Definition: EBConductivityOp.H:571
LayoutData< Vector< FaceIndex > > m_faceitCoar[2 *SpaceDim]
Definition: EBConductivityOp.H:551
RefCountedPtr< EBQuadCFInterp > m_quadCFIWithCoar
Definition: EBConductivityOp.H:568
int m_refToFine
Definition: EBConductivityOp.H:609
virtual Real norm(const LevelData< EBCellFAB > &a_rhs, int a_ord)
virtual Real dotProduct(const LevelData< EBCellFAB > &a_1, const LevelData< EBCellFAB > &a_2)
void applyDomainFlux(Box *a_loBox, Box *a_hiBox, int *a_hasLo, int *a_hasHi, Box &a_dblBox, int a_nComps, BaseFab< Real > &a_phiFAB, bool a_homogeneousPhysBC, const DataIndex &a_dit)