Chombo + EB  3.2
EBAMRDataOps.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 _EBAMRDATAOPS_H_
12 #define _EBAMRDATAOPS_H_
13 
14 #include "EBLevelDataOps.H"
15 #include "FaceIterator.H"
16 #include "EBFluxFAB.H"
17 #include "EBCoarseAverage.H"
18 #include "EBCoarsen.H"
19 #include "EBQuadCFInterp.H"
20 #include "EBPWLFillPatch.H"
21 #include "EBIndexSpace.H"
22 #include "EBAMRIO.H"
23 #include "EBLevelGrid.H"
24 #include "NamespaceHeader.H"
25 
26 #define EBAMRDATAOPS_INTERIORREGVOFS 0x1
27 #define EBAMRDATAOPS_BOUNDARYREGVOFS 0x2
28 #define EBAMRDATAOPS_INTERIORIRREGVOFS 0x4
29 #define EBAMRDATAOPS_BOUNDARYIRREGVOFS 0x8
30 
31 #define EBAMRDATAOPS_ALLVOFS (EBAMRDATAOPS_INTERIORREGVOFS | \
32  EBAMRDATAOPS_BOUNDARYREGVOFS | \
33  EBAMRDATAOPS_INTERIORIRREGVOFS | \
34  EBAMRDATAOPS_BOUNDARYIRREGVOFS )
35 
36 #define EBAMRDATAOPS_REGULARVOFS (EBAMRDATAOPS_INTERIORREGVOFS | \
37  EBAMRDATAOPS_BOUNDARYREGVOFS )
38 
39 #define EBAMRDATAOPS_IRREGULARVOFS (EBAMRDATAOPS_INTERIORIRREGVOFS | \
40  EBAMRDATAOPS_BOUNDARYIRREGVOFS )
41 
42 #define EBAMRDATAOPS_BOUNDARYVOFS (EBAMRDATAOPS_BOUNDARYREGVOFS | \
43  EBAMRDATAOPS_IRREGULARVOFS )
44 ///
45 /**
46  Repository of functions for EB Hierarchies.
47  */
49 {
50 public:
52  {
53  }
54 
55  ///
56  /**
57  If you want averaging to be sum (kappaf*phic) = kappac*phic, set
58  a_kappaMultipliedIn to be false,
59  If you want simple averaging, set it to be true.
60  Simply put, false is for phi, true is for kappa Lapl(phi).
61  */
62  static void
64  const Vector< LevelData<EBCellFAB>* >& a_solnCoar,
65  const Vector< DisjointBoxLayout >& a_gridsCoar,
66  const Vector< EBISLayout >& a_ebislCoar,
67  const ProblemDomain& a_level0DomainCoar,
68  const Vector< LevelData<EBCellFAB>* >& a_solnFine,
69  const Vector< DisjointBoxLayout >& a_gridsFine,
70  const Vector< EBISLayout >& a_ebislFine,
71  const ProblemDomain& a_level0DomainFine,
72  const Vector<int>& a_refRat,
73  bool a_kappaAlreadyMultipliedIn = false);
74 
75 
76  ///
77  /**
78  If you want averaging to be sum (kappaf*phic) = kappac*phic, set
79  a_kappaMultipliedIn to be false,
80  If you want simple averaging, set it to be true.
81  Simply put, false is for phi, true is for kappa Lapl(phi).
82  */
83  static void
85  const LevelData<EBCellFAB>& a_solnCoar,
86  const DisjointBoxLayout & a_gridsCoar,
87  const EBISLayout & a_ebislCoar,
88  const ProblemDomain& a_level0DomainCoar,
89  const LevelData<EBCellFAB>& a_solnFine,
90  const DisjointBoxLayout & a_gridsFine,
91  const EBISLayout & a_ebislFine,
92  const ProblemDomain& a_level0DomainFine,
93  bool a_kappaAlreadyMultipliedIn = false);
94 
96  {
97  }
98 
99  ///
100  /**
101  count vofs, boxes, regular cells, etc.
102  */
103  static int countVoF(const Vector<DisjointBoxLayout>& a_dbl,
104  const Vector<EBISLayout>& a_ebisl,
105  const Vector<ProblemDomain>& a_domain);
106 
107  ///
108  /**
109  average a cell centered velocity vector (with SpaceDim components) to face centers
110  */
111  static void averageCellToFacesMAC(Vector<LevelData<EBFluxFAB>* >& a_dataFlux,
112  const Vector<LevelData<EBCellFAB>* >& a_dataCell,
113  const Vector<EBLevelGrid>& a_eblg,
114  const Vector<int>& a_refRatio);
115 
116 
117  ///
118  /**
119  average cell centered data to all face centers for component a_comp
120  */
121  static void averageCellToFaces(Vector<LevelData<EBFluxFAB>* >& a_dataFlux,
122  const Vector<LevelData<EBCellFAB>* >& a_dataCell,
123  const Vector<EBLevelGrid>& a_eblg,
124  const Vector<int>& a_refRatio,
125  const int& a_comp);
126 
127  ///
128  /**
129  average cell centered data to all face centers for component a_comp
130  */
131  static void averageCellToFaces(Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_dataFlux,
132  const Vector<LevelData<EBCellFAB>* >& a_dataCell,
133  const Vector<EBLevelGrid>& a_eblg,
134  const Vector<int>& a_refRatio,
135  const int& a_comp);
136 
137 
138  ///
139  /**
140  */
141  static void quadCFInterpAll(Vector<LevelData<EBCellFAB>* >& a_data,
142  const Vector<DisjointBoxLayout>& a_dbl,
143  const Vector<EBISLayout>& a_ebisl,
144  const Vector<ProblemDomain>& a_domain,
145  const Vector<int>& a_refRatio);
146 
147  ///
148  /**
149  */
150  static void quadCFInterpAll(Vector<LevelData<EBCellFAB>* >& a_data,
151  const Vector<EBLevelGrid>& a_eblg,
152  const Vector<int>& a_refRatio);
153 
154 
155  ///
156  /**
157  */
158  static void quadCFInterpOne(Vector<LevelData<EBCellFAB>* >& a_data,
159  const Vector<EBLevelGrid>& a_eblg,
160  const Vector<int>& a_refRatio,
161  const int& a_fineLevel);
162 
163  ///
164  /**
165  */
166  static void quadCFInterpOne(Vector<LevelData<EBCellFAB>* >& a_data,
167  const Vector<DisjointBoxLayout>& a_dbl,
168  const Vector<EBISLayout>& a_ebisl,
169  const Vector<ProblemDomain>& a_domain,
170  const Vector<int>& a_refRatio,
171  const int& a_fineLevel);
172 
173 
174  ///
175  /**
176  */
177  static void quadCFInterpOne(LevelData<EBCellFAB>& a_dataFine,
178  const LevelData<EBCellFAB>& a_dataCoar,
179  const DisjointBoxLayout& a_dblFine,
180  const DisjointBoxLayout& a_dblCoar,
181  const EBISLayout& a_ebislFine,
182  const EBISLayout& a_ebislCoar,
183  const ProblemDomain& a_domainCoar,
184  const int& a_refRatio);
185 
186 
187  ///
188  /**
189  */
190  static void pwlFillPatchAll(Vector<LevelData<EBCellFAB>* >& a_data,
191  const Vector<EBLevelGrid>& a_eblg,
192  const Vector<int>& a_refRatio);
193  ///
194  /**
195  */
196  static void pwlFillPatchAll(Vector<LevelData<EBCellFAB>* >& a_data,
197  const Vector<DisjointBoxLayout>& a_dbl,
198  const Vector<EBISLayout>& a_ebisl,
199  const Vector<ProblemDomain>& a_domain,
200  const Vector<int>& a_refRatio);
201 
202 
203  ///
204  /**
205  */
206  static void pwlFillPatchOne(LevelData<EBCellFAB>& a_dataFine,
207  LevelData<EBCellFAB>& a_dataCoar,
208  const DisjointBoxLayout& a_dblFine,
209  const DisjointBoxLayout& a_dblCoar,
210  const EBISLayout& a_ebislFine,
211  const EBISLayout& a_ebislCoar,
212  const ProblemDomain& a_domainCoar,
213  const int& a_refRatioCoar);
214 
215 
216 
217 
218 
219  ///
220  /**
221  */
222  static void exchangeAll(Vector<LevelData<EBCellFAB>* >& a_phi);
223 
224  ///
225  /**
226  */
227  static void exchangeCorners(Vector<LevelData<EBCellFAB>* >& a_data,
228  const ProblemDomain& a_domain);
229 
230  ///
231  /**
232  */
233  static void exchangeComp(Vector<LevelData<EBCellFAB>* >& a_data,
234  const int& a_comp);
235 
236 
237  ///
238  /**
239  */
240  static void exchangeAll(Vector<LevelData<EBFluxFAB>* >& a_phi);
241 
242 
243  ///
244  /**
245  */
246  static void exchangeComp(Vector<LevelData<EBFluxFAB>* >& a_data,
247  const int& a_comp);
248 
249 
250  ///
251  /**
252  */
253  static void exchangeAll(Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_phi);
254 
255 
256  ///
257  /**
258  */
259  static void exchangeComp(Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_data,
260  const int& a_comp);
261 
262 
263  ///
264  /**
265  */
266  static void exchangeAll(Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_phi);
267 
268 
269  ///
270  /**
271  */
272  static void exchangeComp(Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_data,
273  const int& a_comp);
274 
275 
276  ///
277  /**
278  */
279  static void coarsenDown(Vector<LevelData<EBCellFAB>* >& a_data,
280  const Vector<EBLevelGrid>& a_eblg,
281  const Vector<int>& a_refRatio);
282 
283 
284  ///
285  /**
286  */
287  static void averageDown(Vector<LevelData<EBCellFAB>* >& a_data,
288  const Vector<EBISLayout>& a_ebisl,
289  const Vector<DisjointBoxLayout>& a_dbl,
290  const Vector<ProblemDomain>& a_domain,
291  const Vector<int>& a_refRatio);
292 
293  ///
294  /**
295  */
296  static void averageDown(Vector<LevelData<EBCellFAB>* >& a_data,
297  const Vector<EBLevelGrid>& a_eblg,
298  const Vector<int>& a_refRatio);
299 
300 
301  ///
302  /**
303  */
304  static void averageDown(LevelData<EBCellFAB>& a_dataCoar,
305  const LevelData<EBCellFAB>& a_dataFine,
306  const EBISLayout& a_ebislCoar,
307  const EBISLayout& a_ebislFine,
308  const DisjointBoxLayout& a_dblCoar,
309  const DisjointBoxLayout& a_dblFine,
310  const ProblemDomain& a_domainCoar,
311  const int& a_refRatio);
312 
313 
315  const Vector<EBLevelGrid>& a_eblg,
316  const Vector<int> & a_refRat);
317 
318  static void averageDown(Vector<LevelData<EBFluxFAB> * >& a_data,
319  const Vector<EBLevelGrid>& a_eblg,
320  const Vector<int>& a_refRatio);
321  ///
322  /**
323  */
324  static void averageDown(Vector<LevelData<EBFluxFAB>* >& a_data,
325  const Vector<EBISLayout>& a_ebisl,
326  const Vector<DisjointBoxLayout>& a_dbl,
327  const Vector<ProblemDomain>& a_domain,
328  const Vector<int>& a_refRatio);
329 
330 
331  ///
332  /**
333  */
334  static void averageDown(Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_data,
335  const Vector<EBISLayout>& a_ebisl,
336  const Vector<DisjointBoxLayout>& a_dbl,
337  const Vector<ProblemDomain>& a_domain,
338  const Vector<int>& a_refRatio);
339 
340 
341  ///
342  /**
343  */
344  static void averageDown(Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_data,
345  const Vector<EBISLayout>& a_ebisl,
346  const Vector<DisjointBoxLayout>& a_dbl,
347  const Vector<ProblemDomain>& a_domain,
348  const Vector<int>& a_refRatio);
349 
350  ///
351  /**
352  */
353  static void averageDown(Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_data,
354  const Vector<EBLevelGrid>& a_eblg,
355  const Vector<int>& a_refRatio);
356 
357 
358  ///
359  /**
360  */
361  static void setCoveredAMRVal(Vector<LevelData<EBCellFAB>* >& a_data,
362  const Vector<EBISLayout>& a_ebisl,
363  const Vector<int>& a_refRat,
364  const Real& a_value);
365 
366  static void setCoveredAMRVal(Vector<LevelData<EBCellFAB>* >& a_data,
367  const Vector<EBLevelGrid>& a_eblg,
368  const Vector<int>& a_refRat,
369  const Real& a_value);
370 
371 
372  ///
373  /**
374  */
375  static void setCoveredVal(Vector<LevelData<EBCellFAB>* >&a_data,
376  const Real& a_value);
377 
378  ///
379  /**
380  */
381  static void setCoveredVal(Vector<LevelData<EBCellFAB>* >&a_data,
382  const int& a_comp,
383  const Real& a_value);
384 
385 
386  ///
387  /**
388  */
389  static void deleteAMRData(Vector<LevelData<EBCellFAB>* >& a_amrData);
390 
391 
392  //! Defines every LevelData<EBCellFAB> object in the given AMR hierarchy using the given parameters.
393  static void defineAMRData(Vector<LevelData<EBCellFAB>* >& a_amrData,
394  const Vector<EBLevelGrid>& a_eblg,
395  const IntVect& a_ghosts,
396  const int& a_nComp,
397  const int& a_numLevels);
398 
399  //! Defines every LevelData<EBFluxFAB> object in the given AMR hierarchy using the given parameters.
400  static void defineAMRData(Vector<LevelData<EBFluxFAB>* >& a_amrData,
401  const Vector<EBLevelGrid>& a_eblg,
402  const IntVect& a_ghosts,
403  const int& a_nComp,
404  const int& a_numLevels);
405 
406 
407  //! Defines every LevelData<EBCellFAB> object in the given AMR hierarchy using the given parameters.
408  //! This version manipulates hierarchies that use RefCountedPtr objects instead of bare pointers.
409  static void defineAMRData(Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_amrData,
410  const Vector<EBLevelGrid>& a_eblg,
411  const IntVect& a_ghosts,
412  const int& a_nComp,
413  const int& a_numLevels);
414 
415 
416  //! Defines every LevelData<EBFluxFAB> object in the given AMR hierarchy using the given parameters.
417  //! This version manipulates hierarchies that use RefCountedPtr objects instead of bare pointers.
418  static void defineAMRData(Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_amrData,
419  const Vector<EBLevelGrid>& a_eblg,
420  const IntVect& a_ghosts,
421  const int& a_nComp,
422  const int& a_numLevels);
423 
424 
425  //! Scales the AMR hierarchy of flux data \a a_lhs by the factor \a a_scale.
426  static void scale(Vector<LevelData<EBFluxFAB>* >& a_lhs,
427  const Real& a_scale) ;
428 
429 
430  //! Scales the AMR hierarchy of cell data \a a_lhs by the factor \a a_scale.
431  static void scale(Vector<LevelData<EBCellFAB>* >& a_lhs,
432  const Real& a_scale) ;
433 
434 
435  //! Applies a scale factor \a a_scale to a specific component \a a_comp of the AMR hierarchy
436  //! of cell data \a a_lhs.
437  static void scale(Vector<LevelData<EBCellFAB>* >& a_lhs,
438  const Real& a_scale,
439  const int& a_comp);
440 
441 
442  //! Sets every element in the AMR hierarchy of cell data \a a_result to zero.
443  static void setToZero(Vector<LevelData<EBCellFAB>* >& a_result);
444 
445 
446  //! Sets every element in the AMR hierarchy of cell data \a a_result to the value \a a_value.
447  static void setVal(Vector<LevelData<EBCellFAB>* >& a_result,
448  const Real& a_value);
449 
450 
451  //! Sets the given component \a a_comp in every element in the AMR hierarchy of cell data
452  //! \a a_result to the value \a a_value.
453  static void setVal(Vector<LevelData<EBCellFAB>* >& a_result,
454  const Real& a_value,
455  const int& a_comp);
456 
457 
458  //! Sets every element in the AMR hierarchy of flux data \a a_result to zero.
459  static void setToZero(Vector<LevelData<EBFluxFAB>* >& a_result);
460 
461 
462  //! Sets every element in the AMR hierarchy of flux data \a a_result to \a a_value.
463  static void setVal(Vector<LevelData<EBFluxFAB>* >& a_result,
464  const Real& a_value);
465 
466 
467  ///
468  /**
469  */
470  static void assign(Vector<LevelData<EBCellFAB>* >& a_lhs,
471  const Vector<LevelData<EBCellFAB>* >& a_rhs);
472 
473 
474  ///
475  /**
476  */
477  static void assign(Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_lhs,
478  const Vector<LevelData<EBCellFAB>* >& a_rhs);
479 
480 
481  ///
482  /**
483  */
484  static void assign(Vector<LevelData<EBFluxFAB>* >& a_lhs,
485  const Vector<LevelData<EBFluxFAB>* >& a_rhs);
486 
487 
488  ///
489  /**
490  */
491  static void assign(Vector<RefCountedPtr<LevelData<EBFluxFAB> > >& a_lhs,
492  const Vector<LevelData<EBFluxFAB>* >& a_rhs);
493 
494 
495  ///
496  /**
497  */
498  static void assign(Vector<LevelData<EBCellFAB>* >& a_to,
499  const Vector<LevelData<EBCellFAB>* >& a_from,
500  const Interval& a_toInterval,
501  const Interval& a_fromInterval);
502 
503 
504  ///
505  /**
506  */
507  static void assign(Vector<RefCountedPtr<LevelData<EBCellFAB> > >& a_to,
508  const Vector<LevelData<EBCellFAB>* >& a_from,
509  const Interval& a_toInterval,
510  const Interval& a_fromInterval);
511 
512 
513  ///
514  /**
515  */
516  static void incr(Vector<LevelData<EBCellFAB>* >& a_lhs,
517  const Vector<LevelData<EBCellFAB>* >& a_rhs,
518  const Real& a_scale);
519 
520 
521  ///
522  /**
523  */
524  static void incr(Vector<LevelData<EBFluxFAB>* >& a_lhs,
525  const Vector<LevelData<EBFluxFAB>* >& a_rhs,
526  const Real& a_scale);
527 
528 
529  ///
530  /**
531  */
532  static void incr(Vector<LevelData<EBCellFAB>* >& a_lhs,
533  const Real& a_scale);
534 
535 
536  //! Evaluates a linear combination of EBCellFAB data on an AMR hierarchy.
537  //! \a a_lhs := \a a * \a a_x + \a b * \a a_y.
538  //! \param a_lhs The hierarchy of LevelData into which the linear combination is placed.
539  //! \param a_x The first LevelData in the linear combination.
540  //! \param a_y The second LevelData in the linear combination.
541  //! \param a The first coefficient in the linear combination.
542  //! \param b The second coefficient in the linear combination.
543  static void axby(Vector<LevelData<EBCellFAB>* >& a_lhs,
544  const Vector<LevelData<EBCellFAB>* >& a_x,
545  const Vector<LevelData<EBCellFAB>* >& a_y,
546  const Real& a,
547  const Real& b);
548 
549 
550  /*
551  //! Evaluates a linear combination of EBCellFAB data on an AMR hierarchy. This version
552  //! operates only on a given component of each LevelData.
553  //! \a a_lhs[\a a_lhsComp] := \a a * \a a_x[\a a_xComp] + \a b * \a a_y[\a a_yComp].
554  //! \param a_lhs The hierarchy of LevelData into which the linear combination is placed.
555  //! \param a_x The first LevelData in the linear combination.
556  //! \param a_y The second LevelData in the linear combination.
557  //! \param a The first coefficient in the linear combination.
558  //! \param b The second coefficient in the linear combination.
559  //! \param a_lhsComp The component of \a a_lhs in which the linear combination will be stored.
560  //! \param a_xComp The component of \a a_x from which data will be extracted.
561  //! \param a_yComp The component of \a a_y from which data will be extracted.
562  static void axby(Vector<LevelData<EBCellFAB>* >& a_lhs,
563  const Vector<LevelData<EBCellFAB>* >& a_x,
564  const Vector<LevelData<EBCellFAB>* >& a_y,
565  const Real& a_a,
566  const Real& a_b,
567  const int& a_lhsComp,
568  const int& a_xComp,
569  const int& a_yComp);
570  */
571 
572  //! Places the sum \a a_in1 + \a a_in2 into \a a_result.
573  //! \param a_result The AMR hierarchy that will store the sum.
574  //! \param a_in1 The first AMR hierarchy of data in the sum.
575  //! \param a_in2 The second AMR hierarchy of data in the sum.
576  static void sum(Vector<LevelData<EBCellFAB>* >& a_result,
577  const Vector<LevelData<EBCellFAB>* >& a_in1,
578  const Vector<LevelData<EBCellFAB>* >& a_in2);
579 
580 
581  //! Adds the constant \a a_constant to every element in the hierarchy \a a_data.
582  static void addConstant(Vector<LevelData<EBCellFAB>* >& a_data,
583  const Real& a_constant);
584 
585 
586  ///
587  /**
588  */
589  static void product(Vector<LevelData<EBCellFAB>* >& a_result,
590  const Vector<LevelData<EBCellFAB>* >& a_in1,
591  const Vector<LevelData<EBCellFAB>* >& a_in2);
592 
593 
594  ///
595  /**
596  */
597  static void product(Vector<LevelData<EBCellFAB>* >& a_result,
598  const Vector<LevelData<EBCellFAB>* >& a_in1,
599  const Vector<LevelData<EBCellFAB>* >& a_in2,
600  const int& a_rComp,
601  const int& a_1Comp,
602  const int& a_2Comp);
603 
604 
605  ///
606  /**
607  */
608  static void divideVectorByScalar(Vector<LevelData<EBCellFAB>* >& a_vectorOut,
609  const Vector<LevelData<EBCellFAB>* >& a_vectorIn,
610  const Vector<LevelData<EBCellFAB>* >& a_scalar);
611 
612  ///
613  /**
614  */
615  static void divide(Vector<LevelData<EBCellFAB>* >& a_result,
616  const Vector<LevelData<EBCellFAB>* >& a_in1,
617  const Vector<LevelData<EBCellFAB>* >& a_in2);
618 
619 
620  ///
621  /**
622  */
623  static void divide(Vector<LevelData<EBCellFAB>* >& a_result,
624  const Vector<LevelData<EBCellFAB>* >& a_in1,
625  const Vector<LevelData<EBCellFAB>* >& a_in2,
626  const int& a_rComp,
627  const int& a_1Comp,
628  const int& a_2Comp);
629 
630 
631  ///
632  /**
633  */
634  static void product(Vector<LevelData<EBFluxFAB>* >& a_result,
635  const Vector<LevelData<EBFluxFAB>* >& a_in1,
636  const Vector<LevelData<EBFluxFAB>* >& a_in2);
637 
638 
639  ///
640  /**
641  */
642  static void kappaWeight(Vector<LevelData<EBCellFAB>* >& a_data);
643 
644 
645  ///
646  /**
647  */
648  static void kappaScale(Vector<LevelData<EBCellFAB>* >& a_data,
649  const Real& a_scale);
650 
651 
652  ///
653  /**
654  */
655  static Real kappaNorm(Real& a_volume,
656  const Vector<LevelData<EBCellFAB>* >& a_data,
657  int a_which,
658  const Vector<ProblemDomain>& a_domain,
659  int a_p=2);
660 
661 
662  ///
663  /**
664  */
665  static Real noKappaNorm(Real& a_volume,
666  const Vector<LevelData<EBCellFAB>* >& a_data,
667  int a_which,
668  const Vector<ProblemDomain>& a_domain,
669  int a_p=2);
670 
671 
672  ///
673  /**
674  */
675  static Real kappaDotProduct(Real& a_volume,
676  const Vector<LevelData<EBCellFAB>* >& a_data1,
677  const Vector<LevelData<EBCellFAB>* >& a_data2,
678  int a_which,
679  const Vector<ProblemDomain>& a_domain);
680 
681 
682  ///
683  /**
684  */
685  static Real noKappaDotProduct(Real& a_volume,
686  const Vector<LevelData<EBCellFAB>* >& a_data1,
687  const Vector<LevelData<EBCellFAB>* >& a_data2,
688  int a_which,
689  const Vector<ProblemDomain>& a_domain);
690 
691 
692 
693  ///
694  /**
695  VERY weird function changes data
696  */
697  static void setMaxMin(Vector<LevelData<EBCellFAB>* >& a_data,
698  const Real& a_maxVal,
699  const Real& a_minVal,
700  const int& a_comp);
701 
702  ///
703  /**
704  This is what you want if you want the max and min of data
705  It cannot subtract off finer stuff if you do not send refRat
706  */
707  static void getMaxMin(Real& a_maxVal,
708  Real& a_minVal,
709  const Vector<LevelData<EBCellFAB>* >& a_data,
710  const int& a_comp,
711  Vector<int> a_refRat = Vector<int>());
712 
713 
714  ///
715  /**
716  */
718  const Vector<DisjointBoxLayout>& a_grids,
719  const Vector<EBISLayout>& a_ebisl,
720  const Vector<int> & a_refRat);
721 
722 
723  ///
724  /**
725  */
726  static void checkThisData(const Vector<LevelData<EBCellFAB>* >& a_data,
727  const string& a_name,
728  const IntVect& a_iv1 = IntVect::Zero,
729  const IntVect& a_iv2 = IntVect::Zero,
730  const Real& a_shift = 0.0);
731 
732 
733  ///
734  /**
735  */
736  static bool checkNANINF(const Vector<LevelData<EBCellFAB>* >& a_data,
737  const IntVect& a_iv1 = IntVect::Zero,
738  const IntVect& a_iv2 = IntVect::Zero,
739  const Real& a_shift = 0.0);
740 
741 
742  ///
743  /**
744  */
745  static void checkThisData(const Vector<LevelData<EBFluxFAB>* >& a_data,
746  const string& a_name);
747 
748 
749  ///
750  /**
751  */
752  static bool checkNANINF(const Vector<LevelData<EBFluxFAB>* >& a_data);
753 
754 
755 
756  ///
757  /**
758  */
759  static Real sum(const Vector<LevelData<EBCellFAB>* >& a_data,
760  const Vector<DisjointBoxLayout>& a_grids,
761  const Vector<EBISLayout>& a_ebisl,
762  const Vector<int> & a_refRat,
763  int a_comp,
764  bool a_mutiplyByKappa);
765 
766  ///
767  /**
768  */
769  static Real sum(const Vector<LevelData<EBCellFAB>* >& a_data,
770  const Vector<EBLevelGrid>& a_eblg,
771  const Vector<int> & a_refRat,
772  int a_comp,
773  bool a_mutiplyByKappa);
774 
775 protected:
776 
777 };
778 #include "NamespaceFooter.H"
779 #endif
static void averageDown(Vector< LevelData< EBCellFAB > * > &a_data, const Vector< EBISLayout > &a_ebisl, const Vector< DisjointBoxLayout > &a_dbl, const Vector< ProblemDomain > &a_domain, const Vector< int > &a_refRatio)
static bool checkNANINF(const Vector< LevelData< EBCellFAB > * > &a_data, const IntVect &a_iv1=IntVect::Zero, const IntVect &a_iv2=IntVect::Zero, const Real &a_shift=0.0)
static void kappaWeight(Vector< LevelData< EBCellFAB > * > &a_data)
static Real kappaNorm(Real &a_volume, const Vector< LevelData< EBCellFAB > * > &a_data, int a_which, const Vector< ProblemDomain > &a_domain, int a_p=2)
A reference-counting handle class.
Definition: RefCountedPtr.H:173
static void coarsenDown(Vector< LevelData< EBCellFAB > * > &a_data, const Vector< EBLevelGrid > &a_eblg, const Vector< int > &a_refRatio)
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
static void sum(Vector< LevelData< EBCellFAB > * > &a_result, const Vector< LevelData< EBCellFAB > * > &a_in1, const Vector< LevelData< EBCellFAB > * > &a_in2)
static void exchangeAll(Vector< LevelData< EBCellFAB > * > &a_phi)
static void kappaScale(Vector< LevelData< EBCellFAB > * > &a_data, const Real &a_scale)
one dimensional dynamic array
Definition: Vector.H:53
static void setMaxMin(Vector< LevelData< EBCellFAB > * > &a_data, const Real &a_maxVal, const Real &a_minVal, const int &a_comp)
static void setCoveredVal(Vector< LevelData< EBCellFAB > * > &a_data, const Real &a_value)
static void deleteAMRData(Vector< LevelData< EBCellFAB > * > &a_amrData)
static void divideVectorByScalar(Vector< LevelData< EBCellFAB > * > &a_vectorOut, const Vector< LevelData< EBCellFAB > * > &a_vectorIn, const Vector< LevelData< EBCellFAB > * > &a_scalar)
static void getMaxMin(Real &a_maxVal, Real &a_minVal, const Vector< LevelData< EBCellFAB > * > &a_data, const int &a_comp, Vector< int > a_refRat=Vector< int >())
static void setCoveredAMRVal(Vector< LevelData< EBCellFAB > * > &a_data, const Vector< EBISLayout > &a_ebisl, const Vector< int > &a_refRat, const Real &a_value)
static void exchangeCorners(Vector< LevelData< EBCellFAB > * > &a_data, const ProblemDomain &a_domain)
static void checkThisData(const Vector< LevelData< EBCellFAB > * > &a_data, const string &a_name, const IntVect &a_iv1=IntVect::Zero, const IntVect &a_iv2=IntVect::Zero, const Real &a_shift=0.0)
static Real subtractOffMean(Vector< LevelData< EBCellFAB > * > &a_data, const Vector< EBLevelGrid > &a_eblg, const Vector< int > &a_refRat)
static void incr(Vector< LevelData< EBCellFAB > * > &a_lhs, const Vector< LevelData< EBCellFAB > * > &a_rhs, const Real &a_scale)
EBAMRDataOps()
Definition: EBAMRDataOps.H:51
static void quadCFInterpAll(Vector< LevelData< EBCellFAB > * > &a_data, const Vector< DisjointBoxLayout > &a_dbl, const Vector< EBISLayout > &a_ebisl, const Vector< ProblemDomain > &a_domain, const Vector< int > &a_refRatio)
Structure for passing component ranges in code.
Definition: Interval.H:23
static void setVal(Vector< LevelData< EBCellFAB > * > &a_result, const Real &a_value)
Sets every element in the AMR hierarchy of cell data a_result to the value a_value.
static void pwlFillPatchOne(LevelData< EBCellFAB > &a_dataFine, LevelData< EBCellFAB > &a_dataCoar, const DisjointBoxLayout &a_dblFine, const DisjointBoxLayout &a_dblCoar, const EBISLayout &a_ebislFine, const EBISLayout &a_ebislCoar, const ProblemDomain &a_domainCoar, const int &a_refRatioCoar)
static Real kappaDotProduct(Real &a_volume, const Vector< LevelData< EBCellFAB > * > &a_data1, const Vector< LevelData< EBCellFAB > * > &a_data2, int a_which, const Vector< ProblemDomain > &a_domain)
double Real
Definition: REAL.H:33
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
static void defineAMRData(Vector< LevelData< EBCellFAB > * > &a_amrData, const Vector< EBLevelGrid > &a_eblg, const IntVect &a_ghosts, const int &a_nComp, const int &a_numLevels)
Defines every LevelData<EBCellFAB> object in the given AMR hierarchy using the given parameters...
static void exchangeComp(Vector< LevelData< EBCellFAB > * > &a_data, const int &a_comp)
static void getErrorFromCoarseAndFine(Vector< LevelData< EBCellFAB > * > &a_errorCoar, const Vector< LevelData< EBCellFAB > * > &a_solnCoar, const Vector< DisjointBoxLayout > &a_gridsCoar, const Vector< EBISLayout > &a_ebislCoar, const ProblemDomain &a_level0DomainCoar, const Vector< LevelData< EBCellFAB > * > &a_solnFine, const Vector< DisjointBoxLayout > &a_gridsFine, const Vector< EBISLayout > &a_ebislFine, const ProblemDomain &a_level0DomainFine, const Vector< int > &a_refRat, bool a_kappaAlreadyMultipliedIn=false)
static const IntVect Zero
Definition: IntVect.H:654
Definition: EBAMRDataOps.H:48
static Real noKappaDotProduct(Real &a_volume, const Vector< LevelData< EBCellFAB > * > &a_data1, const Vector< LevelData< EBCellFAB > * > &a_data2, int a_which, const Vector< ProblemDomain > &a_domain)
static void axby(Vector< LevelData< EBCellFAB > * > &a_lhs, const Vector< LevelData< EBCellFAB > * > &a_x, const Vector< LevelData< EBCellFAB > * > &a_y, const Real &a, const Real &b)
static void assign(Vector< LevelData< EBCellFAB > * > &a_lhs, const Vector< LevelData< EBCellFAB > * > &a_rhs)
static void addConstant(Vector< LevelData< EBCellFAB > * > &a_data, const Real &a_constant)
Adds the constant a_constant to every element in the hierarchy a_data.
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
static void product(Vector< LevelData< EBCellFAB > * > &a_result, const Vector< LevelData< EBCellFAB > * > &a_in1, const Vector< LevelData< EBCellFAB > * > &a_in2)
static void pwlFillPatchAll(Vector< LevelData< EBCellFAB > * > &a_data, const Vector< EBLevelGrid > &a_eblg, const Vector< int > &a_refRatio)
static void averageCellToFaces(Vector< LevelData< EBFluxFAB > * > &a_dataFlux, const Vector< LevelData< EBCellFAB > * > &a_dataCell, const Vector< EBLevelGrid > &a_eblg, const Vector< int > &a_refRatio, const int &a_comp)
~EBAMRDataOps()
Definition: EBAMRDataOps.H:95
static void quadCFInterpOne(Vector< LevelData< EBCellFAB > * > &a_data, const Vector< EBLevelGrid > &a_eblg, const Vector< int > &a_refRatio, const int &a_fineLevel)
Definition: EBISLayout.H:39
static int countVoF(const Vector< DisjointBoxLayout > &a_dbl, const Vector< EBISLayout > &a_ebisl, const Vector< ProblemDomain > &a_domain)
static void averageCellToFacesMAC(Vector< LevelData< EBFluxFAB > * > &a_dataFlux, const Vector< LevelData< EBCellFAB > * > &a_dataCell, const Vector< EBLevelGrid > &a_eblg, const Vector< int > &a_refRatio)
static void scale(Vector< LevelData< EBFluxFAB > * > &a_lhs, const Real &a_scale)
Scales the AMR hierarchy of flux data a_lhs by the factor a_scale.
static void divide(Vector< LevelData< EBCellFAB > * > &a_result, const Vector< LevelData< EBCellFAB > * > &a_in1, const Vector< LevelData< EBCellFAB > * > &a_in2)
static void setToZero(Vector< LevelData< EBCellFAB > * > &a_result)
Sets every element in the AMR hierarchy of cell data a_result to zero.
static Real noKappaNorm(Real &a_volume, const Vector< LevelData< EBCellFAB > * > &a_data, int a_which, const Vector< ProblemDomain > &a_domain, int a_p=2)