48 cout << endl << endl <<
"Tetrahdral mesh generation" << endl;
52 map<int, NodeSharedPtr> IdToNode;
53 map<NodeSharedPtr, int> IdToNodeRev;
57 map<int, NekDouble> IdToDelta;
58 vector<Array<OneD, int> > surfacetris;
69 vector<NodeSharedPtr> n =
m_surface[i]->GetVertexList();
70 Array<OneD, int> tri(3);
71 for(
int j = 0; j < n.size(); j++)
73 pair<NodeSet::iterator,bool> testIns =
74 alreadyInSurface.insert(n[j]);
84 IdToNodeRev[n[j]] = cnt;
85 IdToDelta[cnt] =
m_mesh->m_octree->Query(n[j]->GetLoc());
90 tri[j] = IdToNodeRev[(*testIns.first)];
93 surfacetris.push_back(tri);
103 cout <<
"\tInital Node Count: " << IdToNode.size() << endl;
106 tetgen->InitialMesh(IdToNode, surfacetris);
108 vector<Array<OneD, NekDouble> > newp;
109 int ctbefore = IdToNode.size();
115 tetgen->GetNewPoints(ctbefore, newp);
116 for (
int i = 0; i < newp.size(); i++)
119 IdToDelta[ctbefore + i] = d;
121 tetgen->RefineMesh(IdToDelta);
122 }
while (newpb != newp.size());
126 tetgen->GetNewPoints(ctbefore, newp);
127 for (
int i = 0; i < newp.size(); i++)
130 new Node(ctbefore + i, newp[i][0], newp[i][1], newp[i][2]));
131 IdToNode[ctbefore + i] = n;
141 vector<NodeSharedPtr> n;
148 tags.push_back(
m_id);
152 m_mesh->m_element[3].push_back(E);
std::vector< Array< OneD, int > > m_tetconnect
conncetivity of the tets from the interface
TetGenInterfaceSharedPtr tetgen
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.
ElementFactory & GetElementFactory()
boost::unordered_set< NodeSharedPtr, NodeHash > NodeSet
boost::shared_ptr< Node > NodeSharedPtr
std::vector< ElementSharedPtr > m_surface
boost::shared_ptr< Element > ElementSharedPtr