11 #ifndef _NWOVISCOUSTENSOROP_H_ 12 #define _NWOVISCOUSTENSOROP_H_ 28 #include "NamespaceHeader.H" 30 #define VTOP_DEFAULT_SAFETY 0.9 65 for (
int idir = 0; idir <
SpaceDim; idir++)
67 int isrc = 0;
int idst = idir;
int inco = 1;
68 a_rhs[dit()].mult((*
m_acoef)[dit()], isrc, idst, inco);
78 for (
int idir = 0; idir <
SpaceDim; idir++)
80 int isrc = 0;
int idst = idir;
int inco = 1;
81 a_rhs[dit()].divide((*
m_acoef)[dit()], isrc, idst, inco);
107 const Real& a_dxLevel,
108 const Real& a_dxCoar,
111 Real a_relaxTolerance = 0.0,
112 int a_relaxMinIter = 1000
129 const Real& a_dxLevel,
130 const Real& a_dxCoar,
133 Real a_relaxTolerance = 0.0,
134 int a_relaxMinIter = 1000
164 const Box& a_faceBox,
165 const int& a_faceDir,
181 const Real& a_dxLevel,
182 const Real& a_dxCoar,
185 Real a_relaxTolerance = 0.0,
186 int a_relaxMinIter = 1000
192 bool a_homogeneous =
false);
199 bool a_homogeneous =
false);
204 const int& a_refRat);
220 for (
int idir = 0; idir <
SpaceDim; idir++)
222 const FArrayBox& etaFace = (*m_eta)[a_dit][idir];
223 const FArrayBox& lambdaFace = (*m_lambda)[a_dit][idir];
224 Box faceBox = a_flux[idir].
box();
226 faceBox &= domFaceBox;
227 getFlux(a_flux[idir], data, etaFace, lambdaFace, faceBox, idir, 1);
228 a_flux[idir] *= a_scale;
241 const Box& a_facebox,
250 const Box& a_faceBox,
334 bool a_homogeneousPhysBC,
343 bool a_homogeneousPhysBC,
351 bool a_homogeneousPhysBC);
363 bool a_skip_res =
false );
386 string fname(a_name);
387 fname.append(
".hdf5");
435 bool a_homogeneousDomBC,
441 bool a_homogeneousBC);
446 bool a_homogeneousBC,
531 for (
int ivec = 0; ivec <
m_eta.size(); ivec++)
549 const Real& a_dxCoar,
552 Real a_relaxTolerance = 0.0,
553 int a_relaxMinIter = 1000
564 const Real& a_dxCoar,
567 Real a_relaxTolerance = 0.0,
568 int a_relaxMinIter = 1000
579 const Real& a_dxCoar,
582 Real a_relaxTolerance = 0.0,
583 int a_relaxMinIter = 1000
590 bool homoOnly =
true);
644 const int & a_refToDepth);
646 #include "NamespaceFooter.H" virtual void scale(LevelData< FArrayBox > &a_lhs, const Real &a_scale)
void fillGrad(const LevelData< FArrayBox > &a_phiFine)
Definition: NWOViscousTensorOp.H:143
NWOQuadCFInterp m_interpWithCoarser
Definition: NWOViscousTensorOp.H:497
virtual Real dxCrse() const
Definition: NWOViscousTensorOp.H:282
prolongationType
Definition: NWOViscousTensorOp.H:40
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)
RefCountedPtr< LevelData< FluxBox > > m_eta
Definition: NWOViscousTensorOp.H:468
static int s_prolongType
prolongation type
Definition: NWOViscousTensorOp.H:456
Vector< DisjointBoxLayout > m_boxes
Definition: NWOViscousTensorOp.H:611
virtual void assign(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
BCHolder m_bc
Definition: NWOViscousTensorOp.H:615
A reference-counting handle class.
Definition: RefCountedPtr.H:173
Real m_safety
Definition: NWOViscousTensorOp.H:489
DisjointBoxLayout m_gridsCoar
Definition: NWOViscousTensorOp.H:477
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
Vector< RefCountedPtr< LevelData< FArrayBox > > > m_acoef
Definition: NWOViscousTensorOp.H:608
virtual void createCoarsened(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs, const int &a_refRat)
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
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)
void cfinterp(const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phiCoarse)
virtual void outputAMR(Vector< LevelData< FArrayBox > * > &a_rhs, string &a_name)
Definition: NWOViscousTensorOp.H:394
Real m_dxCrse
Definition: NWOViscousTensorOp.H:482
DisjointBoxLayout m_grids
Definition: NWOViscousTensorOp.H:477
#define VTOP_DEFAULT_SAFETY
Definition: NWOViscousTensorOp.H:30
DisjointBoxLayout m_gridsFine
Definition: NWOViscousTensorOp.H:477
one dimensional dynamic array
Definition: Vector.H:53
Vector< IntVect > m_colors
Definition: NWOViscousTensorOp.H:501
int m_refToFine
Definition: NWOViscousTensorOp.H:474
virtual void prolongIncrement(LevelData< FArrayBox > &a_phiThisLevel, const LevelData< FArrayBox > &a_correctCoarse)
void homogeneousCFInterpTanGrad(LevelData< FArrayBox > &a_tanGrad, const LevelData< FArrayBox > &a_phi, const DataIndex &a_datInd, int a_idir, Side::LoHiSide a_hiorlo)
Definition: NWOViscousTensorOp.H:42
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:145
RefCountedPtr< LevelData< FluxBox > > m_lambda
Definition: NWOViscousTensorOp.H:469
void homogeneousCFInterp(LevelData< FArrayBox > &a_phif)
void homogeneousCFInterpPhi(LevelData< FArrayBox > &a_phif, const DataIndex &a_datInd, int a_idir, Side::LoHiSide a_hiorlo)
Real m_alpha
Definition: NWOViscousTensorOp.H:616
NWOViscousTensorOp(const NWOViscousTensorOp &a_opin)
Definition: NWOViscousTensorOp.H:510
virtual void residual(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs, bool a_homogeneous=false)
Real m_relaxTolerance
Definition: NWOViscousTensorOp.H:491
Copier m_exchangeCopier
Definition: NWOViscousTensorOp.H:496
Definition: NWOViscousTensorOp.H:44
int m_refToCoar
Definition: NWOViscousTensorOp.H:473
NWOViscousTensorOpFactory(const NWOViscousTensorOpFactory &a_opin)
Definition: NWOViscousTensorOp.H:628
virtual void restrictResidual(LevelData< FArrayBox > &a_resCoarse, LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_rhsFine)
void NWOcoarsenStuff(LevelData< FluxBox > &a_etaCoar, LevelData< FluxBox > &a_lambdaCoar, const LevelData< FluxBox > &a_etaFine, const LevelData< FluxBox > &a_lambdaFine, const int &a_refToDepth)
virtual bool ok() const
return true if this iterator is still in its Layout
Definition: LayoutIterator.H:117
LevelDataOps< FArrayBox > m_levelOps
Definition: NWOViscousTensorOp.H:495
void interpOnIVSHomo(LevelData< FArrayBox > &a_phif, const DataIndex &a_datInd, const int a_idir, const Side::LoHiSide a_hiorlo, const IntVectSet &a_interpIVS)
virtual void getFlux(FluxBox &a_flux, const LevelData< FArrayBox > &a_data, const Box &a_grid, const DataIndex &a_dit, Real a_scale)
Definition: NWOViscousTensorOp.H:212
virtual void incr(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_x, Real a_scale)
Definition: DataIterator.H:190
Fourth-order interpolation in time and space to ghost cells.
Definition: NWOQuadCFInterp.H:26
LevelData< FArrayBox > m_relaxCoef
Definition: NWOViscousTensorOp.H:486
RefCountedPtr< LevelData< FArrayBox > > getACoef() const
Definition: NWOViscousTensorOp.H:462
virtual Real dx() const
Definition: NWOViscousTensorOp.H:277
void(* BCFunc)(FArrayBox &a_state, const Box &a_valid, const ProblemDomain &a_domain, Real a_dx, bool a_homogeneous)
Definition: BCFunc.H:30
virtual void applyOp(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, bool a_homogeneous=false)
void cellGrad(FArrayBox &a_gradPhi, const FArrayBox &a_phi, const Box &a_grid)
virtual ~NWOViscousTensorOpFactory()
Definition: NWOViscousTensorOp.H:528
int m_relaxMinIter
Definition: NWOViscousTensorOp.H:493
const int SpaceDim
Definition: SPACE.H:38
BCHolder m_bc
Definition: NWOViscousTensorOp.H:475
virtual void AMRProlong(LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_coarseCorrection)
Definition: AMRMultiGrid.H:39
Real getAlpha() const
Definition: NWOViscousTensorOp.H:463
virtual void setAlphaAndBeta(const Real &a_alpha, const Real &a_beta)
Definition: NWOViscousTensorOp.H:52
void computeOperatorNoBCs(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi)
utility function which computes operator after all bc's have been set
A FArrayBox-like container for face-centered fluxes.
Definition: FluxBox.H:22
RefCountedPtr< LevelData< FArrayBox > > m_acoef
Definition: NWOViscousTensorOp.H:470
virtual ~NWOViscousTensorOp()
Definition: NWOViscousTensorOp.H:89
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 createCoarser(LevelData< FArrayBox > &a_coarse, const LevelData< FArrayBox > &a_fine, bool ghosted)
Real m_beta
Definition: NWOViscousTensorOp.H:472
virtual int refToCoarser()
Definition: NWOViscousTensorOp.H:323
virtual void relax(LevelData< FArrayBox > &a_e, const LevelData< FArrayBox > &a_residual, int iterations)
virtual void divideByIdentityCoef(LevelData< FArrayBox > &a_rhs)
Definition: NWOViscousTensorOp.H:73
virtual Real dotProduct(const LevelData< FArrayBox > &a_1, const LevelData< FArrayBox > &a_2)
void reflux(const LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_phi, LevelData< FArrayBox > &residual, AMRLevelOp< LevelData< FArrayBox > > *a_finerOp)
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)
double Real
Definition: REAL.H:33
Box surroundingNodes(const Box &b, int dir)
Definition: Box.H:2145
virtual Real AMRNorm(const LevelData< FArrayBox > &a_coarseResid, const LevelData< FArrayBox > &a_fineResid, const int &a_refRat, const int &a_ord)
void operator=(const NWOViscousTensorOpFactory &a_opin)
Definition: NWOViscousTensorOp.H:633
Definition: NWOViscousTensorOp.H:525
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
void AMROperatorNF(LevelData< FArrayBox > &a_LofPhi, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_phiCoarse, bool a_homogeneousBC)
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)
LoHiSide
Definition: LoHiSide.H:27
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)
NWOViscousTensorOpFactory()
weak construction is bad
Definition: NWOViscousTensorOp.H:623
Real getBeta() const
Definition: NWOViscousTensorOp.H:464
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.
Vector< RefCountedPtr< LevelData< FluxBox > > > m_eta
Definition: NWOViscousTensorOp.H:606
int m_relaxMinIter
Definition: NWOViscousTensorOp.H:620
Real m_alpha
Definition: NWOViscousTensorOp.H:471
static int s_coefficientAverageType
Definition: NWOViscousTensorOp.H:602
Real m_beta
Definition: NWOViscousTensorOp.H:617
NWOViscousTensorOp()
weak construction is bad
Definition: NWOViscousTensorOp.H:505
virtual void preCond(LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_residual)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
virtual void diagonalScale(LevelData< FArrayBox > &a_rhs)
Definition: NWOViscousTensorOp.H:60
Definition: DataIndex.H:112
virtual void setToZero(LevelData< FArrayBox > &a_x)
const DisjointBoxLayout & disjointBoxLayout() const
Definition: LevelData.H:225
LevelData< FArrayBox > m_phic
Definition: NWOViscousTensorOp.H:609
Real m_safety
Definition: NWOViscousTensorOp.H:618
virtual void create(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
RefCountedPtr< LevelData< FluxBox > > getEta() const
access function
Definition: NWOViscousTensorOp.H:460
Vector< ProblemDomain > m_domains
Definition: NWOViscousTensorOp.H:610
void applyOpNoBoundary(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi)
Definition: NWOViscousTensorOp.H:231
const Box & box() const
Returns cell-centered box which defines fluxBox.
virtual Real norm(const LevelData< FArrayBox > &a_x, int a_ord)
Definition: FArrayBox.H:45
Vector< Real > m_dx
Definition: NWOViscousTensorOp.H:612
Real m_relaxTolerance
Definition: NWOViscousTensorOp.H:619
virtual void outputLevel(LevelData< FArrayBox > &a_rhs, string &a_name)
Definition: NWOViscousTensorOp.H:383
Definition: NWOViscousTensorOp.H:36
Definition: NWOViscousTensorOp.H:43
Real m_dx
Definition: NWOViscousTensorOp.H:481
int m_ncomp
Definition: NWOViscousTensorOp.H:480
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 diagonalScale(LevelData< FArrayBox > &a_rhs, bool a_kappaWeighted)
Definition: NWOViscousTensorOp.H:47
ProblemDomain m_domain
Definition: NWOViscousTensorOp.H:483
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)
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()
const Box & domainBox() const
Returns the logical computational domain.
Definition: ProblemDomain.H:887
void operator=(const NWOViscousTensorOp &a_opin)
Definition: NWOViscousTensorOp.H:514
virtual void axby(LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_x, const LevelData< FArrayBox > &a_y, Real a, Real b)
Definition: AMRMultiGrid.H:233
DataIterator dataIterator() const
Parallel iterator.
RefCountedPtr< LevelData< FluxBox > > getLambda() const
Definition: NWOViscousTensorOp.H:461
Vector< RefCountedPtr< LevelData< FluxBox > > > m_lambda
Definition: NWOViscousTensorOp.H:607
Vector< int > m_refRatios
Definition: NWOViscousTensorOp.H:614
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)