Chombo + EB + MF  3.2
EBViscousTensorOp.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 _EBVISCOUSTENSOROP_H_
12 #define _EBVISCOUSTENSOROP_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 
23 #include "EBIndexSpace.H"
24 #include "EBCellFAB.H"
25 #include "EBCellFactory.H"
26 
27 #include "EBLevelDataOps.H"
28 #include "BaseEBBC.H"
29 #include "AMRTGA.H"
30 #include "BaseDomainBC.H"
31 #include "CFIVS.H"
32 #include "EBFastFR.H"
33 #include "EBMGAverage.H"
34 #include "EBMGInterp.H"
35 #include "EBTensorCFInterp.H"
36 #include "EBCoarsen.H"
37 #include "PolyGeom.H"
38 #include "EBQuadCFInterp.H"
39 #include "EBLevelGrid.H"
40 #include "ViscousBaseDomainBC.H"
41 #include "EBAMRIO.H"
42 #include "DivergenceStencil.H"
43 
44 #include "NamespaceHeader.H"
45 
46 // Forward declaration.
47 class EBViscousTensorOp;
48 
49 //! \class EBViscousTensorOp
50 //! This class implements an operator that solves the equation
51 //! alpha a I + (divF) = alpha a I + beta*div(eta(grad B + grad B^T) + lambda* I div B ) = rhs
52 //! where beta, lambda, and eta are incorporated into the flux F. It uses
53 //! the AMRLevelOp interface.
54 //class EBViscousTensorOp: public AMRLevelOp<LevelData<EBCellFAB> >
55 class EBViscousTensorOp: public LevelTGAHelmOp<LevelData<EBCellFAB>, EBFluxFAB >
56 {
57  public:
58 
59  static int s_whichLev;
60  static int s_step;
61 
62 
63  //! Constructs a viscous tensor operator using the given data. This
64  //! constructor is for time-independent a and b coefficients.
65  EBViscousTensorOp(const EBLevelGrid & a_eblgFine,
66  const EBLevelGrid & a_eblg,
67  const EBLevelGrid & a_eblgCoar,
68  const EBLevelGrid & a_eblgCoarMG,
69  const Real& a_alpha,
70  const Real& a_beta,
71  const RefCountedPtr<LevelData<EBCellFAB> >& a_acoef,
72  const RefCountedPtr<LevelData<EBFluxFAB> >& a_eta,
73  const RefCountedPtr<LevelData<EBFluxFAB> >& a_lambda,
74  const RefCountedPtr<LevelData<BaseIVFAB<Real> > >& a_etaIrreg,
75  const RefCountedPtr<LevelData<BaseIVFAB<Real> > >& a_lambdaIrreg,
76  const Real& a_dx,
77  const Real& a_dxCoar,
78  const int& a_refToFine,
79  const int& a_refToCoar,
80  const RefCountedPtr<ViscousBaseDomainBC>& a_domainBC,
81  const RefCountedPtr<ViscousBaseEBBC>& a_ebBC,
82  const bool& a_hasMGObjects,
83  const IntVect& a_ghostCellsPhi,
84  const IntVect& a_ghostCellsRHS);
85 
86 
87  //! Destructor.
88  virtual ~EBViscousTensorOp();
89 
90  ///for tga to reset stuff
91  virtual void setAlphaAndBeta(const Real& a_alpha,
92  const Real& a_beta);
93 
94  ///
95  /**
96  This sets the data storage for the a coefficient to a different
97  object and recalculates the stuff that depends on it. Use this only if you know what you're doing.
98  */
100  {
101  m_acoef = a_acoef;
104  }
105 
106 #ifdef CH_USE_HDF5
107  virtual void outputLevel(LevelData<EBCellFAB>& a_rhs, string& a_name)
108  {
109  char filename[1024];
110  sprintf(filename, "%s.ebvto.step%d.lev.%d.hdf5",a_name.c_str(), s_step, s_whichLev );
111  writeEBLevelname(&a_rhs, filename);
112  }
113 
114 
115  virtual void outputAMR(Vector< LevelData<EBCellFAB>* >& a_rhs, string& a_name)
116  {
117  char filename[1024];
118  sprintf(filename, "%s.ebvto.step%d.lev.%d.hdf5", a_name.c_str(), s_step, s_whichLev );
119  writeEBAMRname(&a_rhs, filename);
120  }
121 #endif
122 
123  ///it's tga's world---we just live in it.
124  virtual void kappaScale(LevelData<EBCellFAB> & a_rhs)
125  {
127  }
128 
129  /// compute (tau dot grad u) (for energy equation)
131  const LevelData<EBCellFAB>& a_gradU,
132  int a_level);
133 
134  /// compute volfrac(sigma dot grad u) (for energy equation)
135  void getKappaDivSigmaU(LevelData<EBCellFAB> & a_divSigmaU,
136  const LevelData<EBCellFAB>& a_velocity,
137  const LevelData<EBCellFAB>* a_veloCoar,
138  int a_level);
139 
140  //average surrounding coeffcients onto faces (simple averages)
142  LevelData<EBCellFAB>& a_lambdaCell);
143 
144  //get stress at cell centers given gradient of velocity
145  void getCCSigma(LevelData<EBCellFAB> & a_source,
146  const LevelData<EBCellFAB>& a_gradU,
147  const LevelData<EBCellFAB>& a_eta,
148  const LevelData<EBCellFAB>& a_lambda);
149  ///another tgaism
150  virtual void diagonalScale(LevelData<EBCellFAB> & a_rhs,
151  bool a_kappaWeighted)
152  {
153  if (a_kappaWeighted)
155  for (DataIterator dit = m_eblg.getDBL().dataIterator(); dit.ok(); ++dit)
156  {
157  for (int idir = 0; idir < SpaceDim; idir++)
158  {
159  int isrc = 0; int idst = idir; int inco = 1;
160  a_rhs[dit()].mult((*m_acoef)[dit()], isrc, idst, inco);
161  }
162  }
163  }
164 
166  {
167  for (DataIterator dit = m_eblg.getDBL().dataIterator(); dit.ok(); ++dit)
168  {
169  for (int idir = 0; idir < SpaceDim; idir++)
170  {
171  int isrc = 0; int idst = idir; int inco = 1;
172  a_rhs[dit()].divide((*m_acoef)[dit()], isrc, idst, inco);
173  }
174  }
175  }
176 
177  ///a leveltgaism
178  virtual void fillGrad(const LevelData<EBCellFAB>& a_phi);
179 
180  ///another leveltgaism
181  virtual void getFlux(EBFluxFAB& a_flux,
182  const LevelData<EBCellFAB>& a_data,
183  const Box& a_grid,
184  const DataIndex& a_dit,
185  Real a_scale);
186 
187  void getVelDotSigma(LevelData<EBFluxFAB> & a_velDotSigma,
188  const LevelData<EBFluxFAB>& a_vel,
189  const LevelData<EBFluxFAB>& a_sigma);
190 
191  void getFlux(EBFaceFAB& a_fluxCentroid,
192  const EBCellFAB& a_phi,
193  const Box& a_ghostedBox,
194  const Box& a_fabBox,
195  const ProblemDomain& a_domain,
196  const EBISBox& a_ebisBox,
197  const Real& a_dx,
198  const DataIndex& a_datInd,
199  const int& a_idir);
200 
201  // This operator may be time-dependent.
202  void setTime(Real a_oldTime, Real a_mu, Real a_dt);
203 
204  /// apply operator without any boundary or coarse-fine boundary conditions and no finer level
206  const LevelData<EBCellFAB>& a_phi)
207  {
208  s_turnOffBCs = true;
209  applyOp(a_opPhi, a_phi, true);
210  s_turnOffBCs = false;
211  }
212 
213  //! This is called on multigrid operators when their AMR operators
214  //! are altered.
215  void finerOperatorChanged(const MGLevelOp<LevelData<EBCellFAB> >& a_operator,
216  int a_coarseningFactor);
217 
218  //functions used by the wider world
219 
220  ///
221  /** a_residual = a_rhs - L(a_phiFine, a_phi) no coaser AMR level*/
222  void AMRResidualNC(LevelData<EBCellFAB>& a_residual,
223  const LevelData<EBCellFAB>& a_phiFine,
224  const LevelData<EBCellFAB>& a_phi,
225  const LevelData<EBCellFAB>& a_rhs,
226  bool a_homogeneousBC,
227  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
228 
229 
230  ///
231  /** apply AMR operator no coaser AMR level*/
232  void AMROperatorNC(LevelData<EBCellFAB>& a_LofPhi,
233  const LevelData<EBCellFAB>& a_phiFine,
234  const LevelData<EBCellFAB>& a_phi,
235  bool a_homogeneousBC,
236  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
237 
238  ///
239  /**
240  */
241  virtual void residual(LevelData<EBCellFAB>& a_residual,
242  const LevelData<EBCellFAB>& a_phi,
243  const LevelData<EBCellFAB>& a_rhs,
244  bool a_homogeneousPhysBC=false);
245 
246  ///
247  /**
248  */
249  virtual void preCond(LevelData<EBCellFAB>& a_opPhi,
250  const LevelData<EBCellFAB>& a_phi);
251 
252 
253  ///
254  /**
255  this is the linearop function. CFBC is set to homogeneous. phic is null
256  */
257  virtual void applyOp(LevelData<EBCellFAB>& a_opPhi,
258  const LevelData<EBCellFAB>& a_phi,
259  bool a_homogeneousPhysBC);
260 
261 
262  void incrOpWithExternalFlux(EBCellFAB & a_lhs,
263  const DataIndex & a_dit,
264  const BaseIVFAB<Real> & a_ebflux);
265 
266 
267  /// if the flux is null, it is not used
268  void applyOp(LevelData<EBCellFAB> & a_lhs,
269  const LevelData<EBCellFAB> & a_phi,
270  bool a_homogeneous,
271  const LevelData<BaseIVFAB<Real> >* a_ebflux);
272  ///
273  /**
274  */
275  virtual void create(LevelData<EBCellFAB>& a_lhs,
276  const LevelData<EBCellFAB>& a_rhs);
277 
278  ///
279  virtual void createCoarsened(LevelData<EBCellFAB>& a_lhs,
280  const LevelData<EBCellFAB>& a_rhs,
281  const int& a_refRat);
282 
283  ///
284  Real
285  AMRNorm(const LevelData<EBCellFAB>& a_coarResid,
286  const LevelData<EBCellFAB>& a_fineResid,
287  const int& a_refRat,
288  const int& a_ord);
289 
290 
291  ///
292  /**
293  */
294  virtual void assign(LevelData<EBCellFAB>& a_lhs,
295  const LevelData<EBCellFAB>& a_rhs);
296 
297  ///
298  /**
299  */
300  virtual Real dotProduct(const LevelData<EBCellFAB>& a_1,
301  const LevelData<EBCellFAB>& a_2);
302 
303  ///
304  /**
305  */
306  virtual void incr(LevelData<EBCellFAB>& a_lhs,
307  const LevelData<EBCellFAB>& a_x,
308  Real a_scale);
309 
310  ///
311  /**
312  */
313  virtual void axby(LevelData<EBCellFAB>& a_lhs,
314  const LevelData<EBCellFAB>& a_x,
315  const LevelData<EBCellFAB>& a_y,
316  Real a_a,
317  Real a_b);
318 
319  ///
320  /**
321  */
322  virtual void scale(LevelData<EBCellFAB>& a_lhs,
323  const Real& a_scale);
324 
325  ///
326  /**
327  */
328  virtual Real norm(const LevelData<EBCellFAB>& a_rhs,
329  int a_ord);
330 
331  static Real staticMaxNorm(const LevelData<EBCellFAB>& a_rhs, const EBLevelGrid& a_eblg);
332 
333  virtual Real localMaxNorm(const LevelData<EBCellFAB>& a_rhs);
334  ///
335  /**
336  */
337  virtual void setToZero(LevelData<EBCellFAB>& a_lhs);
338 
339  ///
340  /**
341  */
342  virtual void setVal(LevelData<EBCellFAB>& a_lhs, const Real& a_value);
343 
344  ///
345  /**
346  */
347  virtual void createCoarser(LevelData<EBCellFAB>& a_coarse,
348  const LevelData<EBCellFAB>& a_fine,
349  bool a_ghosted);
350 
351  ///
352  /**
353  */
354  virtual void relax(LevelData<EBCellFAB>& a_e,
355  const LevelData<EBCellFAB>& a_residual,
356  int a_iterations);
357 
358 
359  ///
360  /**
361  Calculate restricted residual:
362  a_resCoarse[2h] = I[h->2h] (a_rhsFine[h] - L[h](a_phiFine[h]))
363  */
364  virtual void restrictResidual(LevelData<EBCellFAB>& a_resCoarse,
365  LevelData<EBCellFAB>& a_phiFine,
366  const LevelData<EBCellFAB>& a_rhsFine);
367 
368  ///
369  /**
370  Correct the fine solution based on coarse correction:
371  a_phiThisLevel += I[2h->h] (a_correctCoarse)
372  */
373  virtual void prolongIncrement(LevelData<EBCellFAB>& a_phiThisLevel,
374  const LevelData<EBCellFAB>& a_correctCoarse);
375 
376  ///
377  /** Refinement ratio between this level and coarser level.
378  Returns 1 when there are no coarser AMRLevelOp objects */
379  virtual int refToCoarser();
380 
381  ///
382  /** Refinement ratio between this level and coarser level.
383  Returns 1 when there are no coarser AMRLevelOp objects */
384  virtual int refToFiner();
385 
386  ///
387  /** a_residual = a_rhs - L(a_phi, a_phiFine, a_phiCoarse) */
388  virtual void AMRResidual(LevelData<EBCellFAB>& a_residual,
389  const LevelData<EBCellFAB>& a_phiFine,
390  const LevelData<EBCellFAB>& a_phi,
391  const LevelData<EBCellFAB>& a_phiCoarse,
392  const LevelData<EBCellFAB>& a_rhs,
393  bool a_homogeneousBC,
394  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
395 
396  ///
397  /** a_residual = a_rhs - L(a_phi, a_phiCoarse) */
398  virtual void AMRResidualNF(LevelData<EBCellFAB>& a_residual,
399  const LevelData<EBCellFAB>& a_phi,
400  const LevelData<EBCellFAB>& a_phiCoarse,
401  const LevelData<EBCellFAB>& a_rhs,
402  bool a_homogeneousBC);
403 
404 
405  ///
406  /** a_residual = a_rhs - L(a_phi, a_phiFine, a_phiCoarse) */
407  virtual void AMROperator(LevelData<EBCellFAB>& a_LofPhi,
408  const LevelData<EBCellFAB>& a_phiFine,
409  const LevelData<EBCellFAB>& a_phi,
410  const LevelData<EBCellFAB>& a_phiCoarse,
411  bool a_homogeneousBC,
412  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
413 
414  ///
415  /** a_residual = a_rhs - L(a_phi, a_phiCoarse) */
416  virtual void AMROperatorNF(LevelData<EBCellFAB>& a_LofPhi,
417  const LevelData<EBCellFAB>& a_phi,
418  const LevelData<EBCellFAB>& a_phiCoarse,
419  bool a_homogeneousBC);
420 
421  ///
422  /** a_resCoarse = I[h-2h] (a_residual - L(a_correction, a_coarseCorrection)) */
423  virtual void AMRRestrict(LevelData<EBCellFAB>& a_resCoarse,
424  const LevelData<EBCellFAB>& a_residual,
425  const LevelData<EBCellFAB>& a_correction,
426  const LevelData<EBCellFAB>& a_coarseCorrection,
427  bool a_skip_res = false );
428 
429  ///
430  /** a_correction += I[2h->h](a_coarseCorrection) */
431  virtual void AMRProlong(LevelData<EBCellFAB>& a_correction,
432  const LevelData<EBCellFAB>& a_coarseCorrection);
433 
434  ///
435  /** a_residual = a_residual - L(a_correction, a_coarseCorrection) */
436  virtual void AMRUpdateResidual(LevelData<EBCellFAB>& a_residual,
437  const LevelData<EBCellFAB>& a_correction,
438  const LevelData<EBCellFAB>& a_coarseCorrection);
439 
440  ///static for code reuse in bcs
441  static void
442  getFaceCenteredFluxStencil(VoFStencil & a_fluxStencil,
443  const RefCountedPtr<LevelData<EBFluxFAB> >& a_eta,
444  const RefCountedPtr<LevelData<EBFluxFAB> >& a_lambda,
445  const Real & a_dx,
446  const EBLevelGrid & a_eblg,
447  const FaceIndex & a_face,
448  const DataIndex & a_dit,
449  int a_ivar);
450 
451  ///static for code reuse in bcs
452  static void
453  getFluxStencil(VoFStencil & a_fluxStencil,
454  const RefCountedPtr<LevelData<EBFluxFAB> >& a_eta,
455  const RefCountedPtr<LevelData<EBFluxFAB> >& a_lambda,
456  const Real & a_dx,
457  const EBLevelGrid & a_eblg,
458  const FaceIndex & a_face,
459  const DataIndex & a_dit,
460  int a_ivar);
461 
462  ///static for code reuse in bcs
463  static void
464  getDivergenceStencil(VoFStencil& a_divStencil,
465  const FaceIndex& a_face,
466  const DataIndex& a_dit,
467  const Real & a_dx,
468  const EBLevelGrid& a_eblg);
469 
470  ///static for code reuse in bcs
471  static void
472  getGradientStencil(VoFStencil& a_gradStencil,
473  int a_ivar,
474  int a_diffDir,
475  const FaceIndex& a_face,
476  const DataIndex& a_dit,
477  const Real & a_dx,
478  const EBLevelGrid& a_eblg);
479 
480  ///
481  static void doLazyRelax(bool a_doLazyRelax)
482  {
483  s_doLazyRelax = a_doLazyRelax;
484  }
485  static void setForceNoEBCF(bool a_forceNoEBCF)
486  {
487  s_forceNoEBCF = a_forceNoEBCF;
488  }
489 
490  //! (Re)define the stencils for the given coefficients.
491  void defineStencils();
492 
493  protected:
494 
495  //internal functions not usable without significant context
496  // void fillGrad(const LevelData<EBCellFAB>& a_phi);
497 
498  void incrOpRegularDir(EBCellFAB& a_lhs,
499  const EBCellFAB& a_phi,
500  const bool& a_homogeneous,
501  const int& a_dir,
502  const DataIndex& a_datInd);
503 
504  void applyOpIrregular(EBCellFAB& a_lhs,
505  const EBCellFAB& a_phi,
506  const bool& a_homogeneous,
507  const DataIndex& a_datInd);
508 
509  void getFlux(FArrayBox& a_flux,
510  const FArrayBox& a_phi,
511  const FArrayBox& a_gradPhi,
512  const Box& a_faceBox,
513  const int& a_idir,
514  const DataIndex& a_datInd);
515  void
516  cfinterp(const LevelData<EBCellFAB>& a_phi,
517  const LevelData<EBCellFAB>& a_phiCoarse);
518 
519  void reflux(const LevelData<EBCellFAB>& a_phiFine,
520  const LevelData<EBCellFAB>& a_phi,
521  LevelData<EBCellFAB>& residual,
522  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
523 
525 
526  void getVoFStencil(VoFStencil& a_vofStencil,
527  const VolIndex& a_vof,
528  const DataIndex& a_dit,
529  int a_ivar);
530 
531  void getDivergenceStencil(VoFStencil& a_gradStencil,
532  const FaceIndex& a_face,
533  const DataIndex& a_dit);
534 
535  void getGradientStencil(VoFStencil& a_gradStencil,
536  int a_ivar,
537  int a_diffDir,
538  const FaceIndex& a_face,
539  const DataIndex& a_dit);
540 
541 
542  void gsrbColor(LevelData<EBCellFAB>& a_phi,
543  const LevelData<EBCellFAB>& a_lph,
544  const LevelData<EBCellFAB>& a_rhs,
545  const IntVect& a_color);
546 
547  void getFaceCenteredFluxStencil(VoFStencil& a_fluxStencil,
548  const FaceIndex& a_face,
549  const DataIndex& a_dit,
550  int a_ivar);
551 
552  void cellGrad(EBCellFAB& a_gradPhi,
553  const EBCellFAB& a_phi,
554  const Box& a_grid,
555  const DataIndex& a_datInd);
556 
557  void
559  const LevelData<EBCellFAB>& a_phiFine,
560  const LevelData<EBCellFAB>& a_phi);
561 
562  //simple averaging
563  void
565  const LevelData<EBFluxFAB>& a_faceCoef,
566  const LevelData<BaseIVFAB<Real> >& a_irregCoef);
567 
568  void
570  const LevelData<EBCellFAB>& a_phiFine,
571  const LevelData<EBCellFAB>& a_phi,
572  AMRLevelOp<LevelData<EBCellFAB> >* a_finerOp);
573 
574  //member data, bloated though it may be
575  static bool s_turnOffBCs;
576  static bool s_forceNoEBCF;
577 
578  static bool s_doLazyRelax;
579  //locations of coarse fine interfaces
583  // will need these to do tangential gradient computations
586 
588  //grid information
593 
594  //operator coefficients
597  //weights that get multiplied by alpha
599  //weights that get multiplied by beta
602 
603  //! "Current" (time-interpolated) value of the a coefficient. For a
604  //! time-independent a coefficient, this is where the coefficient lives.
606 
607 
612 
613 
614  //flux register with finer level
616 
617  //grid spacing
618  //dxcoar not implied by ref ratio--we could be in some MG level where dx > dxcoar
619  //needed for homogeneous cf interp
622  Real getSafety();
623  virtual void calculateAlphaWeight();
624  virtual void calculateRelaxationCoefficient();
625 
626  //refinement ratios and whether this object has multigrid objects
627  bool m_hasFine;
628  bool m_hasCoar;
632 
633  //ghost cell information needed for ebstencil optimizations
636 
637  //stencil to apply irregular operator
639 
640  //relaxation coefficent
642 
643  //gradient of solution at cell centers
645 
648  //for domain boundary conditions at ir regular cells
651 
652  //for inhomogeneous cf interpolation
654 
655  //averaging operators
658 
659  //interpolation operators
662 
663  //boundary condition operators
669 
670  //scrounged from EBLevelDataOps for performance reasons
671  void
672  averageCellToFace(EBFaceFAB & a_fluxData,
673  const EBCellFAB & a_cellData,
674  const Box & a_grid,
675  const EBISBox & a_ebisBox,
676  const ProblemDomain & a_domain,
677  const DataIndex& a_dit,
678  int isrc, int idst, int inco,
679  bool a_interpolateToCentroid);
680 
681 
682  //scrounged from EBLevelDataOps for performance reasons
683  void
685  const LevelData<EBCellFAB>& a_cellData,
686  const DisjointBoxLayout& a_grids,
687  const EBISLayout& a_ebisl,
688  const ProblemDomain& a_domain,
689  int isrc, int idst, int inco,
690  bool a_interpolateToCentroid);
691 
692 
693  //scrounged from EBLevelDataOps for performance reasons
694  void
696  const EBCellFAB & a_cellData,
697  const Box & ccFluxBox,
698  const EBISBox & a_ebisBox,
699  const ProblemDomain & a_domain,
700  const DataIndex& a_dit,
701  int isrc, int idst, int inco);
702 
704 
705 private:
706  ///weak construction is bad
708  {
709  MayDay::Error("invalid operator");
710  }
711 
712  //copy constructor and operator= disallowed for all the usual reasons
714  {
715  MayDay::Error("invalid operator");
716  }
717 
718  void operator=(const EBViscousTensorOp& a_opin)
719  {
720  MayDay::Error("invalid operator");
721  }
722 };
723 
724 
725 #include "NamespaceFooter.H"
726 #endif
static void doLazyRelax(bool a_doLazyRelax)
Definition: EBViscousTensorOp.H:481
LayoutData< IntVectSet > m_ivsIrregCCFlux
Definition: EBViscousTensorOp.H:703
RefCountedPtr< LevelData< EBFluxFAB > > m_lambda
Definition: EBViscousTensorOp.H:609
virtual void setToZero(LevelData< EBCellFAB > &a_lhs)
IntVect m_ghostCellsRHS
Definition: EBViscousTensorOp.H:635
EBFastFR m_fastFR
Definition: EBViscousTensorOp.H:615
EBMGAverage m_ebAverage
Definition: EBViscousTensorOp.H:656
LayoutData< BaseIVFAB< Real > > m_alphaDiagWeight
Definition: EBViscousTensorOp.H:598
virtual void scale(LevelData< EBCellFAB > &a_lhs, const Real &a_scale)
virtual void kappaScale(LevelData< EBCellFAB > &a_rhs)
it&#39;s tga&#39;s world—we just live in it.
Definition: EBViscousTensorOp.H:124
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)
virtual void createCoarsened(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_rhs, const int &a_refRat)
virtual void restrictResidual(LevelData< EBCellFAB > &a_resCoarse, LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_rhsFine)
A reference-counting handle class.
Definition: RefCountedPtr.H:173
EBFastFR-A class to encapsulate a levels worth of flux registers.
Definition: EBFastFR.H:39
void cfinterp(const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_phiCoarse)
#define CH_SPACEDIM
Definition: SPACE.H:51
RefCountedPtr< LevelData< BaseIVFAB< Real > > > m_etaIrreg
Definition: EBViscousTensorOp.H:610
void faceCenteredAverageCellsToFaces(EBFaceFAB &a_faceData, const EBCellFAB &a_cellData, const Box &ccFluxBox, const EBISBox &a_ebisBox, const ProblemDomain &a_domain, const DataIndex &a_dit, int isrc, int idst, int inco)
LevelData< EBCellFAB > m_grad
Definition: EBViscousTensorOp.H:644
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
EBMGAverage m_ebAverageMG
Definition: EBViscousTensorOp.H:657
virtual void AMROperatorNF(LevelData< EBCellFAB > &a_LofPhi, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_phiCoarse, bool a_homogeneousBC)
static int s_whichLev
Definition: EBViscousTensorOp.H:59
EBViscousTensorOp(const EBViscousTensorOp &a_opin)
Definition: EBViscousTensorOp.H:713
static void setForceNoEBCF(bool a_forceNoEBCF)
Definition: EBViscousTensorOp.H:485
LayoutData< TensorFineStencilSet > m_hiTanStencilSets[SpaceDim]
Definition: EBViscousTensorOp.H:584
void reflux(const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi, LevelData< EBCellFAB > &residual, AMRLevelOp< LevelData< EBCellFAB > > *a_finerOp)
Real m_dxCoar
Definition: EBViscousTensorOp.H:621
LayoutData< BaseIVFAB< Real > > m_betaDiagWeight
Definition: EBViscousTensorOp.H:600
virtual void AMRProlong(LevelData< EBCellFAB > &a_correction, const LevelData< EBCellFAB > &a_coarseCorrection)
static void kappaWeight(LevelData< EBCellFAB > &a_data)
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)
static void getDivergenceStencil(VoFStencil &a_divStencil, const FaceIndex &a_face, const DataIndex &a_dit, const Real &a_dx, const EBLevelGrid &a_eblg)
static for code reuse in bcs
one dimensional dynamic array
Definition: Vector.H:53
void incrementFRCoar(EBFastFR &a_fr, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi)
EBMGInterp m_ebInterpMG
Definition: EBViscousTensorOp.H:661
Definition: FaceIndex.H:28
EBMGInterp m_ebInterp
Definition: EBViscousTensorOp.H:660
virtual void AMRUpdateResidual(LevelData< EBCellFAB > &a_residual, const LevelData< EBCellFAB > &a_correction, const LevelData< EBCellFAB > &a_coarseCorrection)
virtual int refToFiner()
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)
RefCountedPtr< LevelData< EBCellFAB > > m_acoef
Definition: EBViscousTensorOp.H:605
static int s_step
Definition: EBViscousTensorOp.H:60
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:152
void averageToCells(LevelData< EBCellFAB > &a_cellCoef, const LevelData< EBFluxFAB > &a_faceCoef, const LevelData< BaseIVFAB< Real > > &a_irregCoef)
Definition: EBISBox.H:46
void getCCSigma(LevelData< EBCellFAB > &a_source, const LevelData< EBCellFAB > &a_gradU, const LevelData< EBCellFAB > &a_eta, const LevelData< EBCellFAB > &a_lambda)
void writeEBAMRname(const Vector< LevelData< EBCellFAB > * > *a_dataPtr, const char *a_filename)
void setTime(Real a_oldTime, Real a_mu, Real a_dt)
Definition: EBLevelGrid.H:30
LayoutData< RefCountedPtr< DivergenceStencil > > m_divergenceStencil
Definition: EBViscousTensorOp.H:582
static Real staticMaxNorm(const LevelData< EBCellFAB > &a_rhs, const EBLevelGrid &a_eblg)
DisjointBoxLayout getDBL() const
Definition: EBLevelGrid.H:86
virtual void assign(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_rhs)
virtual bool ok() const
return true if this iterator is still in its Layout
Definition: LayoutIterator.H:117
void incrOpWithExternalFlux(EBCellFAB &a_lhs, const DataIndex &a_dit, const BaseIVFAB< Real > &a_ebflux)
Definition: DataIterator.H:190
EBViscousTensorOp()
weak construction is bad
Definition: EBViscousTensorOp.H:707
void writeEBLevelname(const LevelData< EBCellFAB > *a_dataPtr, const char *a_filename)
void getCellCenteredCoefficients(LevelData< EBCellFAB > &a_etaCell, LevelData< EBCellFAB > &a_lambdaCell)
Definition: EBFaceFAB.H:28
void getShearStressDotGradU(LevelData< EBCellFAB > &a_source, const LevelData< EBCellFAB > &a_gradU, int a_level)
compute (tau dot grad u) (for energy equation)
virtual Real norm(const LevelData< EBCellFAB > &a_rhs, int a_ord)
virtual Real dotProduct(const LevelData< EBCellFAB > &a_1, const LevelData< EBCellFAB > &a_2)
RefCountedPtr< EBTensorCFInterp > m_interpWithCoarser
Definition: EBViscousTensorOp.H:653
LayoutData< CFIVS > m_hiCFIVS[CH_SPACEDIM]
Definition: EBViscousTensorOp.H:581
void getVelDotSigma(LevelData< EBFluxFAB > &a_velDotSigma, const LevelData< EBFluxFAB > &a_vel, const LevelData< EBFluxFAB > &a_sigma)
virtual void divideByIdentityCoef(LevelData< EBCellFAB > &a_rhs)
Definition: EBViscousTensorOp.H:165
Piecewise constant interpolation.
Definition: EBMGInterp.H:33
int m_refToCoar
Definition: EBViscousTensorOp.H:630
const int SpaceDim
Definition: SPACE.H:38
Definition: AMRMultiGrid.H:39
VoF-centered stencil.
Definition: Stencils.H:60
static void getGradientStencil(VoFStencil &a_gradStencil, int a_ivar, int a_diffDir, const FaceIndex &a_face, const DataIndex &a_dit, const Real &a_dx, const EBLevelGrid &a_eblg)
static for code reuse in bcs
static bool s_turnOffBCs
Definition: EBViscousTensorOp.H:575
Real m_dx
Definition: EBViscousTensorOp.H:620
virtual void getFlux(EBFluxFAB &a_flux, const LevelData< EBCellFAB > &a_data, const Box &a_grid, const DataIndex &a_dit, Real a_scale)
another leveltgaism
LayoutData< VoFIterator > m_vofIterMulti
Definition: EBViscousTensorOp.H:647
A EBFaceFAB-like container for edge-centered fluxes.
Definition: EBFluxFAB.H:25
virtual void outputLevel(LevelData< EBCellFAB > &a_rhs, string &a_name)
Definition: EBViscousTensorOp.H:107
void finerOperatorChanged(const MGLevelOp< LevelData< EBCellFAB > > &a_operator, int a_coarseningFactor)
RefCountedPtr< LevelData< BaseIVFAB< Real > > > m_lambdaIrreg
Definition: EBViscousTensorOp.H:611
static void getFluxStencil(VoFStencil &a_fluxStencil, const RefCountedPtr< LevelData< EBFluxFAB > > &a_eta, const RefCountedPtr< LevelData< EBFluxFAB > > &a_lambda, const Real &a_dx, const EBLevelGrid &a_eblg, const FaceIndex &a_face, const DataIndex &a_dit, int a_ivar)
static for code reuse in bcs
static void getFaceCenteredFluxStencil(VoFStencil &a_fluxStencil, const RefCountedPtr< LevelData< EBFluxFAB > > &a_eta, const RefCountedPtr< LevelData< EBFluxFAB > > &a_lambda, const Real &a_dx, const EBLevelGrid &a_eblg, const FaceIndex &a_face, const DataIndex &a_dit, int a_ivar)
static for code reuse in bcs
IntVect m_ghostCellsPhi
Definition: EBViscousTensorOp.H:634
virtual void axby(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_x, const LevelData< EBCellFAB > &a_y, Real a_a, Real a_b)
LayoutData< CFIVS > m_loCFIVS[CH_SPACEDIM]
Definition: EBViscousTensorOp.H:580
virtual void applyOpNoBoundary(LevelData< EBCellFAB > &a_opPhi, const LevelData< EBCellFAB > &a_phi)
apply operator without any boundary or coarse-fine boundary conditions and no finer level ...
Definition: EBViscousTensorOp.H:205
virtual void setAlphaAndBeta(const Real &a_alpha, const Real &a_beta)
for tga to reset stuff
Definition: EBCellFAB.H:29
virtual void create(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_rhs)
EBLevelGrid m_eblgFine
Definition: EBViscousTensorOp.H:589
double Real
Definition: REAL.H:33
Definition: MultiGrid.H:30
IntVect m_ghostPhi
Definition: EBViscousTensorOp.H:587
EBLevelGrid m_eblg
Definition: EBViscousTensorOp.H:590
virtual void incr(LevelData< EBCellFAB > &a_lhs, const LevelData< EBCellFAB > &a_x, Real a_scale)
LayoutData< TensorFineStencilSet > m_loTanStencilSets[SpaceDim]
Definition: EBViscousTensorOp.H:585
virtual void prolongIncrement(LevelData< EBCellFAB > &a_phiThisLevel, const LevelData< EBCellFAB > &a_correctCoarse)
void getVoFStencil(VoFStencil &a_vofStencil, const VolIndex &a_vof, const DataIndex &a_dit, int a_ivar)
void gsrbColor(LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_lph, const LevelData< EBCellFAB > &a_rhs, const IntVect &a_color)
Real m_beta
Definition: EBViscousTensorOp.H:596
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
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)
RefCountedPtr< ViscousBaseDomainBC > m_domainBC
Definition: EBViscousTensorOp.H:664
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 calculateAlphaWeight()
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.
Real AMRNorm(const LevelData< EBCellFAB > &a_coarResid, const LevelData< EBCellFAB > &a_fineResid, const int &a_refRat, const int &a_ord)
Vector< IntVect > m_colors
Definition: EBViscousTensorOp.H:666
void applyOpIrregular(EBCellFAB &a_lhs, const EBCellFAB &a_phi, const bool &a_homogeneous, const DataIndex &a_datInd)
virtual void diagonalScale(LevelData< EBCellFAB > &a_rhs, bool a_kappaWeighted)
another tgaism
Definition: EBViscousTensorOp.H:150
void defineStencils()
(Re)define the stencils for the given coefficients.
void incrOpRegularDir(EBCellFAB &a_lhs, const EBCellFAB &a_phi, const bool &a_homogeneous, const int &a_dir, const DataIndex &a_datInd)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
Copier m_exchangeCopierGrad
Definition: EBViscousTensorOp.H:668
void homogeneousCFInterp(LevelData< EBCellFAB > &a_phi)
void getKappaDivSigmaU(LevelData< EBCellFAB > &a_divSigmaU, const LevelData< EBCellFAB > &a_velocity, const LevelData< EBCellFAB > *a_veloCoar, int a_level)
compute volfrac(sigma dot grad u) (for energy equation)
Definition: EBViscousTensorOp.H:55
Definition: DataIndex.H:114
IntVect m_ghostRHS
Definition: EBViscousTensorOp.H:587
LayoutData< VoFIterator > m_vofIterIrreg
Definition: EBViscousTensorOp.H:646
virtual Real localMaxNorm(const LevelData< EBCellFAB > &a_rhs)
virtual ~EBViscousTensorOp()
Destructor.
bool m_hasCoar
Definition: EBViscousTensorOp.H:628
void resetACoefficient(RefCountedPtr< LevelData< EBCellFAB > > &a_acoef)
Definition: EBViscousTensorOp.H:99
Piecewise constant interpolation.
Definition: EBMGAverage.H:31
virtual void calculateRelaxationCoefficient()
EBLevelGrid m_eblgCoar
Definition: EBViscousTensorOp.H:591
int m_refToFine
Definition: EBViscousTensorOp.H:629
virtual void relax(LevelData< EBCellFAB > &a_e, const LevelData< EBCellFAB > &a_residual, int a_iterations)
void cellGrad(EBCellFAB &a_gradPhi, const EBCellFAB &a_phi, const Box &a_grid, const DataIndex &a_datInd)
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
virtual void residual(LevelData< EBCellFAB > &a_residual, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_rhs, bool a_homogeneousPhysBC=false)
Definition: FArrayBox.H:45
Definition: AMRTGA.H:159
void AMROperatorNC(LevelData< EBCellFAB > &a_LofPhi, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi, bool a_homogeneousBC, AMRLevelOp< LevelData< EBCellFAB > > *a_finerOp)
RefCountedPtr< ViscousBaseEBBC > m_ebBC
Definition: EBViscousTensorOp.H:665
Volume of Fluid Index.
Definition: VolIndex.H:31
EBLevelGrid m_eblgCoarMG
Definition: EBViscousTensorOp.H:592
LevelData< EBCellFAB > m_zeroCoarse
Definition: EBViscousTensorOp.H:601
virtual int refToCoarser()
virtual void preCond(LevelData< EBCellFAB > &a_opPhi, const LevelData< EBCellFAB > &a_phi)
static bool s_forceNoEBCF
Definition: EBViscousTensorOp.H:576
virtual void fillGrad(const LevelData< EBCellFAB > &a_phi)
a leveltgaism
RefCountedPtr< LevelData< EBFluxFAB > > m_eta
Definition: EBViscousTensorOp.H:608
Copier m_exchangeCopier
Definition: EBViscousTensorOp.H:667
void operator=(const EBViscousTensorOp &a_opin)
Definition: EBViscousTensorOp.H:718
Definition: EBISLayout.H:39
virtual void applyOp(LevelData< EBCellFAB > &a_opPhi, const LevelData< EBCellFAB > &a_phi, bool a_homogeneousPhysBC)
virtual void outputAMR(Vector< LevelData< EBCellFAB > * > &a_rhs, string &a_name)
Definition: EBViscousTensorOp.H:115
void incrementFRFine(EBFastFR &a_fr, const LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phi, AMRLevelOp< LevelData< EBCellFAB > > *a_finerOp)
DataIterator dataIterator() const
Parallel iterator.
Real m_alpha
Definition: EBViscousTensorOp.H:595
LayoutData< VoFIterator > m_vofIterDomHi[CH_SPACEDIM]
Definition: EBViscousTensorOp.H:650
virtual void createCoarser(LevelData< EBCellFAB > &a_coarse, const LevelData< EBCellFAB > &a_fine, bool a_ghosted)
void averageCellToFace(EBFaceFAB &a_fluxData, const EBCellFAB &a_cellData, const Box &a_grid, const EBISBox &a_ebisBox, const ProblemDomain &a_domain, const DataIndex &a_dit, int isrc, int idst, int inco, bool a_interpolateToCentroid)
LevelData< EBCellFAB > m_relCoef
Definition: EBViscousTensorOp.H:641
bool m_hasFine
Definition: EBViscousTensorOp.H:627
static bool s_doLazyRelax
Definition: EBViscousTensorOp.H:578
LayoutData< VoFIterator > m_vofIterDomLo[CH_SPACEDIM]
Definition: EBViscousTensorOp.H:649
LayoutData< RefCountedPtr< EBStencil > > m_opEBStencil[CH_SPACEDIM]
Definition: EBViscousTensorOp.H:638
bool m_hasMGObjects
Definition: EBViscousTensorOp.H:631
virtual void setVal(LevelData< EBCellFAB > &a_lhs, const Real &a_value)