Chombo + EB  3.0
EBGraph.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 // ANAG, LBNL
12 
13 #ifndef _EBGRAPH_H_
14 #define _EBGRAPH_H_
15 
16 #include "REAL.H"
17 #include "SPMD.H"
18 #include "RefCountedPtr.H"
19 #include "IntVect.H"
20 #include "IntVectSet.H"
21 #include "RealVect.H"
22 #include "Interval.H"
23 #include "BaseFab.H"
24 #include "HDF5Portable.H"
25 
26 #include "VolIndex.H"
27 #include "FaceIndex.H"
28 #include "IrregNode.H"
29 #include "GraphNode.H"
30 #include "FaceIterator.H"
31 #include "VoFIterator.H"
32 
33 #include "NamespaceHeader.H"
34 
35 class EBIndexSpace;
36 
37 class EBGraph;
38 /// Geometric description within a box
39 /**
40  EBGraphImplem represents the geometric information
41  of the domain at a given refinement
42  within the boundaries of a particular box.
43 */
45 {
46 public:
48  static Box s_doDebug;
49 
50  ///
51  /**
52  The EBGraphImplem can be all regular or all
53  covered or contain irregular cells.
54  */
55  enum TAG
56  {
60  };
61 
62  ///
63  /**
64  Makes an EBGraphImplem whose contents are undefined.
65  */
66  EBGraphImplem();
67 
68  ///
70 
71  ///
72  /**
73  If the graph has irregular cells
74  get a mask over the size of the graph.
75  -1 for covered cells or multivalued cells, 0 for singlevalued irregular, and 1 for regular.
76  If the graph is all regular, regIrregCovered returns 1 and
77  the mask is undefined.
78  If the graph is all regular, regIrregCovered returns -1 and
79  the mask is undefined.
80  */
81  const BaseFab<int>& getMask(int& a_regIrregCovered) const;
82 
83  ///
84  /**
85  Return the VoFs in the cell.
86  */
87  Vector<VolIndex> getVoFs(const IntVect& a_iv) const;
88 
89  ///
90  int numVoFs(const IntVect& a_iv) const;
91 
92  ///
93  int numVoFs(const Box& a_box) const ;
94 
95  ///
96  int numFaces(const Box& a_box, int a_dir) const ;
97 
98  ///
99  /**
100  Return true if every cell in the EBGraphImplem is a regular cell.
101  */
102  bool isAllRegular() const;
103 
104  ///
105  /**
106  Return true neither all regular nor all covered
107  */
108  bool hasIrregular() const;
109 
110  ///
111  /**
112  Return true if every cell in the EBGraphImplem is a covered cell.
113  */
114  bool isAllCovered() const;
115 
116  ///
117  /**
118  Return true if a_iv is an irregular cell.
119  */
120  bool isIrregular(const IntVect& a_iv) const;
121 
122  ///
123  /**
124  Return true if every cell in a_box is a
125  covered cell.
126  */
127  bool isCovered(const Box& a_box) const;
128 
129  ///
130  /**
131  Return true if every cell in a_box is a
132  regular cell.
133  */
134  bool isRegular(const Box& a_box) const;
135 
136  ///
137  bool isRegular(const IntVect& a_iv) const;
138 
139  ///
140  bool isCovered(const IntVect& a_iv) const;
141 
142  ///
143  bool isConnected(const VolIndex& a_vof1,
144  const VolIndex& a_vof2) const;
145  ///
146  /**
147  Return the faces on the side and direction
148  of the input VoF.
149  */
150  Vector<FaceIndex> getFaces(const VolIndex& a_vof,
151  const int& a_idir,
152  const Side::LoHiSide& a_sd) const;
153 
154  ///
155  Vector<Vector<VolIndex> > getVoFSets(const Box& a_region) const;
156 
157  ///
158  /**
159  Returns the corresponding set of VoFs from the next finer
160  EBGraphImplem (factor of two refinement). The result is only
161  defined if this {\tt EBGraphImplem} was defined by coarsening.
162  */
163  Vector<VolIndex> refine(const VolIndex& a_coarVoF) const;
164 
165  ///
166  /**
167  Returns the corresponding set of faces from the next finer
168  EBGraphImplem (factor of two refinement). The result is only
169  defined if this {\tt EBGraphImplem} was defined by coarsening.
170  */
171  Vector<FaceIndex> refine(const FaceIndex& a_coarFace, const EBGraphImplem& a_fineGraph) const;
172 
173  ///
174  /**
175  Returns the corresponding face from the next coarser
176  EBGraphImplem (factor of two refinement). This only makes
177  sense if there is a coarser level.
178  */
179  FaceIndex coarsen(const FaceIndex& a_coarFace) const;
180 
181  ///
182  /**
183  Returns the corresponding VoF from the next coarser
184  EBGraphImplem (same solution location, different index space, factor
185  of two refinement ratio).
186  */
187  VolIndex coarsen(const VolIndex& a_fineVoF) const;
188 
189  ///
190  /**
191  Completely construct the graph from IrregNodes.
192  This makes a DENSE representation of the graph. To make
193  sparse representations of all regular or all covered graphs,
194  use setToAllRegular or setToAllCovered.\\
195  irregGraph contains a complete list of irregular vofs. \\
196  validRegion is the the region of the graph \\
197  domain is the domain of compuation \\
198  regIrregCovered = 1 for regular, 0 for irregular, -1 for covered.
199  regIrregCovered must contain the valid region grown by 1. \\
200  In chombospeak, \\
201  regIrregCovered.box().contains(grow(validRegion, 1) & domain); \\
202  otherwise an error will result
203  */
204  void
205  buildGraph(const BaseFab<int>& a_regIrregCovered,
206  const Vector<IrregNode>& a_irregGraph,
207  const Box& a_validRegion,
208  const ProblemDomain& a_domain);
209 
210  ///check if a box worth of graph is self consistent
211  static void
212  checkGraph(const BaseFab<int>& a_regIrregCovered,
213  const Vector<IrregNode>& a_irregGraph,
214  const Box& a_validRegion,
215  const ProblemDomain& a_domain) ;
216 
217  ///
218  /**
219  Set the graph to all regular cells (sparse);
220  */
221  void setToAllRegular();
222 
223  ///
224  /**
225  Set the graph to all covered cells (sparse);
226  */
227  void setToAllCovered();
228 
229  ///
230  /**
231  Define an all-regular EBGraphImplem with the input box as its
232  region.
233  */
234  void define(const Box& box);
235 
236  EBGraphImplem(const Box& box);
237 
238  ///
239  /**
240  Copy the information from a_source to the over the intersection
241  of the box a_region, the box of the current EBGraphImplem and
242  the box of a_source. The Interval arguments are ignored.
243  This function is required by LevelData.
244  */
245  void copy(const Box& a_regionFrom,
246  const Interval& Cd,
247  const Box& a_regionto,
248  const EBGraphImplem& a_source,
249  const Interval& Cs);
250 
251  ///
252  const Box& getRegion() const;
253 
254  ///
255  const ProblemDomain& getDomain() const;
256 
257  ///
258  /**
259  This stuff required by LevelData in parallel:
260  */
261  int size(const Box& R, const Interval& comps) const;
262 
263  ///
264  void linearOut(void* buf, const Box& R, const Interval& comps) const;
265 
266  ///
267  void linearIn(void* buf, const Box& R, const Interval& comps);
268 
269  ///
270  static int preAllocatable()
271  {
272  return 2; // dyanmic allocatable.
273  }
274 
275  ///
276  bool isDefined() const;
277 
278  ///
279  bool isDomainSet() const;
280 
281  //stuff below is not part of the public API
282 
283  //define vofs to be the coarsened vofs of the inputs
284  //this must go first in coarsening. defines happen here
285  void coarsenVoFs(const EBGraphImplem& a_fineGraph,
286  const Box& a_coarRegion);
287 
288  //define the faces to be the coarsened faces of the input
289  void coarsenFaces(const EBGraphImplem& a_coarGhostGraph,
290  const EBGraphImplem& a_fineEBIS);
291 
292  //fix fineVoF->coarseVoF information of the input
293  void fixFineToCoarse(EBGraphImplem& a_fineEBIS) const;
294 
295  //don't ask
297  coarsenFaces(const VolIndex& a_coarVoF,
298  const EBGraphImplem& a_coarGhostGraph,
299  const EBGraphImplem& a_fineGraph,
300  const int& a_idir,
301  const Side::LoHiSide& a_sd);
302 
303  ///
304  void setDomain(const ProblemDomain& a_domain);
305 
306  ///
307  IntVectSet getIrregCells(const Box& a_subbox) const;
308 
309  ///
310  IntVectSet getMultiCells(const Box& a_subbox) const;
311 
312  ///
314  getAllFaces(const IntVect& a_iv,
315  const int& a_idir,
316  const Side::LoHiSide& a_sd) const;
317 
319  getIrregFaces(const Box& a_box, int a_dir) const;
320 
321 
322  void fillMask(BaseFab<char>& a_mask) const;
323 
324  ///
325  /**
326  0 outside problem domain
327  1 covered
328  2 regular
329  3 irregular
330  */
331  void fillCellTypeMask(BaseFab<char>& a_mask) const;
332 
333 
334  ///
335  /**
336  1 = regular
337  0 = irregular
338  -1 = covered
339  */
340  void fillIntMask(BaseFab<int>& a_mask) const;
341 
342 
343  ///
344  void addFullIrregularVoFs(const IntVectSet& a_vofsToChange,
345  const EBGraph& a_ghostGraph);
346 
347  void addEmptyIrregularVoFs(const IntVectSet& a_vofsToChange);
348 
349  ///
350  void
351  getRegNextToMultiValued(IntVectSet& a_vofsToChange,
352  const EBGraph& a_ghostGraph) const;
353 
354  ///
355  Vector<FaceIndex> getMultiValuedFaces(const int& a_idir, const Box& a_box, const EBGraph& a_ebgraph) const;
356 
357  //bool operator<(const EBGraphImplem& ebiin) const;
358 
359  const FaceIterator& FaceIteratorCache(const Box& a_region, int a_direction,
360  FaceStop::WhichFaces a_loc, const EBGraph& parent) const;
361 
362  const FaceIterator& FaceIteratorCache(const IntVectSet& ivs, int a_direction,
363  FaceStop::WhichFaces a_loc, const EBGraph& parent) const;
364 
365  const VoFIterator& VoFIteratorCache(const IntVectSet& ivs,
366  const EBGraph& parent) const;
367 
368 private:
369 
370  ///box over which this graph is defined
372 
373  ///computational domain at this level of refinement
375 
376  ///
377  /**
378  If this is allregular or allcovered,
379  the BaseFab below is undefined.
380  */
382 
383  ///
384  /**
385  the graph description of the box.
386  If the pointer GraphNode.m_thisNode == 0, the cell is covered.
387  If the pointer GraphNode.m_thisNode == 1, the cell is regular.
388  Otherwise, the pointer goes to the node of the graph.
389  */
391 
392  ///
394 
395  ///
397 
398  ///
400 
401  ///
403 
404  static bool s_verbose;
405 
406  //mutable because it gets built when needed
408  mutable bool m_isMaskBuilt;
409 
410 private:
411 
412  void operator=(const EBGraphImplem& ebiin)
413  {
414  MayDay::Error("invalid operator");
415  }
417  {
418  MayDay::Error("invalid operator");
419  }
420 
421  friend class EBIndexSpace;
422 };
423 
424 /// Geometric description within a box
425 /**
426  EBGraph represents the geometric information
427  of the domain at a given refinement
428  within the boundaries of a particular box.
429  This is a refcounted object with all
430  that implies.
431 */
432 class EBGraph
433 {
434 public:
435  ///
436  /**
437  The EBGraph can be all regular or all
438  covered or contain irregular cells.
439  */
440  enum TAG
441  {
445  };
446 
447  ///
448  /**
449  Makes an EBGraph whose contents are undefined.
450  */
451  EBGraph();
452 
453  ///
454  ~EBGraph();
455 
456  ///
457  /**
458  If the graph has irregular cells
459  get a mask over the size of the graph.
460  -1 for covered cells or multivalued cells, 0 for singlevalued irregular, and 1 for regular.
461  If the graph is all regular, regIrregCovered returns 1 and
462  the mask is undefined.
463  If the graph is all regular, regIrregCovered returns -1 and
464  the mask is undefined.
465  */
466  const BaseFab<int>& getMask(int& a_regIrregCovered) const;
467 
468  ///
469  /**
470  Return the VoFs in the cell.
471  */
472  Vector<VolIndex> getVoFs(const IntVect& a_iv) const;
473 
474  ///
475  int numVoFs(const IntVect& a_iv) const;
476 
477  ///
478  /**
479  Return true if every cell in the EBGraph is a regular cell.
480  */
481  bool isAllRegular() const;
482 
483  ///
484  /**
485  Return true neither all regular nor all covered
486  */
487  bool hasIrregular() const;
488 
489  ///
490  /**
491  Return true if every cell in the EBGraph is a covered cell.
492  */
493  bool isAllCovered() const;
494 
495  ///
496  /**
497  Return true if a_iv is an irregular cell.
498  */
499  bool isIrregular(const IntVect& a_iv) const;
500 
501  ///
502  /**
503  Return true if every cell in a_box is a
504  covered cell.
505  */
506  bool isCovered(const Box& a_box) const;
507 
508  ///
509  /**
510  Return true if every cell in a_box is a
511  regular cell.
512  */
513  bool isRegular(const Box& a_box) const;
514 
515  ///
516  bool isRegular(const IntVect& a_iv) const;
517 
518  ///
519  bool isCovered(const IntVect& a_iv) const;
520 
521  ///
522  bool isConnected(const VolIndex& a_vof1,
523  const VolIndex& a_vof2) const;
524  ///
525  /**
526  Return the faces on the side and direction
527  of the input VoF.
528  */
529  Vector<FaceIndex> getFaces(const VolIndex& a_vof,
530  const int& a_idir,
531  const Side::LoHiSide& a_sd) const;
532 
533  ///
534  Vector<Vector<VolIndex> > getVoFSets(const Box& a_region) const;
535  ///
536  /**
537  Returns the corresponding set of VoFs from the next finer
538  EBGraph (factor of two refinement). The result is only
539  defined if this {\tt EBGraph} was defined by coarsening.
540  */
541  Vector<VolIndex> refine(const VolIndex& a_coarVoF) const;
542 
543  ///
544  /**
545  Returns the corresponding set of faces from the next finer
546  EBGraph (factor of two refinement). The result is only
547  defined if this {\tt EBGraph} was defined by coarsening.
548  */
549  Vector<FaceIndex> refine(const FaceIndex& a_coarFace, const EBGraph& a_fineGraph) const;
550 
551  ///
552  /**
553  Returns the corresponding face from the next coarser
554  EBGraph (factor of two refinement). This only makes
555  sense if there is a coarser level.
556  */
557  FaceIndex coarsen(const FaceIndex& a_coarFace) const;
558 
559  ///
560  /**
561  Returns the corresponding VoF from the next coarser
562  EBGraph (same solution location, different index space, factor
563  of two refinement ratio).
564  */
565  VolIndex coarsen(const VolIndex& a_fineVoF) const;
566 
567  ///
568  /**
569  Define an all-regular EBGraph with the input box as its
570  region. The component argument is ignored.
571  This function is required by LevelData.
572  */
573  EBGraph(const Box& a_box, int a_comps);
574 
575  ///
576  /**
577  Completely construct the graph from IrregNodes.
578  This makes a DENSE representation of the graph. To make
579  sparse representations of all regular or all covered graphs,
580  use setToAllRegular or setToAllCovered.\\
581  irregGraph contains a complete list of irregular vofs. \\
582  validRegion is the the region of the graph \\
583  domain is the domain of compuation \\
584  regIrregCovered = 1 for regular, 0 for irregular, -1 for covered.
585  regIrregCovered must contain the valid region grown by 1. \\
586  In chombospeak, \\
587  regIrregCovered.box().contains(grow(validRegion, 1) & domain); \\
588  otherwise an error will result
589  */
590  void
591  buildGraph(const BaseFab<int>& a_regIrregCovered,
592  const Vector<IrregNode>& a_irregGraph,
593  const Box& a_validRegion,
594  const ProblemDomain& a_domain);
595 
596  ///
597  /**
598  Set the graph to all regular cells (sparse);
599  */
600  void setToAllRegular();
601 
602  ///
603  /**
604  Set the graph to all covered cells (sparse);
605  */
606  void setToAllCovered();
607 
608  ///
609  /**
610  Define an all-regular EBGraph with the input box as its
611  region.
612  */
613  void define(const Box& box);
614 
615  ///
616  /**
617  Copy the information from a_source to the over the intersection
618  of the box a_region, the box of the current EBGraph and
619  the box of a_source. The Interval arguments are ignored.
620  This function is required by LevelData.
621  */
622  void copy(const Box& a_regionFrom,
623  const Interval& Cd,
624  const Box& a_regionto,
625  const EBGraph& a_source,
626  const Interval& Cs);
627 
628  ///
629  const Box& getRegion() const;
630 
631  ///
632  const ProblemDomain& getDomain() const;
633 
634  ///
635  bool isDefined() const;
636 
637  ///
638  bool isDomainSet() const;
639 
640  //stuff below is not part of the public API
641 
642  //define vofs to be the coarsened vofs of the inputs
643  //this must go first in coarsening. defines happen here
644  void coarsenVoFs(const EBGraph& a_fineGraph,
645  const Box& a_coarRegion);
646 
647  //define the faces to be the coarsened faces of the input
648  void coarsenFaces(const EBGraph& a_coarGhostGraph,
649  const EBGraph& a_fineEBIS);
650 
651  //fix fineVoF->coarseVoF information of the input
652  void fixFineToCoarse(EBGraph& a_fineEBIS) const;
653 
654  //don't ask
656  coarsenFaces(const VolIndex& a_coarVoF,
657  const EBGraph& a_coarGhostGraph,
658  const EBGraph& a_fineGraph,
659  const int& a_idir,
660  const Side::LoHiSide& a_sd);
661 
662  ///
663  void setDomain(const ProblemDomain& a_domain);
664 
665  ///
666  IntVectSet getIrregCells(const Box& a_subbox) const;
667 
668  ///
669  IntVectSet getMultiCells(const Box& a_subbox) const;
670 
671  ///
672  EBGraph& operator=(const EBGraph& ebiin);
673 
674  ///
675  EBGraph(const EBGraph& a_ebiin);
676 
677  ///
679  getAllFaces(const IntVect& a_iv,
680  const int& a_idir,
681  const Side::LoHiSide& a_sd) const;
682 
683  ///
685  getIrregFaces(const Box& a_box, int a_dir) const;
686 
687  void fillMask(BaseFab<char>& a_mask) const;
688 
689  ///
690  /**
691  0 outside priblem domain
692  1 covered
693  2 regular
694  3 irregular
695  */
696  void fillCellTypeMask(BaseFab<char>& a_mask) const;
697 
698  ///
699  /**
700  1 = regular
701  0 = irregular
702  -1 = covered
703  */
704  void fillIntMask(BaseFab<int>& a_mask) const;
705 
706 
707  ///
708  EBGraph(const Box& box);
709  ///pointer comparison
710  bool operator==(const EBGraph& a_ebiin);
711 
712  /// pointer comparison
713  bool operator<(const EBGraph& a_ebiin) const;
714 
715  ///
716  /**
717  This stuff required by LevelData in parallel:
718  */
719  int size(const Box& R, const Interval& comps) const;
720 
721  ///
722  void linearOut(void* buf, const Box& R, const Interval& comps) const;
723 
724  ///
725  void linearIn(void* buf, const Box& R, const Interval& comps);
726 
727  ///
728  static int preAllocatable()
729  {
730  return 2; // dyanmic allocatable.
731  }
732 
733  ///
734  void addFullIrregularVoFs(const IntVectSet& a_vofsToChange,
735  const EBGraph& a_ghostGraph);
736 
737  void addEmptyIrregularVoFs(const IntVectSet& a_vofsToChange);
738 
739  ///
740  void
741  getRegNextToMultiValued(IntVectSet& a_vofsToChange,
742  const EBGraph& a_ghostGraph) const;
743 
744  ///
745  Vector<FaceIndex> getMultiValuedFaces(const int& a_idir, const Box& a_box) const;
746 
747  int numVoFs(const Box& a_box) const ;
748 
749  int numFaces(const Box& a_box, int a_dir) const ;
750 
751  const FaceIterator& FaceIteratorCache(const IntVectSet& ivs, int a_direction,
752  FaceStop::WhichFaces a_loc) const;
753 
754  const FaceIterator& FaceIteratorCache(const Box& a_region, int a_direction,
755  FaceStop::WhichFaces a_loc) const;
756 
757  const VoFIterator& VoFIteratorCache(const IntVectSet& ivs) const;
758 
759 private:
760 
761  ///
763 
764  friend class EBIndexSpace;
765 };
766 
767 // new code for binary portable IO of EBGraph objects. bvs
768 
769 template <>
770 void dataTypes(Vector<hid_t>& a_types, const EBGraph& a_dummySpecializationArg);
771 
772 template <>
773 void dataSize(const EBGraph& item, Vector<int>& a_sizes,
774  const Box& box, const Interval& comps);
775 
776 template <>
777 void write(const EBGraph& item, Vector<void*>& a_allocatedBuffers,
778  const Box& box, const Interval& comps);
779 
780 template <>
781 void read(EBGraph& item, Vector<void*>& a_allocatedBuffers, const Box& box,
782  const Interval& comps);
783 
784 template <>
785 const char* name(const EBGraph& a_dummySpecializationArg);
786 
787 
788 /*******************************/
789 /* inline EBGraph functions */
790 /*******************************/
791 
792 inline
793 const BaseFab<int>&
794 EBGraph::getMask(int& a_regIrregCovered) const
795 {
796  return m_implem->getMask(a_regIrregCovered);
797 }
798 
799 inline void
800 EBGraph::buildGraph(const BaseFab<int>& a_regIrregCovered,
801  const Vector<IrregNode>& a_irregGraph,
802  const Box& a_validRegion,
803  const ProblemDomain& a_domain)
804 {
805  m_implem->buildGraph(a_regIrregCovered, a_irregGraph, a_validRegion, a_domain);
806 }
807 /*******************************/
808 inline void EBGraph::copy(const Box& a_regionFrom,
809  const Interval& Cd,
810  const Box& a_regionTo,
811  const EBGraph& a_source,
812  const Interval& Cs)
813 {
814  m_implem->copy(a_regionFrom, Cd, a_regionTo,
815  *(a_source.m_implem), Cs);
816 }
817 /*******************************/
818 inline bool EBGraph::isDefined() const
819 {
820  return m_implem->isDefined();
821 }
822 /*******************************/
823 inline bool EBGraph::isConnected(const VolIndex& a_vof1,
824  const VolIndex& a_vof2) const
825 {
826  return m_implem->isConnected(a_vof1, a_vof2);
827 }
828 /*******************************/
829 inline const Box& EBGraph::getRegion() const
830 {
831  return m_implem->getRegion();
832 }
833 /*******************************/
834 inline EBGraph& EBGraph::operator=(const EBGraph& a_ebiin)
835 {
836  if (&a_ebiin != this)
837  {
838  m_implem = a_ebiin.m_implem;
839  }
840  return *this;
841 }
842 
843 /*******************************/
844 inline IntVectSet EBGraph::getMultiCells(const Box& a_subbox) const
845 {
846  return m_implem->getMultiCells(a_subbox);
847 }
848 /*******************************/
849 inline IntVectSet EBGraph::getIrregCells(const Box& a_subbox) const
850 {
851  return m_implem->getIrregCells(a_subbox);
852 }
853 /*******************************/
854 inline Vector<VolIndex> EBGraph::getVoFs(const IntVect& a_iv) const
855 {
856  return m_implem->getVoFs(a_iv);
857 }
858 /*******************************/
859 inline bool EBGraph::isRegular(const IntVect& a_iv) const
860 {
861  return m_implem->isRegular(a_iv);
862 }
863 /*******************************/
864 inline bool EBGraph::isAllRegular() const
865 {
866  return m_implem->isAllRegular();
867 }
868 /*******************************/
869 inline bool EBGraph::isAllCovered() const
870 {
871  return m_implem->isAllCovered();
872 }
873 /*******************************/
874 inline bool EBGraph::isIrregular(const IntVect& a_iv) const
875 {
876  return m_implem->isIrregular(a_iv);
877 }
878 /*******************************/
879 inline bool EBGraph::isCovered(const IntVect& a_iv) const
880 {
881  return m_implem->isCovered(a_iv);
882 }
883 /*******************************/
884 inline bool EBGraph::isCovered(const Box& a_box) const
885 {
886  return m_implem->isCovered(a_box);
887 }
888 /*******************************/
889 inline bool EBGraph::isRegular(const Box& a_box) const
890 {
891  return m_implem->isRegular(a_box);
892 }
893 /*******************************/
894 inline Vector<FaceIndex>
896  const int& a_idir,
897  const Side::LoHiSide& a_sd) const
898 {
899  return m_implem->getFaces(a_vof, a_idir, a_sd);
900 }
901 /*******************************/
902 inline Vector<VolIndex>
903 EBGraph::refine(const VolIndex& a_coarVoF) const
904 {
905  return m_implem->refine(a_coarVoF);
906 }
907 /*******************************/
908 inline Vector<FaceIndex>
909 EBGraph::refine(const FaceIndex& a_coarFace, const EBGraph& a_fineGraph) const
910 {
911  return m_implem->refine(a_coarFace, *a_fineGraph.m_implem);
912 }
913 /*******************************/
914 inline FaceIndex EBGraph::coarsen(const FaceIndex& a_fineFace) const
915 {
916  return m_implem->coarsen(a_fineFace);
917 }
918 /*******************************/
919 inline VolIndex EBGraph::coarsen(const VolIndex& a_fineVoF) const
920 {
921  return m_implem->coarsen(a_fineVoF);
922 }
923 /*******************************/
924 inline bool EBGraph::operator==(const EBGraph& a_ebiin)
925 {
926  return (m_implem == a_ebiin.m_implem);
927 }
928 /*******************************/
929 inline bool EBGraph::operator<(const EBGraph& a_ebiin) const
930 {
931  return (m_implem < a_ebiin.m_implem);
932 }
933 /*******************************/
934 inline const ProblemDomain& EBGraph::getDomain() const
935 {
936  return (m_implem->getDomain());
937 }
938 /*******************************/
939 inline void EBGraph::setDomain(const ProblemDomain& a_domain)
940 {
941  m_implem->setDomain(a_domain);
942 }
943 /*******************************/
945 {
946  m_implem->setToAllRegular();
947 }
948 /*******************************/
950 {
951  m_implem->setToAllCovered();
952 }
953 /*******************************/
954 inline void EBGraph::
955 coarsenVoFs(const EBGraph& a_fineEBIS,
956  const Box& a_coarRegion)
957 {
958  m_implem->coarsenVoFs(*a_fineEBIS.m_implem, a_coarRegion);
959 }
960 /*******************************/
961 inline void EBGraph::
962 coarsenFaces(const EBGraph& a_coarGhost, const EBGraph& a_fineEBIS)
963 {
964  m_implem->coarsenFaces(*a_coarGhost.m_implem, *a_fineEBIS.m_implem);
965 }
966 /*******************************/
967 inline void EBGraph::
968 fixFineToCoarse(EBGraph& a_fineEBIS) const
969 {
970  m_implem->fixFineToCoarse(*a_fineEBIS.m_implem);
971 }
972 /*******************************/
973 inline Vector<FaceIndex>
975  const int& a_idir,
976  const Side::LoHiSide& a_sd) const
977 {
978  return m_implem->getAllFaces(a_iv, a_idir, a_sd);
979 }
980 
981 /*******************************/
982 
983 inline int
984 EBGraph::numVoFs(const IntVect& a_iv) const
985 {
986  return m_implem->numVoFs(a_iv);
987 }
988 
989 inline
990 const FaceIterator& EBGraph::FaceIteratorCache(const Box& a_region, int a_direction,
991  FaceStop::WhichFaces a_loc) const
992 {
993  return m_implem->FaceIteratorCache(a_region, a_direction, a_loc, *this);
994 }
995 
996 inline
997 const FaceIterator& EBGraph::FaceIteratorCache(const IntVectSet& a_region, int a_direction,
998  FaceStop::WhichFaces a_loc) const
999 {
1000  return m_implem->FaceIteratorCache(a_region, a_direction, a_loc, *this);
1001 }
1002 inline
1004 {
1005  return m_implem->VoFIteratorCache(ivs, *this);
1006 }
1007 
1008 #include "NamespaceFooter.H"
1009 #endif
Vector< VolIndex > getVoFs(const IntVect &a_iv) const
int size(const Box &R, const Interval &comps) const
TAG
Definition: EBGraph.H:55
Vector< FaceIndex > getIrregFaces(const Box &a_box, int a_dir) const
Vector< VolIndex > getVoFs(const IntVect &a_iv) const
Definition: EBGraph.H:854
void dataTypes(Vector< hid_t > &a_types, const EBGraph &a_dummySpecializationArg)
bool isConnected(const VolIndex &a_vof1, const VolIndex &a_vof2) const
Definition: EBGraph.H:823
int numVoFs(const IntVect &a_iv) const
Definition: EBGraph.H:984
Box m_region
box over which this graph is defined
Definition: EBGraph.H:371
void setDomain(const ProblemDomain &a_domain)
bool isAllCovered() const
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
Vector< VolIndex > refine(const VolIndex &a_coarVoF) const
Definition: EBGraph.H:903
static IntVect s_ivDebug
Definition: EBGraph.H:47
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
bool isAllRegular() const
Definition: EBGraph.H:864
ProblemDomain m_domain
computational domain at this level of refinement
Definition: EBGraph.H:374
Definition: EBIndexSpace.H:260
Definition: EBGraph.H:57
Definition: EBGraph.H:443
Definition: EBGraph.H:59
static Box s_doDebug
Definition: EBGraph.H:48
Definition: FaceIndex.H:28
EBGraph & operator=(const EBGraph &ebiin)
Definition: EBGraph.H:834
bool isDefined() const
void coarsenVoFs(const EBGraphImplem &a_fineGraph, const Box &a_coarRegion)
void setToAllRegular()
Definition: EBGraph.H:944
void linearIn(void *buf, const Box &R, const Interval &comps)
const VoFIterator & VoFIteratorCache(const IntVectSet &ivs) const
Definition: EBGraph.H:1003
Iterator over faces within an IntVectSet and an Ebgraph.
Definition: FaceIterator.H:67
bool isAllCovered() const
Definition: EBGraph.H:869
IntVectSet * m_irregIVS
Definition: EBGraph.H:399
const ProblemDomain & getDomain() const
Definition: EBGraph.H:934
void fillCellTypeMask(BaseFab< char > &a_mask) const
bool isIrregular(const IntVect &a_iv) const
Definition: EBGraph.H:874
BaseFab< int > m_mask
Definition: EBGraph.H:407
bool m_isDomainSet
Definition: EBGraph.H:396
void define(const Box &box)
void buildGraph(const BaseFab< int > &a_regIrregCovered, const Vector< IrregNode > &a_irregGraph, const Box &a_validRegion, const ProblemDomain &a_domain)
Definition: EBGraph.H:800
Definition: EBGraph.H:58
void setToAllCovered()
Definition: EBGraph.H:949
FaceIndex coarsen(const FaceIndex &a_coarFace) const
Definition: EBGraph.H:914
Geometric description within a box.
Definition: EBGraph.H:432
Geometric description within a box.
Definition: EBGraph.H:44
Definition: EBInterface.H:45
EBGraphImplem(const EBGraphImplem &ebiin)
Definition: EBGraph.H:416
Vector< VolIndex > refine(const VolIndex &a_coarVoF) const
bool m_isDefined
Definition: EBGraph.H:393
void setToAllRegular()
int numFaces(const Box &a_box, int a_dir) const
void dataSize(const EBGraph &item, Vector< int > &a_sizes, const Box &box, const Interval &comps)
bool isDefined() const
Definition: EBGraph.H:818
static bool s_verbose
Definition: EBGraph.H:404
Structure for passing component ranges in code.
Definition: Interval.H:23
void fillIntMask(BaseFab< int > &a_mask) const
bool hasIrregular() const
const char * name(const EBGraph &a_dummySpecializationArg)
Vector< FaceIndex > getFaces(const VolIndex &a_vof, const int &a_idir, const Side::LoHiSide &a_sd) const
const BaseFab< int > & getMask(int &a_regIrregCovered) const
static void checkGraph(const BaseFab< int > &a_regIrregCovered, const Vector< IrregNode > &a_irregGraph, const Box &a_validRegion, const ProblemDomain &a_domain)
check if a box worth of graph is self consistent
IntVectSet getMultiCells(const Box &a_subbox) const
Definition: EBGraph.H:844
FaceIndex coarsen(const FaceIndex &a_coarFace) const
Vector< FaceIndex > getFaces(const VolIndex &a_vof, const int &a_idir, const Side::LoHiSide &a_sd) const
Definition: EBGraph.H:895
bool operator<(const FaceIndex &f1, const FaceIndex &f2)
Definition: FaceIndex.H:204
Vector< Vector< VolIndex > > getVoFSets(const Box &a_region) const
bool isConnected(const VolIndex &a_vof1, const VolIndex &a_vof2) const
void addFullIrregularVoFs(const IntVectSet &a_vofsToChange, const EBGraph &a_ghostGraph)
bool isRegular(const Box &a_box) const
Definition: EBGraph.H:889
LoHiSide
Definition: LoHiSide.H:27
void fillMask(BaseFab< char > &a_mask) const
bool isRegular(const Box &a_box) const
bool isCovered(const Box &a_box) const
void getRegNextToMultiValued(IntVectSet &a_vofsToChange, const EBGraph &a_ghostGraph) const
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.
IntVectSet getMultiCells(const Box &a_subbox) const
void fixFineToCoarse(EBGraph &a_fineEBIS) const
Definition: EBGraph.H:968
void coarsenFaces(const EBGraph &a_coarGhostGraph, const EBGraph &a_fineEBIS)
Definition: EBGraph.H:962
void copy(const Box &a_regionFrom, const Interval &Cd, const Box &a_regionto, const EBGraphImplem &a_source, const Interval &Cs)
const Box & getRegion() const
IntVectSet getIrregCells(const Box &a_subbox) const
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
RefCountedPtr< EBGraphImplem > m_implem
Definition: EBGraph.H:762
void fixFineToCoarse(EBGraphImplem &a_fineEBIS) const
const FaceIterator & FaceIteratorCache(const IntVectSet &ivs, int a_direction, FaceStop::WhichFaces a_loc) const
Definition: EBGraph.H:997
BaseFab< GraphNode > m_graph
Definition: EBGraph.H:390
static int preAllocatable()
Definition: EBGraph.H:270
void setToAllCovered()
Iterator for all vofs within an IntVectSet and an Ebgraph.
Definition: VoFIterator.H:27
void linearOut(void *buf, const Box &R, const Interval &comps) const
bool m_isMaskBuilt
Definition: EBGraph.H:408
bool operator<(const EBGraph &a_ebiin) const
pointer comparison
Definition: EBGraph.H:929
IntVectSet * m_multiIVS
Definition: EBGraph.H:402
TAG m_tag
Definition: EBGraph.H:381
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
void setDomain(const ProblemDomain &a_domain)
Definition: EBGraph.H:939
bool isIrregular(const IntVect &a_iv) const
bool isDomainSet() const
void read(EBGraph &item, Vector< void *> &a_allocatedBuffers, const Box &box, const Interval &comps)
bool isCovered(const Box &a_box) const
Definition: EBGraph.H:884
Volume of Fluid Index.
Definition: VolIndex.H:31
const VoFIterator & VoFIteratorCache(const IntVectSet &ivs, const EBGraph &parent) const
Vector< FaceIndex > getAllFaces(const IntVect &a_iv, const int &a_idir, const Side::LoHiSide &a_sd) const
Vector< FaceIndex > getAllFaces(const IntVect &a_iv, const int &a_idir, const Side::LoHiSide &a_sd) const
Definition: EBGraph.H:974
bool operator==(const EBGraph &a_ebiin)
pointer comparison
Definition: EBGraph.H:924
TAG
Definition: EBGraph.H:440
void copy(const Box &a_regionFrom, const Interval &Cd, const Box &a_regionto, const EBGraph &a_source, const Interval &Cs)
Definition: EBGraph.H:808
static int preAllocatable()
Definition: EBGraph.H:728
bool isAllRegular() const
Vector< FaceIndex > getMultiValuedFaces(const int &a_idir, const Box &a_box, const EBGraph &a_ebgraph) const
int numVoFs(const IntVect &a_iv) const
void addEmptyIrregularVoFs(const IntVectSet &a_vofsToChange)
const BaseFab< int > & getMask(int &a_regIrregCovered) const
Definition: EBGraph.H:794
void coarsenFaces(const EBGraphImplem &a_coarGhostGraph, const EBGraphImplem &a_fineEBIS)
void buildGraph(const BaseFab< int > &a_regIrregCovered, const Vector< IrregNode > &a_irregGraph, const Box &a_validRegion, const ProblemDomain &a_domain)
void coarsenVoFs(const EBGraph &a_fineGraph, const Box &a_coarRegion)
Definition: EBGraph.H:955
const Box & getRegion() const
Definition: EBGraph.H:829
IntVectSet getIrregCells(const Box &a_subbox) const
Definition: EBGraph.H:849
WhichFaces
Definition: FaceIterator.H:45
void operator=(const EBGraphImplem &ebiin)
Definition: EBGraph.H:412
const FaceIterator & FaceIteratorCache(const Box &a_region, int a_direction, FaceStop::WhichFaces a_loc, const EBGraph &parent) const
const ProblemDomain & getDomain() const
void write(const EBGraph &item, Vector< void *> &a_allocatedBuffers, const Box &box, const Interval &comps)