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