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);
175 bool a_homogeneous =
false);
180 const int& a_refRat);
196 for (
int idir = 0; idir <
SpaceDim; idir++)
198 const FArrayBox& etaFace = (*m_eta)[a_dit][idir];
199 const FArrayBox& lambdaFace = (*m_lambda)[a_dit][idir];
201 Box faceBox = a_flux[idir].
box();
203 faceBox &= domFaceBox;
204 getFlux(a_flux[idir], data, gradData, etaFace, lambdaFace, faceBox, idir, 1);
205 a_flux[idir] *= a_scale;
220 const Box& a_facebox,
302 bool a_homogeneousPhysBC,
311 bool a_homogeneousPhysBC,
319 bool a_homogeneousPhysBC);
353 string fname(a_name);
354 fname.append(
".hdf5");
403 bool a_homogeneousDomBC,
409 bool a_homogeneousBC);
414 bool a_homogeneousBC,
440 const Box& a_faceBox,
441 const int& a_faceDir,
449 const Box& a_faceBox,
536 for (
int ivec = 0; ivec <
m_eta.size(); ivec++)
554 const Real& a_dxCoar,
557 Real a_relaxTolerance = 0.0,
558 int a_relaxMinIter = 1000
569 const Real& a_dxCoar,
572 Real a_relaxTolerance = 0.0,
573 int a_relaxMinIter = 1000
585 const Real& a_dxCoar,
588 Real a_relaxTolerance = 0.0,
589 int a_relaxMinIter = 1000
596 bool homoOnly =
true);
650 const int & a_refToDepth);
652 #include "NamespaceFooter.H" int m_ncomp
Definition: ViscousTensorOp.H:483
virtual void create(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
ProblemDomain m_domain
Definition: ViscousTensorOp.H:486
Real m_alpha
Definition: ViscousTensorOp.H:476
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:485
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:66
LevelData< FArrayBox > m_relaxCoef
Definition: ViscousTensorOp.H:488
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
virtual ~ViscousTensorOp()
Definition: ViscousTensorOp.H:88
virtual Real dxCrse() const
Definition: ViscousTensorOp.H:250
ViscousTensorOp()
weak construction is bad
Definition: ViscousTensorOp.H:510
Real m_beta
Definition: ViscousTensorOp.H:477
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
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:504
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:496
one dimensional dynamic array
Definition: Vector.H:52
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:480
Vector< DisjointBoxLayout > m_boxes
Definition: ViscousTensorOp.H:617
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:137
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:608
RefCountedPtr< LevelData< FluxBox > > m_lambda
Definition: ViscousTensorOp.H:474
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)
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:110
virtual void axby(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_x, const LevelData< FArrayBox > &a_y, Real a, Real b)
Definition: DataIterator.H:140
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:188
void fillGrad(const LevelData< FArrayBox > &a_phiFine)
These functions are part of the LevelTGA interface......
LayoutData< CFIVS > m_loCFIVS[SpaceDim]
Definition: ViscousTensorOp.H:501
LevelDataOps< FArrayBox > m_levelOps
Definition: ViscousTensorOp.H:497
virtual void diagonalScale(LevelData< FArrayBox > &a_rhs, bool a_kappaWeighted)
Definition: ViscousTensorOp.H:46
Real m_beta
Definition: ViscousTensorOp.H:623
BCHolder m_bc
Definition: ViscousTensorOp.H:621
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:245
const int SpaceDim
Definition: SPACE.H:39
Definition: AMRMultiGrid.H:35
virtual void outputLevel(LevelData< FArrayBox > &a_rhs, string &a_name)
Definition: ViscousTensorOp.H:350
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:519
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:614
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:208
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:616
#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:622
prolongationType
Definition: ViscousTensorOp.H:39
virtual int refToCoarser()
Definition: ViscousTensorOp.H:291
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:361
int m_refToCoar
Definition: ViscousTensorOp.H:478
Real m_dx
Definition: ViscousTensorOp.H:484
double Real
Definition: REAL.H:33
Box surroundingNodes(const Box &b, int dir)
Definition: Box.H:2166
LayoutData< TensorFineStencilSet > m_loTanStencilSets[SpaceDim]
Definition: ViscousTensorOp.H:505
Definition: ViscousTensorOp.H:530
Real m_relaxTolerance
Definition: ViscousTensorOp.H:625
ViscousTensorOp(const ViscousTensorOp &a_opin)
Definition: ViscousTensorOp.H:515
virtual void setAlphaAndBeta(const Real &a_alpha, const Real &a_beta)
Definition: ViscousTensorOp.H:51
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
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:498
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)
virtual void AMRRestrict(LevelData< FArrayBox > &a_resCoarse, const LevelData< FArrayBox > &a_residual, const LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection)
void cfinterp(const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phiCoarse)
LayoutData< CFIVS > m_hiCFIVS[SpaceDim]
Definition: ViscousTensorOp.H:502
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
int m_relaxMinIter
Definition: ViscousTensorOp.H:626
Vector< Real > m_dx
Definition: ViscousTensorOp.H:618
int m_relaxMinIter
Definition: ViscousTensorOp.H:494
void operator=(const ViscousTensorOpFactory &a_opin)
Definition: ViscousTensorOp.H:639
Definition: DataIndex.H:112
Vector< RefCountedPtr< LevelData< FluxBox > > > m_eta
Definition: ViscousTensorOp.H:612
const DisjointBoxLayout & disjointBoxLayout() const
Definition: LevelData.H:196
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:44
virtual void preCond(LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_residual)
ViscousTensorOpFactory()
weak construction is bad
Definition: ViscousTensorOp.H:629
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:490
RefCountedPtr< LevelData< FluxBox > > m_eta
Definition: ViscousTensorOp.H:473
virtual Real norm(const LevelData< FArrayBox > &a_x, int a_ord)
Real m_relaxTolerance
Definition: ViscousTensorOp.H:492
Vector< int > m_refRatios
Definition: ViscousTensorOp.H:620
Real m_safety
Definition: ViscousTensorOp.H:624
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)
Define function.
static int s_prolongType
prolongation type
Definition: ViscousTensorOp.H:467
const Box & domainBox() const
Returns the logical computational domain.
Definition: ProblemDomain.H:868
virtual Real AMRNorm(const LevelData< FArrayBox > &a_coarseResid, const LevelData< FArrayBox > &a_fineResid, const int &a_refRat, const int &a_ord)
Definition: AMRMultiGrid.H:231
DataIterator dataIterator() const
Parallel iterator.
virtual void scale(LevelData< FArrayBox > &a_lhs, const Real &a_scale)
virtual ~ViscousTensorOpFactory()
Definition: ViscousTensorOp.H:533
virtual Real dotProduct(const LevelData< FArrayBox > &a_1, const LevelData< FArrayBox > &a_2)
Vector< IntVect > m_colors
Definition: ViscousTensorOp.H:506
LevelData< FArrayBox > m_phic
Definition: ViscousTensorOp.H:615
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:499
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:479
ViscousTensorOpFactory(const ViscousTensorOpFactory &a_opin)
Definition: ViscousTensorOp.H:634
Vector< RefCountedPtr< LevelData< FluxBox > > > m_lambda
Definition: ViscousTensorOp.H:613
Definition: ViscousTensorOp.H:43
RefCountedPtr< LevelData< FArrayBox > > m_acoef
Definition: ViscousTensorOp.H:475