Chombo + EB  3.0
CoarseAverageFace.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 _COARSEAVERAGEFACE_H_
12 #define _COARSEAVERAGEFACE_H_
13 
14 #include "REAL.H"
15 #include "FluxBox.H"
16 #include "LevelData.H"
17 #include "NamespaceHeader.H"
18 
19 
20 /// replaces face-centered coarse-level data w/ averaged fine-level data
21 /** This class replaces face-centered data on a coarse level of refinement
22  with the average of the finer-level data which overlays the face.
23  This class is similar to CoarseAverage */
25 {
26 public:
27  ///
29  {
33  };
34 
35  /// Default constructor
37 
38  /// defining constructor
39  CoarseAverageFace(const DisjointBoxLayout& a_fineGrids,
40  int a_nComp, int a_nRef);
41 
42  /// destructor
44 
45  /// defines the object
46  void define(const DisjointBoxLayout& a_fineGrids,
47  int a_nComp, int a_nRef);
48 
49  ///
50  bool isDefined() const;
51 
52  /// averages fine-level data to internal coarse representation of fine grid
53  void average(const LevelData<FluxBox>& a_fineData);
54 
55  /// harmonic averaging of fine-level data to internal coarse representation of
56  /// fine grid
57  void averageHarmonic(const LevelData<FluxBox>& a_fineData);
58 
59  /// sums fine-level data to internal coarse representation of fine grid
60  void sum(const LevelData<FluxBox>& a_fineData,
61  const int a_refFactor = 1);
62 
63  /// obtain averaged results by copying to the destination
64  void copyTo(LevelData<FluxBox>& a_coarseData);
65 
66  /// averages fine-level data to coarse level
67  void averageToCoarse(LevelData<FluxBox>& a_coarse_data,
68  const LevelData<FluxBox>& a_fine_data);
69 
70  /// averages fine-level data to coarse level using harmonic averaging
71  void averageToCoarseHarmonic(LevelData<FluxBox>& a_coarse_data,
72  const LevelData<FluxBox>& a_fine_data);
73 
74 protected:
75 
76 
79  int m_nRef;
80 
81  // work array for coarsening of fine data, same "shape" as fine data
83 
84  /// utility function to completely determine averages.
85  void computeAverages(LevelData<FluxBox>& a_coarse_data,
86  const LevelData<FluxBox>& a_fine_data,
87  int a_averageType);
88 
89  /// utility for averaging fine-level data to internal coarse representation of
90  /// fine grid
91  void average(const LevelData<FluxBox>& a_fineData,
92  const int a_averageType,
93  const int a_refFactor);
94 
95  /// averages entire single grid data from fine->crse
96  void averageGridData(FluxBox& a_coarsenedFine,
97  const FluxBox& a_fine,
98  int a_averageType,
99  const int a_refFactor) const;
100 
101 };
102 
103 #include "NamespaceFooter.H"
104 #endif
105 
106 
107 
108 
void averageToCoarse(LevelData< FluxBox > &a_coarse_data, const LevelData< FluxBox > &a_fine_data)
averages fine-level data to coarse level
CoarseAverageFace()
Default constructor.
Definition: CoarseAverageFace.H:32
Definition: CoarseAverageFace.H:31
void average(const LevelData< FluxBox > &a_fineData)
averages fine-level data to internal coarse representation of fine grid
bool m_isDefined
Definition: CoarseAverageFace.H:77
void sum(const LevelData< FluxBox > &a_fineData, const int a_refFactor=1)
sums fine-level data to internal coarse representation of fine grid
averageType
Definition: CoarseAverageFace.H:28
A FArrayBox-like container for face-centered fluxes.
Definition: FluxBox.H:22
int m_nRef
Definition: CoarseAverageFace.H:79
void define(const DisjointBoxLayout &a_fineGrids, int a_nComp, int a_nRef)
defines the object
void copyTo(LevelData< FluxBox > &a_coarseData)
obtain averaged results by copying to the destination
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:31
replaces face-centered coarse-level data w/ averaged fine-level data
Definition: CoarseAverageFace.H:24
void computeAverages(LevelData< FluxBox > &a_coarse_data, const LevelData< FluxBox > &a_fine_data, int a_averageType)
utility function to completely determine averages.
~CoarseAverageFace()
destructor
void averageGridData(FluxBox &a_coarsenedFine, const FluxBox &a_fine, int a_averageType, const int a_refFactor) const
averages entire single grid data from fine->crse
Definition: CoarseAverageFace.H:30
bool m_isAveraged
Definition: CoarseAverageFace.H:78
void averageToCoarseHarmonic(LevelData< FluxBox > &a_coarse_data, const LevelData< FluxBox > &a_fine_data)
averages fine-level data to coarse level using harmonic averaging
void averageHarmonic(const LevelData< FluxBox > &a_fineData)
LevelData< FluxBox > m_coarsenedFineData
Definition: CoarseAverageFace.H:82
bool isDefined() const