Commit d6f2cc6c authored by Michael Turner's avatar Michael Turner

fix bug and face curves in 2D elements@

parent 6854f98c
......@@ -286,29 +286,6 @@ void Module::ProcessEdges(bool ReprocessEdges)
*/
void Module::ProcessFaces(bool ReprocessFaces)
{
if(m_mesh->m_expDim == 2)
{
vector<ElementSharedPtr> &elmt = m_mesh->m_element[m_mesh->m_expDim];
m_mesh->m_faceSet.clear();
// Scan all elements and generate list of unique faces
for (int i = 0, fid = 0; i < elmt.size(); ++i)
{
FaceSharedPtr fc = FaceSharedPtr(
new Face(elmt[i]->GetVertexList(), vector<NodeSharedPtr>(),
elmt[i]->GetEdgeList(), LibUtilities::ePolyEvenlySpaced));
pair<FaceSet::iterator,bool> testIns;
testIns = m_mesh->m_faceSet.insert(fc);
if (testIns.second)
{
(*(testIns.first))->m_id = fid++;
}
}
}
if (m_mesh->m_expDim < 3) return;
if(ReprocessFaces)
......@@ -882,7 +859,7 @@ void Module::RegisterConfig(string key, string val)
{
it->second.value = it->second.defValue;
}
else
else
{
it->second.value = val;
}
......
......@@ -129,12 +129,21 @@ void HOSurfaceMesh::Process()
FaceSharedPtr f = m_mesh->m_element[2][i]->GetFaceLink();
bool dumFace = false;
if (!f)
{
//This uses a fake face to build the high-order info
//in the case of 2D and manifold geometries without having to
//rewrite the 3D code
//important to note that face nodes need to be inserted into the
//volume nodes of the surface element or they will be forgotton
f = std::shared_ptr<Face>(new Face(
m_mesh->m_element[2][i]->GetVertexList(),
vector<NodeSharedPtr>(), m_mesh->m_element[2][i]->GetEdgeList(),
LibUtilities::ePolyEvenlySpaced));
dumFace = true;
}
f->m_parentCAD = s;
......@@ -506,6 +515,12 @@ void HOSurfaceMesh::Process()
f->m_faceNodes = honodes;
f->m_curveType = LibUtilities::eGaussLobattoLegendre;
}
if(dumFace)
{
m_mesh->m_element[2][i]->SetVolumeNodes(f->m_faceNodes);
m_mesh->m_element[2][i]->SetCurveType(f->m_curveType);
}
}
if (m_mesh->m_verbose)
......
......@@ -1333,7 +1333,7 @@ void MeshGraphXmlCompressed::WriteCurves(TiXmlElement *geomTag, CurveMap &edges,
cinfo.ptid = 0;
cinfo.ptoffset = ptOffset;
edgeInfo.push_back(cinfo);
faceInfo.push_back(cinfo);
for(int j = 0; j < i.second->m_points.size(); j++)
{
......
......@@ -415,6 +415,32 @@ void OutputNekpp::TransferCurves(MeshGraphSharedPtr graph)
facecnt++;
}
}
if(m_mesh->m_expDim == 2 && m_mesh->m_spaceDim == 3)
{
//manifold case
for(int e = 0; e < m_mesh->m_element[2].size(); e++)
{
ElementSharedPtr el = m_mesh->m_element[2][e];
vector<NodeSharedPtr> ns;
el->GetCurvedNodes(ns);
if(ns.size() > 4)
{
CurveSharedPtr curve = MemoryManager<Curve>::AllocateSharedPtr(
el->GetId(), el->GetCurveType());
for(int i = 0; i < ns.size(); i++)
{
PointGeomSharedPtr vert = MemoryManager<PointGeom>::AllocateSharedPtr(
m_mesh->m_expDim, facecnt, ns[i]->m_x, ns[i]->m_y, ns[i]->m_z);
curve->m_points.push_back(vert);
}
faces[el->GetId()] = curve;
facecnt++;
}
}
}
}
void OutputNekpp::TransferComposites(MeshGraphSharedPtr graph)
......
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