Commit fb563319 authored by Dave Moxey's avatar Dave Moxey
Browse files

Working high-order boundary information

parent 453fc041
......@@ -74,10 +74,16 @@ Element::Element(ElmtConfig pConf, unsigned int pNumNodes,
* @param p Index of the vertex to replace.
* @param pNew New vertex.
*/
void Element::SetVertex(unsigned int p, NodeSharedPtr pNew)
void Element::SetVertex(unsigned int p, NodeSharedPtr pNew, bool descend)
{
NodeSharedPtr vOld = m_vertex[p];
m_vertex[p] = pNew;
if (!descend)
{
return;
}
for (unsigned int i = 0; i < m_edge.size(); ++i)
{
if (m_edge[i]->m_n1 == vOld)
......@@ -122,10 +128,16 @@ void Element::SetVertex(unsigned int p, NodeSharedPtr pNew)
* @param p Index of the edge to replace.
* @param pNew New edge.
*/
void Element::SetEdge(unsigned int p, EdgeSharedPtr pNew)
void Element::SetEdge(unsigned int p, EdgeSharedPtr pNew, bool descend)
{
EdgeSharedPtr vOld = m_edge[p];
m_edge[p] = pNew;
if (!descend)
{
return;
}
for (unsigned int i = 0; i < m_face.size(); ++i)
{
for (unsigned int j = 0; j < m_face[i]->m_edgeList.size(); ++j)
......
......@@ -244,9 +244,9 @@ public:
m_id = p;
}
/// Replace a vertex with another vertex object.
NEKMESHUTILS_EXPORT void SetVertex(unsigned int p, NodeSharedPtr pNew);
NEKMESHUTILS_EXPORT void SetVertex(unsigned int p, NodeSharedPtr pNew, bool descend = true);
/// Replace an edge with another edge object.
NEKMESHUTILS_EXPORT void SetEdge(unsigned int p, EdgeSharedPtr pNew);
NEKMESHUTILS_EXPORT void SetEdge(unsigned int p, EdgeSharedPtr pNew, bool descend = true);
/// Replace a face with another face object.
NEKMESHUTILS_EXPORT void SetFace(unsigned int p, FaceSharedPtr pNew);
/// Set a correspondence between this element and an edge
......
......@@ -249,7 +249,6 @@ public:
const int nTriPts = nPoints * (nPoints + 1) / 2;
const int nTriIntPts = (nPoints - 3) * (nPoints - 2) / 2;
m_faceNodes.resize(nTriIntPts);
std::cout << "num tri int pts: " << nTriIntPts << " " << nTriPts << " " << nPoints << std::endl;
for (int i = 3 + 3*(nPoints-2), cnt = 0; i < nTriPts; ++i, ++cnt)
{
......
......@@ -214,12 +214,13 @@ void Module::ProcessEdges(bool ReprocessEdges)
// Create links for 1D elements
for (int i = 0; i < m_mesh->m_element[1].size(); ++i)
{
NodeSharedPtr v0 = m_mesh->m_element[1][i]->GetVertex(0);
NodeSharedPtr v1 = m_mesh->m_element[1][i]->GetVertex(1);
ElementSharedPtr elmt = m_mesh->m_element[1][i];
NodeSharedPtr v0 = elmt->GetVertex(0);
NodeSharedPtr v1 = elmt->GetVertex(1);
vector<NodeSharedPtr> edgeNodes;
EdgeSharedPtr E = boost::shared_ptr<Edge>(
new Edge(v0, v1, edgeNodes,
m_mesh->m_element[1][i]->GetConf().m_edgeCurveType));
new Edge(v0, v1, edgeNodes, elmt->GetConf().m_edgeCurveType));
EdgeSet::iterator it = m_mesh->m_edgeSet.find(E);
if (it == m_mesh->m_edgeSet.end())
{
......@@ -227,20 +228,25 @@ void Module::ProcessEdges(bool ReprocessEdges)
<< "1D element " << i << endl;
abort();
}
m_mesh->m_element[1][i]->SetEdgeLink(*it);
elmt->SetEdgeLink(*it);
// Update 2D element boundary map.
pair<ElementSharedPtr, int> eMap = (*it)->m_elLink.at(0);
eMap.first->SetBoundaryLink(eMap.second, i);
// Update vertices
elmt->SetVertex(0, (*it)->m_n1, false);
elmt->SetVertex(1, (*it)->m_n2, false);
// Copy curvature to edge.
if ((*it)->m_edgeNodes.size() > 0)
{
ElementSharedPtr edge = m_mesh->m_element[1][i];
ElementSharedPtr edge = elmt;
if (edge->GetVertex(0) == (*it)->m_n1)
{
edge->SetVolumeNodes((*it)->m_edgeNodes);
}
elmt->SetCurveType((*it)->m_curveType);
}
}
}
......@@ -283,14 +289,14 @@ void Module::ProcessFaces(bool ReprocessFaces)
{
(*(testIns.first))->m_id = fid++;
(*(testIns.first))->m_elLink.push_back(
pair<ElementSharedPtr,int>(elmt[i],j));
pair<ElementSharedPtr,int>(elmt[i],j));
}
else
{
elmt[i]->SetFace(j,*testIns.first);
// Update face to element map.
(*(testIns.first))->m_elLink.push_back(
pair<ElementSharedPtr,int>(elmt[i],j));
pair<ElementSharedPtr,int>(elmt[i],j));
}
}
}
......@@ -299,12 +305,14 @@ void Module::ProcessFaces(bool ReprocessFaces)
// Create links for 2D elements
for (int i = 0; i < m_mesh->m_element[2].size(); ++i)
{
vector<NodeSharedPtr> vertices = m_mesh->m_element[2][i]->GetVertexList();
ElementSharedPtr elmt = m_mesh->m_element[2][i];
vector<NodeSharedPtr> vertices = elmt->GetVertexList();
vector<NodeSharedPtr> faceNodes;
vector<EdgeSharedPtr> edgeList = m_mesh->m_element[2][i]->GetEdgeList();
vector<EdgeSharedPtr> edgeList = elmt->GetEdgeList();
FaceSharedPtr F = boost::shared_ptr<Face>(
new Face(vertices, faceNodes, edgeList,
m_mesh->m_element[2][i]->GetConf().m_faceCurveType));
elmt->GetConf().m_faceCurveType));
FaceSet::iterator it = m_mesh->m_faceSet.find(F);
if (it == m_mesh->m_faceSet.end())
{
......@@ -312,11 +320,26 @@ void Module::ProcessFaces(bool ReprocessFaces)
<< "element " << i << endl;
abort();
}
m_mesh->m_element[2][i]->SetFaceLink(*it);
elmt->SetFaceLink(*it);
// Set edges/vertices
for (int j = 0; j < elmt->GetVertexCount(); ++j)
{
elmt->SetVertex(j, (*it)->m_vertexList[j], false);
elmt->SetEdge(j, (*it)->m_edgeList[j], false);
}
// Update 3D element boundary map.
pair<ElementSharedPtr, int> eMap = (*it)->m_elLink.at(0);
eMap.first->SetBoundaryLink(eMap.second, i);
// Copy face curvature
if ((*it)->m_faceNodes.size() > 0)
{
elmt->SetVolumeNodes((*it)->m_faceNodes);
elmt->SetCurveType((*it)->m_curveType);
}
}
}
......
......@@ -212,18 +212,11 @@ void OutputGmsh::Process()
tags.push_back(nodeList[j]->m_id);
}
cout << "GOT " << nodeList.size() << " VERTS" << endl;
cout << "GOT " << edgeList.size() << " EDGES" << endl;
cout << "GOT " << faceList.size() << " FACES" << endl;
cout << "GOT " << volList.size() << " VOLS" << endl;
// Process edge-interior points
for (int j = 0; j < edgeList.size(); ++j)
{
nodeList = edgeList[j]->m_edgeNodes;
cout << "edge " << j << ": " << edgeList[j]->m_edgeNodes.size() << endl;
if (e->GetEdgeOrient(j, edgeList[j]) == StdRegions::eForwards)
{
for (int k = 0; k < nodeList.size(); ++k)
......@@ -276,7 +269,6 @@ void OutputGmsh::Process()
}
// Process volume nodes
cout << volList.size() << endl;
for (int j = 0; j < volList.size(); ++j)
{
tags.push_back(volList[j]->m_id);
......@@ -286,9 +278,6 @@ void OutputGmsh::Process()
vector<int> reordering = InputGmsh::CreateReordering(elmtType);
vector<int> inv(tags.size());
cout << "TAGS LENGTH: " << tags.size() << endl;
cout << "REORDERING LENGTH: " << reordering.size() << endl;
ASSERTL1(tags.size() == reordering.size(),
"Reordering map size not equal to element tags.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment