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