48 cout << endl << endl <<
"Tetrahdral mesh generation" << endl;
53 map<int, NodeSharedPtr> TetgenIdToNode;
54 map<int, int> NodeIdToTetgenId;
61 map<int, NekDouble> TetgenIdToDelta;
62 vector<Array<OneD, int> >
69 for (
int i = 0; i <
m_mesh->m_element[2].size(); i++)
73 "quad found in surface mesh with no prism mapping");
75 vector<NodeSharedPtr> n =
m_mesh->m_element[2][i]->GetVertexList();
76 Array<OneD, int> tri(3);
77 for (
int j = 0; j < n.size(); j++)
80 it = NodeIdToTetgenId.find(n[j]->m_id);
81 if (it == NodeIdToTetgenId.end())
84 NodeIdToTetgenId[n[j]->m_id] = cnt;
85 TetgenIdToNode[cnt] = n[j];
86 TetgenIdToDelta[cnt] =
m_octree->Query(n[j]->GetLoc());
94 surfacetris.push_back(tri);
104 for (
int i = 0; i <
m_mesh->m_element[2].size(); i++)
106 if (
m_mesh->m_element[2][i]->GetConf().m_e !=
117 vector<NodeSharedPtr> n =
118 m_mesh->m_element[2][i]->GetVertexList();
119 Array<OneD, int> tri(3);
120 for (
int j = 0; j < n.size(); j++)
123 it = NodeIdToTetgenId.find(n[j]->m_id);
124 if (it == NodeIdToTetgenId.end())
127 NodeIdToTetgenId[n[j]->m_id] = cnt;
128 TetgenIdToNode[cnt] = n[j];
129 TetgenIdToDelta[cnt] =
m_octree->Query(n[j]->GetLoc());
137 surfacetris.push_back(tri);
143 vector<NodeSharedPtr> n = fit->second->m_vertexList;
144 Array<OneD, int> tri(3);
145 for (
int j = 0; j < n.size(); j++)
148 it = NodeIdToTetgenId.find(n[j]->m_id);
149 if (it == NodeIdToTetgenId.end())
152 NodeIdToTetgenId[n[j]->m_id] = cnt;
153 TetgenIdToNode[cnt] = n[j];
154 TetgenIdToDelta[cnt] =
m_octree->Query(n[j]->GetLoc());
162 surfacetris.push_back(tri);
169 cout <<
"\tInital Node Count: " << TetgenIdToNode.size() << endl;
172 tetgen->InitialMesh(TetgenIdToNode, surfacetris);
174 vector<Array<OneD, NekDouble> > newp;
175 int ctbefore = TetgenIdToNode.size();
182 tetgen->GetNewPoints(ctbefore, newp);
183 for (
int i = 0; i < newp.size(); i++)
186 TetgenIdToDelta[ctbefore + i] = d;
188 tetgen->RefineMesh(TetgenIdToDelta);
189 }
while (newpb != newp.size());
193 tetgen->GetNewPoints(ctbefore, newp);
194 for (
int i = 0; i < newp.size(); i++)
197 new Node(
m_mesh->m_numNodes++, newp[i][0], newp[i][1], newp[i][2]));
198 TetgenIdToNode[ctbefore + i] = n;
208 vector<NodeSharedPtr> n;
219 m_mesh->m_element[3].push_back(E);
std::vector< Array< OneD, int > > m_tetconnect
conncetivity of the tets from the interface
#define ASSERTL0(condition, msg)
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
OctreeSharedPtr m_octree
octree object
BLMeshSharedPtr m_blmesh
bl mesh
ElementFactory & GetElementFactory()
boost::shared_ptr< TetGenInterface > TetGenInterfaceSharedPtr
std::map< int, FaceSharedPtr > m_surftopriface
boost::shared_ptr< Node > NodeSharedPtr
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< Element > ElementSharedPtr