Chombo + EB + MF  3.2
SingleLevelGradient.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 // SingleLevelGradient.H
12 
13 #ifndef _SINGLELEVELGRADIENT_H_
14 #define _SINGLELEVELGRADIENT_H_
15 
16 #include "LevelData.H"
17 #include "FArrayBox.H"
18 #include "FluxBox.H"
19 
20 #include "NamespaceHeader.H"
21 
22 
23 /// Class to encapsulate Gradient functions (both CC and face-centered)
24 /** (DFM-10/17/08) -- note that this version has been gutted to only have
25  the most basic single-level Gradient because AMRTools doesn't compile
26  in 4D yet */
28 {
29 
30 public:
31 
32  /// computes cell-centered, level-operator gradient of cell-centered phi
33  /** in this case, assume that all relevant
34  BC's (coarse-fine and physical) have already been set, so
35  phi can be a const variable */
36  static void levelGradientCC(
37  ///
38  LevelData<FArrayBox>& a_grad,
39  ///
40  const LevelData<FArrayBox>& a_phi,
41  ///
42  const Real a_dx);
43 
44 
45  /// computes cell-centered composite gradient of cell-centered phi
46  /**
47  this one assumes that all ghost-cell values have already been set;
48  if phiFinePtr != NULL, then also uses one-sided differencing to compute
49  gradient on coarse side of corarse-fine interface. note that gradient
50  is only really defined in valid regions of grids. */
51  static void compGradientCC(
52  ///
53  LevelData<FArrayBox>& a_Grad,
54  ///
55  const LevelData<FArrayBox>& a_phi,
56  ///
57  const LevelData<FArrayBox>* a_phiFinePtr,
58  ///
59  const Real a_dx,
60  ///
61  const int a_nRefFine,
62  ///
63  const ProblemDomain& a_dProblem);
64 
65  /// computes edge-centered level-operator gradient of cell-centered phi
66  /**
67  assumes _ALL_ ghost cell values have been preset (so phi can be const)
68  */
69  static void levelGradientMAC(
70  ///
71  LevelData<FluxBox>& a_edgeGrad,
72  ///
73  const LevelData<FArrayBox>& a_phi,
74  ///
75  const Real a_dx);
76 
77 
78 #ifdef NEW_GRADIENT
79  /// utility function for internal use
80  static void singleBoxMacGrad(FArrayBox& a_gradFab,
81  const FArrayBox& a_phiFab,
82  int a_gradComp,
83  int a_phiComp,
84  int a_numComp,
85  const Box& a_edgeBox,
86  Real a_dx,
87  int a_dir,
88  int a_edgeDir,
89  const IntVectSet& a_gridIVS);
90 
91 
92 
93  /// create grid IVS for all grids
94  /** creates an IVS representation of the DisjointBoxLayout
95  in the neighborhood around each box in the DBL.
96  */
97  static void createGridIVS(LayoutData<IntVectSet>& a_gridsIVS,
98  const DisjointBoxLayout& a_grids,
99  const int a_nGrow);
100 
101 
102  /// internal utility function
103  /** creates IVS representation of the DisjointBoxLayout
104  in the neighborhood of localBox
105  */
106  static void createGridIVS(IntVectSet& a_gridIVS,
107  const DisjointBoxLayout& a_grids,
108  const Box& a_localBox,
109  const int a_nGrow = 1);
110 
111 #endif
112 
113 };
114 
115 #include "NamespaceFooter.H"
116 
117 #endif
118 
119 
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
static void levelGradientMAC(LevelData< FluxBox > &a_edgeGrad, const LevelData< FArrayBox > &a_phi, const Real a_dx)
computes edge-centered level-operator gradient of cell-centered phi
double Real
Definition: REAL.H:33
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
static void levelGradientCC(LevelData< FArrayBox > &a_grad, const LevelData< FArrayBox > &a_phi, const Real a_dx)
computes cell-centered, level-operator gradient of cell-centered phi
static void compGradientCC(LevelData< FArrayBox > &a_Grad, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > *a_phiFinePtr, const Real a_dx, const int a_nRefFine, const ProblemDomain &a_dProblem)
computes cell-centered composite gradient of cell-centered phi
Definition: FArrayBox.H:45
Class to encapsulate Gradient functions (both CC and face-centered)
Definition: SingleLevelGradient.H:27