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 _STLBOX_H_ 00012 #define _STLBOX_H_ 00013 00014 #include "ProblemDomain.H" 00015 #include "RealVect.H" 00016 #include "IntVect.H" 00017 #include "Box.H" 00018 #include "RefCountedPtr.H" 00019 00020 #include "STLMesh.H" 00021 #include "STLUtil.H" 00022 00023 #include "NamespaceHeader.H" 00024 00025 using namespace STLUtil; 00026 00027 /* 00028 * This is just a class to hold data that associates 00029 * a Chombo Box with an STL mesh. It has, e.g., maps 00030 * between Chombo cells and the STL vertices that lie 00031 * within them. The class also includes some get 00032 * functions and print functions for its members 00033 */ 00034 00035 class STLBox 00036 { 00037 public: 00038 00039 STLBox(RefCountedPtr<STLMesh> a_stlmesh, 00040 const Box& a_region, 00041 const ProblemDomain& a_domain, 00042 const RealVect& a_origin, 00043 const RealVect& a_dx); 00044 00045 void SetMeshBox(RefCountedPtr<STLMesh> a_stlmesh, 00046 const Box& a_region, 00047 const ProblemDomain& a_domain, 00048 const RealVect& a_origin, 00049 const RealVect& a_dx); 00050 00051 RefCountedPtr<STLMesh> m_msh; // pointer to mesh 00052 00053 // box that we're exploring 00054 Box m_region; 00055 ProblemDomain m_domain; 00056 RealVect m_origin; 00057 RealVect m_dx; 00058 00059 // for each cell, a Vector of the vertices and a Vector of the triangles 00060 // that wholly or partially are contained by the cell 00061 // vertices and triangles are specified by index (see STLStruct.H for TriInCell) 00062 CellMap m_cellmap; 00063 00064 // for each Chombo node, whether it is 'inside' or 'outside' 00065 // according to the normal vectors specified in the STL file and mesh.triangles.normal 00066 NodeMap m_nodemap; 00067 00068 // for each Chombo edge that intersects the boundary, store the 00069 // intersection point (since we already compute it, this just makes 00070 // it faster to retrieve for queries) 00071 EdgeMap m_edgemap; 00072 00073 // get maps 00074 void GetCellMap(CellMap** a_cellmap); 00075 void GetNodeMap(NodeMap** a_nodemap); 00076 void GetEdgeMap(EdgeMap** a_edgemap); 00077 }; 00078 00079 #include "NamespaceFooter.H" 00080 #endif 00081