11 #ifndef _VISCOUSTENSOROP_H_ 12 #define _VISCOUSTENSOROP_H_ 27 #include "NamespaceHeader.H" 29 #define VTOP_DEFAULT_SAFETY 0.9 64 for (
int idir = 0; idir <
SpaceDim; idir++)
66 int isrc = 0;
int idst = idir;
int inco = 1;
67 a_rhs[dit()].mult((*
m_acoef)[dit()], isrc, idst, inco);
77 for (
int idir = 0; idir <
SpaceDim; idir++)
79 int isrc = 0;
int idst = idir;
int inco = 1;
80 a_rhs[dit()].divide((*
m_acoef)[dit()], isrc, idst, inco);
113 const Real& a_dxLevel,
114 const Real& a_dxCoar,
117 Real a_relaxTolerance = 0.0,
118 int a_relaxMinIter = 1000
135 const Real& a_dxLevel,
136 const Real& a_dxCoar,
139 Real a_relaxTolerance = 0.0,
140 int a_relaxMinIter = 1000
157 const Real& a_dxLevel,
158 const Real& a_dxCoar,
161 Real a_relaxTolerance = 0.0,
162 int a_relaxMinIter = 1000
168 bool a_homogeneous =
false);
174 bool a_homogeneous =
false);
181 bool a_homogeneous =
false);
186 bool a_homogeneous =
false);
192 const int& a_refRat);
208 for (
int idir = 0; idir <
SpaceDim; idir++)
210 const FArrayBox& etaFace = (*m_eta)[a_dit][idir];
211 const FArrayBox& lambdaFace = (*m_lambda)[a_dit][idir];
213 Box faceBox = a_flux[idir].
box();
215 faceBox &= domFaceBox;
216 getFlux(a_flux[idir], data, gradData, etaFace, lambdaFace, faceBox, idir, 1);
217 a_flux[idir] *= a_scale;
232 const Box& a_facebox,
313 bool a_homogeneousPhysBC,
322 bool a_homogeneousPhysBC,
330 bool a_homogeneousPhysBC);
342 bool a_skip_res =
false );
365 string fname(a_name);
366 fname.append(
".hdf5");
414 bool a_homogeneousDomBC,
420 bool a_homogeneousBC);
425 bool a_homogeneousBC,
454 const Box& a_faceBox,
455 const int& a_faceDir,
463 const Box& a_faceBox,
565 for (
int ivec = 0; ivec <
m_eta.size(); ivec++)
583 const Real& a_dxCoar,
586 Real a_relaxTolerance = 0.0,
587 int a_relaxMinIter = 1000
598 const Real& a_dxCoar,
601 Real a_relaxTolerance = 0.0,
602 int a_relaxMinIter = 1000
613 const Real& a_dxCoar,
616 Real a_relaxTolerance = 0.0,
617 int a_relaxMinIter = 1000
624 bool homoOnly =
true);
678 const int & a_refToDepth);
680 #include "NamespaceFooter.H" int m_ncomp
Definition: ViscousTensorOp.H:510
virtual void create(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
RefCountedPtr< LevelData< FArrayBox > > getACoef() const
Definition: ViscousTensorOp.H:493
ProblemDomain m_domain
Definition: ViscousTensorOp.H:513
Real m_alpha
Definition: ViscousTensorOp.H:503
void reflux(const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, LevelData< FArrayBox > &residual, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
virtual void residual(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs, bool a_homogeneous=false)
Real m_dxCrse
Definition: ViscousTensorOp.H:512
Definition: ViscousTensorOp.H:42
void computeOperatorNoBCs(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi)
utility function which computes operator after all bc's have been set
A reference-counting handle class.
Definition: RefCountedPtr.H:173
LevelData< FArrayBox > m_relaxCoef
Definition: ViscousTensorOp.H:516
void fillGradNoExchange(const LevelData< FArrayBox > &a_phiFine)
optimized version of fillGrad which doesn't call exchange on phi
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
virtual ~ViscousTensorOp()
Definition: ViscousTensorOp.H:88
virtual Real dxCrse() const
Definition: ViscousTensorOp.H:261
ViscousTensorOp()
weak construction is bad
Definition: ViscousTensorOp.H:539
Real m_beta
Definition: ViscousTensorOp.H:504
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
void homogeneousCFInterpTanGrad(LevelData< FArrayBox > &a_tanGrad, const LevelData< FArrayBox > &a_phi, const DataIndex &a_datInd, int a_idir, Side::LoHiSide a_hiorlo)
LayoutData< TensorFineStencilSet > m_hiTanStencilSets[SpaceDim]
Definition: ViscousTensorOp.H:533
virtual void applyOp(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, bool a_homogeneous=false)
virtual void incr(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_x, Real a_scale)
void AMROperatorNF(LevelData< FArrayBox > &a_LofPhi, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_phiCoarse, bool a_homogeneousBC)
virtual void relax(LevelData< FArrayBox > &a_e, const LevelData< FArrayBox > &a_residual, int iterations)
LevelData< FArrayBox > m_grad
Definition: ViscousTensorOp.H:525
one dimensional dynamic array
Definition: Vector.H:53
void coarsenStuff(LevelData< FluxBox > &a_etaCoar, LevelData< FluxBox > &a_lambdaCoar, const LevelData< FluxBox > &a_etaFine, const LevelData< FluxBox > &a_lambdaFine, const int &a_refToDepth)
BCHolder m_bc
Definition: ViscousTensorOp.H:507
Vector< DisjointBoxLayout > m_boxes
Definition: ViscousTensorOp.H:645
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:152
void define(const DisjointBoxLayout &a_grids, const DisjointBoxLayout &a_gridsFine, const DisjointBoxLayout &a_gridsCoar, const RefCountedPtr< LevelData< FluxBox > > &a_eta, const RefCountedPtr< LevelData< FluxBox > > &a_lambda, const RefCountedPtr< LevelData< FArrayBox > > &a_acoef, Real a_alpha, Real a_beta, int a_refToFine, int a_refToCoar, const ProblemDomain &a_domain, const Real &a_dxLevel, const Real &a_dxCoar, BCHolder &a_bc, Real a_safety=VTOP_DEFAULT_SAFETY, Real a_relaxTolerance=0.0, int a_relaxMinIter=1000)
Definition: ViscousTensorOp.H:35
static int s_coefficientAverageType
Definition: ViscousTensorOp.H:636
RefCountedPtr< LevelData< FluxBox > > m_lambda
Definition: ViscousTensorOp.H:501
static void getFluxFromDivAndGrad(FArrayBox &a_flux, const FArrayBox &a_faceDiv, const FArrayBox &a_faceGrad, const FArrayBox &a_etaFace, const FArrayBox &a_lambdaFace, const Box &a_faceBox, int a_dir)
Real getBeta() const
Definition: ViscousTensorOp.H:495
Quadratic coarse-fine interpolation utility for tensors.
Definition: TensorCFInterp.H:36
virtual bool ok() const
return true if this iterator is still in its Layout
Definition: LayoutIterator.H:117
virtual void axby(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_x, const LevelData< FArrayBox > &a_y, Real a, Real b)
Definition: DataIterator.H:190
virtual void getFlux(FluxBox &a_flux, const LevelData< FArrayBox > &a_data, const Box &a_grid, const DataIndex &a_dit, Real a_scale)
Definition: ViscousTensorOp.H:200
void fillGrad(const LevelData< FArrayBox > &a_phiFine)
These functions are part of the LevelTGA interface......
LayoutData< CFIVS > m_loCFIVS[SpaceDim]
Definition: ViscousTensorOp.H:530
LevelDataOps< FArrayBox > m_levelOps
Definition: ViscousTensorOp.H:526
virtual void diagonalScale(LevelData< FArrayBox > &a_rhs, bool a_kappaWeighted)
Definition: ViscousTensorOp.H:46
Real m_beta
Definition: ViscousTensorOp.H:651
BCHolder m_bc
Definition: ViscousTensorOp.H:649
void(* BCFunc)(FArrayBox &a_state, const Box &a_valid, const ProblemDomain &a_domain, Real a_dx, bool a_homogeneous)
Definition: BCFunc.H:30
void divergenceCC(LevelData< FArrayBox > &a_div, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > *a_phiC)
take cell centered divergence of the inputs.
virtual Real dx() const
Definition: ViscousTensorOp.H:256
const int SpaceDim
Definition: SPACE.H:38
Definition: AMRMultiGrid.H:39
virtual void outputLevel(LevelData< FArrayBox > &a_rhs, string &a_name)
Definition: ViscousTensorOp.H:362
virtual void setToZero(LevelData< FArrayBox > &a_x)
virtual void createCoarser(LevelData< FArrayBox > &a_coarse, const LevelData< FArrayBox > &a_fine, bool ghosted)
void operator=(const ViscousTensorOp &a_opin)
Definition: ViscousTensorOp.H:548
Definition: ViscousTensorOp.H:41
static void loHiCenterFace(Box &a_loBox, int &a_hasLo, Box &a_hiBox, int &a_hasHi, Box &a_centerBox, const ProblemDomain &a_eblg, const Box &a_inBox, const int &a_dir)
Vector< RefCountedPtr< LevelData< FArrayBox > > > m_acoef
Definition: ViscousTensorOp.H:642
A FArrayBox-like container for face-centered fluxes.
Definition: FluxBox.H:22
void cellGrad(FArrayBox &a_gradPhi, const FArrayBox &a_phi, const Box &a_grid)
void applyOpNoBoundary(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi)
Definition: ViscousTensorOp.H:220
virtual void AMRResidualNF(LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_phiCoarse, const LevelData< FArrayBox > &a_rhs, bool a_homogeneousPhysBC)
virtual void restrictResidual(LevelData< FArrayBox > &a_resCoarse, LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_rhsFine)
Vector< ProblemDomain > m_domains
Definition: ViscousTensorOp.H:644
#define VTOP_DEFAULT_SAFETY
Definition: ViscousTensorOp.H:29
virtual void diagonalScale(LevelData< FArrayBox > &a_rhs)
Definition: ViscousTensorOp.H:59
Real m_alpha
Definition: ViscousTensorOp.H:650
prolongationType
Definition: ViscousTensorOp.H:39
virtual int refToCoarser()
Definition: ViscousTensorOp.H:302
virtual void divideByIdentityCoef(LevelData< FArrayBox > &a_rhs)
Definition: ViscousTensorOp.H:72
virtual void outputAMR(Vector< LevelData< FArrayBox > * > &a_rhs, string &a_name)
Definition: ViscousTensorOp.H:373
int m_refToCoar
Definition: ViscousTensorOp.H:505
Real m_dx
Definition: ViscousTensorOp.H:511
RefCountedPtr< LevelData< FluxBox > > getLambda() const
Definition: ViscousTensorOp.H:492
double Real
Definition: REAL.H:33
Box surroundingNodes(const Box &b, int dir)
Definition: Box.H:2161
LayoutData< TensorFineStencilSet > m_loTanStencilSets[SpaceDim]
Definition: ViscousTensorOp.H:534
Definition: ViscousTensorOp.H:559
Real m_relaxTolerance
Definition: ViscousTensorOp.H:653
ViscousTensorOp(const ViscousTensorOp &a_opin)
Definition: ViscousTensorOp.H:544
virtual void setAlphaAndBeta(const Real &a_alpha, const Real &a_beta)
Definition: ViscousTensorOp.H:51
static bool s_lazy_gsrb
if true, only do exchange once per GSRB pass, rather than for each color
Definition: ViscousTensorOp.H:487
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
virtual void assign(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
LoHiSide
Definition: LoHiSide.H:27
void interpOnIVSHomo(LevelData< FArrayBox > &a_phif, const DataIndex &a_datInd, const int a_idir, const Side::LoHiSide a_hiorlo, const IntVectSet &a_interpIVS)
Copier m_exchangeCopier
Definition: ViscousTensorOp.H:527
virtual void residualNoExchange(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs, bool a_homogeneous=false)
void homogeneousCFInterpPhi(LevelData< FArrayBox > &a_phif, const DataIndex &a_datInd, int a_idir, Side::LoHiSide a_hiorlo)
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 homogeneousCFInterp(LevelData< FArrayBox > &a_phif)
virtual void AMRResidualNC(LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs, bool a_homogeneousPhysBC, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
void cfinterp(const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phiCoarse)
virtual void AMRRestrict(LevelData< FArrayBox > &a_resCoarse, const LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection, bool a_skip_res=false)
virtual void applyOpNoExchange(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, bool a_homogeneous=false)
RefCountedPtr< LevelData< FluxBox > > getEta() const
access function
Definition: ViscousTensorOp.H:491
LayoutData< CFIVS > m_hiCFIVS[SpaceDim]
Definition: ViscousTensorOp.H:531
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
int m_relaxMinIter
Definition: ViscousTensorOp.H:654
Vector< Real > m_dx
Definition: ViscousTensorOp.H:646
int m_relaxMinIter
Definition: ViscousTensorOp.H:523
void operator=(const ViscousTensorOpFactory &a_opin)
Definition: ViscousTensorOp.H:667
Definition: DataIndex.H:114
Vector< RefCountedPtr< LevelData< FluxBox > > > m_eta
Definition: ViscousTensorOp.H:640
const DisjointBoxLayout & disjointBoxLayout() const
Definition: LevelData.H:225
virtual void createCoarsened(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs, const int &a_refRat)
virtual void AMRProlong(LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection)
const Box & box() const
Returns cell-centered box which defines fluxBox.
Definition: FArrayBox.H:45
virtual void preCond(LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_residual)
ViscousTensorOpFactory()
weak construction is bad
Definition: ViscousTensorOp.H:657
void AMROperator(LevelData< FArrayBox > &a_LofPhi, const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_phiCoarse, bool a_homogeneousDomBC, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
virtual void AMRResidual(LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_phiCoarse, const LevelData< FArrayBox > &a_rhs, bool a_homogeneousPhysBC, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
Real m_safety
Definition: ViscousTensorOp.H:519
RefCountedPtr< LevelData< FluxBox > > m_eta
Definition: ViscousTensorOp.H:500
virtual Real norm(const LevelData< FArrayBox > &a_x, int a_ord)
Real m_relaxTolerance
Definition: ViscousTensorOp.H:521
Vector< int > m_refRatios
Definition: ViscousTensorOp.H:648
Real m_safety
Definition: ViscousTensorOp.H:652
virtual void prolongIncrement(LevelData< FArrayBox > &a_phiThisLevel, const LevelData< FArrayBox > &a_correctCoarse)
void writeLevelname(const LevelData< FArrayBox > *a_dataPtr, const char *a_filename)
void define(const Box &bx, int n=1)
Resize FluxBox similar to BaseFab::resize()
static int s_prolongType
prolongation type
Definition: ViscousTensorOp.H:480
Real getAlpha() const
Definition: ViscousTensorOp.H:494
const Box & domainBox() const
Returns the logical computational domain.
Definition: ProblemDomain.H:887
virtual Real AMRNorm(const LevelData< FArrayBox > &a_coarseResid, const LevelData< FArrayBox > &a_fineResid, const int &a_refRat, const int &a_ord)
Definition: AMRMultiGrid.H:233
DataIterator dataIterator() const
Parallel iterator.
virtual void scale(LevelData< FArrayBox > &a_lhs, const Real &a_scale)
virtual ~ViscousTensorOpFactory()
Definition: ViscousTensorOp.H:562
virtual Real dotProduct(const LevelData< FArrayBox > &a_1, const LevelData< FArrayBox > &a_2)
Vector< IntVect > m_colors
Definition: ViscousTensorOp.H:535
LevelData< FArrayBox > m_phic
Definition: ViscousTensorOp.H:643
virtual void AMRUpdateResidual(LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection)
virtual void AMROperatorNC(LevelData< FArrayBox > &a_LofPhi, const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, bool a_homogeneousBC, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
TensorCFInterp m_interpWithCoarser
Definition: ViscousTensorOp.H:528
static void getFaceDivAndGrad(FArrayBox &a_faceDiv, FArrayBox &a_faceGrad, const FArrayBox &a_data, const FArrayBox &a_gradData, const ProblemDomain &a_domain, const Box &a_faceBox, const int &a_faceDir, const Real a_dx)
int m_refToFine
Definition: ViscousTensorOp.H:506
ViscousTensorOpFactory(const ViscousTensorOpFactory &a_opin)
Definition: ViscousTensorOp.H:662
Vector< RefCountedPtr< LevelData< FluxBox > > > m_lambda
Definition: ViscousTensorOp.H:641
Definition: ViscousTensorOp.H:43
RefCountedPtr< LevelData< FArrayBox > > m_acoef
Definition: ViscousTensorOp.H:502