00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _CFREGION_H_ 00012 #define _CFREGION_H_ 00013 00014 #include "REAL.H" 00015 #include "BaseFab.H" 00016 #include "FArrayBox.H" 00017 #include "LayoutData.H" 00018 #include "DisjointBoxLayout.H" 00019 #include "CFIVS.H" 00020 #include "NamespaceHeader.H" 00021 00022 00023 /// Class that represents the edge region around a DisjointBoxLayout 00024 /** 00025 00026 00027 */ 00028 class CFRegion 00029 { 00030 public: 00031 00032 /// 00033 /** 00034 Default constructor. User must subsequently call define(). 00035 */ 00036 CFRegion():m_defined(false) 00037 { 00038 } 00039 00040 /// 00041 /** 00042 Destructor. 00043 */ 00044 virtual ~CFRegion() 00045 { 00046 } 00047 00048 CFRegion(const CFRegion& a_rhs) 00049 { 00050 *this = a_rhs; 00051 } 00052 00053 /// 00054 /** 00055 Defining constructor. Constructs a valid object. 00056 Equivalent to default construction followed by define(). 00057 00058 */ 00059 CFRegion(const DisjointBoxLayout& a_grids, 00060 const ProblemDomain& a_domain) 00061 { 00062 define(a_grids, a_domain); 00063 } 00064 /// 00065 /** 00066 Defines this object. Existing information is overriden. 00067 */ 00068 void 00069 define(const DisjointBoxLayout& a_grids, 00070 const ProblemDomain& a_domain); 00071 00072 00073 const CFRegion& operator=(const CFRegion& a_rhs); 00074 00075 const CFIVS& loCFIVS(const DataIndex& a_dit, int dir); 00076 const CFIVS& hiCFIVS(const DataIndex& a_dit, int dir); 00077 00078 void coarsen(int refRatio); 00079 00080 protected: 00081 00082 LayoutData<CFIVS> m_loCFIVS[SpaceDim]; 00083 LayoutData<CFIVS> m_hiCFIVS[SpaceDim]; 00084 bool m_defined; 00085 }; 00086 00087 #include "NamespaceFooter.H" 00088 #endif