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 // ANAG, LBNL 00012 00013 #ifndef _IRREGNODE_H_ 00014 #define _IRREGNODE_H_ 00015 00016 #include "REAL.H" 00017 #include "IntVect.H" 00018 #include "IntVectSet.H" 00019 #include "VolIndex.H" 00020 #include "Interval.H" 00021 #include "FaceIndex.H" 00022 #include "IntVectSet.H" 00023 #include "RealVect.H" 00024 #include "BaseFab.H" 00025 #include "IndexedMoments.H" 00026 #include "EB_TYPEDEFS.H" 00027 #include "SPMD.H" 00028 #include "NamespaceHeader.H" 00029 /// 00030 /** 00031 Node for construction of geometric information. 00032 */ 00033 class IrregNode 00034 { 00035 public: 00036 /// 00037 IrregNode(); 00038 00039 /// 00040 ~IrregNode(); 00041 00042 ///return the index into the arc vectors 00043 static int index(int a_idir, Side::LoHiSide a_side) ; 00044 00045 /// 00046 IntVect m_cell; 00047 ///data for irregular nodes 00048 00049 //volume centered data 00050 /// 00051 Real m_volFrac; 00052 00053 /// 00054 /** 00055 each vof has a unique index in the cell 00056 */ 00057 int m_cellIndex; 00058 00059 /// 00060 RealVect m_volCentroid; 00061 00062 /// 00063 RealVect m_bndryCentroid; 00064 00065 //face centered irregular data 00066 00067 /// 00068 /** 00069 Indicies into a_nodes to show connectivity. 00070 If the arc is to an irregular 00071 cell, the index is the unique index of the vof 00072 in the cell. 00073 For arcs to regular cells, the arc = -2 00074 If the arc is to the domain boundary, arc = -1. 00075 */ 00076 Vector<int> m_arc[2*SpaceDim]; 00077 00078 /// 00079 Vector<Real> m_areaFrac[2*SpaceDim]; 00080 00081 /// 00082 Vector<RealVect> m_faceCentroid[2*SpaceDim]; 00083 00084 /// 00085 /** 00086 helper function for construction. makes irregular cell 00087 that has connectivitity and values like a regular cell, this 00088 a person can modify as the irregular cell requires. saves 00089 some coding in some cases 00090 */ 00091 void makeRegular(const IntVect& iv, const Real& a_dx, const ProblemDomain& a_domain); 00092 void faceReserve(int location, int size); 00093 00094 00095 00096 ///for covered cells 00097 void setMomentsToZero(); 00098 00099 //for regular cells 00100 void setMomentsToRegular(const Real& a_dx); 00101 00102 ///data for irregular nodes 00103 00104 //volume centered data 00105 00106 /// the moment at the VoF associated with the monomial with the input exponents 00107 /** 00108 Given VoF variables x, y, z, p = mono(0), q = mono(1), r = mono(2), 00109 returns integral_over_VoF(x^p y^q z^r dV) 00110 **/ 00111 IndMomSpaceDim m_volumeMoments; 00112 00113 /// the normal*moment at the irregular face associated with the monomial with the input exponents 00114 /** 00115 Given VoF variables x, y, z, p = mono(0), q = mono(1), r = mono(2), 00116 returns integral_over_irregular_area((x^p y^q z^r)*n_i dA) 00117 **/ 00118 //NOT FILLED YET 00119 #if 0 00120 IndMomSpaceDim m_EBNormalMoments[SpaceDim]; 00121 #endif 00122 00123 /// the moment at the irregular face associated with the monomial with the input exponents 00124 /** 00125 Given VoF variables x, y, z, p = mono(0), q = mono(1), r = mono(2), 00126 returns integral_over_irregular_area((x^p y^q z^r) dA) 00127 **/ 00128 IndMomSpaceDim m_EBMoments; 00129 00130 IndMomSpaceDim m_normalPartialDeriv[SpaceDim]; 00131 ///face centered moments 00132 /// the moment at the face associated with the monomial with the input exponents 00133 /** 00134 Given face variables x, y, p = mono(0), q = mono(1) 00135 returns integral_over_face_area((x^p y^q ) dA) 00136 **/ 00137 IndMomSDMinOne m_faceMoments[2*SpaceDim]; 00138 00139 void spout() 00140 { 00141 pout() << "irreg node" << endl; 00142 pout() << "volume moments " << endl; 00143 m_volumeMoments.spout(); 00144 00145 pout() << "EB moments " << endl; 00146 m_EBMoments.spout(); 00147 00148 for(int iindex = 0; iindex <2*SpaceDim; iindex++) 00149 { 00150 pout() << "face moments index " << iindex << endl; 00151 m_faceMoments[iindex].spout(); 00152 } 00153 } 00154 00155 ///once the moments are set, this sets volfrac, areafrac, centroid... 00156 void setNormalizedStuff(const Real& a_dx); 00157 }; 00158 00159 00160 std::ostream& operator<< (std::ostream& a_os, 00161 const IrregNode& a_iv); 00162 00163 #include "NamespaceFooter.H" 00164 #endif