Commit ad74e3d6 authored by Spencer Sherwin's avatar Spencer Sherwin

Merge branch 'master' into fix/MeshPartition

parents 6c69665e d4ad381a
......@@ -62,6 +62,9 @@ v5.0.0
- Add ability to space out 2D BL nodes to better fit local target Delta (!890)
- Fix automatic peralign call in 2D periodic meshing (!888)
- Fix BL splitting call from MCF (!910)
- Support CFI combined lines (!917)
- Order nodes in Gmsh output (!912)
- Fix manifold face curvature nodes (!913)
**FieldConvert**:
- Add input module for Semtex field files (!777)
......
......@@ -187,7 +187,31 @@ bool CADSystemCFI::LoadCAD()
{
vector<cfi::Oriented<cfi::TopoEntity *>> *edgeList =
face->getChildList();
// unrolling combined edges
vector<cfi::Oriented<cfi::TopoEntity *>> fullEdgeList;
for (it2 = edgeList->begin(); it2 != edgeList->end(); it2++)
{
cfi::Line *edge = static_cast<cfi::Line *>(it2->entity);
if (edge->getTopoSubtype() == cfi::SUBTYPE_COMBINED)
{
vector<cfi::Oriented<cfi::TopoEntity *>> *subEdgeList =
edge->getChildList();
for (it3 = subEdgeList->begin();
it3 != subEdgeList->end(); it3++)
{
fullEdgeList.push_back(*it3);
}
}
else
{
fullEdgeList.push_back(*it2);
}
}
for (it2 = fullEdgeList.begin(); it2 != fullEdgeList.end(); it2++)
{
cfi::Oriented<cfi::TopoEntity *> orientatedEdge = *it2;
cfi::Line *edge =
......@@ -311,15 +335,45 @@ void CADSystemCFI::AddSurf(int i, cfi::Face *in)
vector<cfi::Oriented<cfi::TopoEntity *>> *edgeList = in->getChildList();
// unrolling combined edges
vector<cfi::Oriented<cfi::TopoEntity *>> fullEdgeList;
vector<cfi::Oriented<cfi::TopoEntity *>>::iterator it2, it3;
for (it2 = edgeList->begin(); it2 != edgeList->end(); it2++)
{
cfi::Line *edge = static_cast<cfi::Line *>(it2->entity);
if (edge->getTopoSubtype() == cfi::SUBTYPE_COMBINED)
{
vector<cfi::Oriented<cfi::TopoEntity *>> *subEdgeList =
edge->getChildList();
for (it3 = subEdgeList->begin(); it3 != subEdgeList->end(); it3++)
{
fullEdgeList.push_back(*it3);
}
if (it2->orientation == cfi::ORIENT_NEGATIVE)
{
reverse(fullEdgeList.begin() + fullEdgeList.size() -
subEdgeList->size(),
fullEdgeList.end());
}
}
else
{
fullEdgeList.push_back(*it2);
}
}
vector<EdgeLoopSharedPtr> edgeloops;
int done = 0;
while (done != edgeList->size())
while (done != fullEdgeList.size())
{
EdgeLoopSharedPtr edgeloop = EdgeLoopSharedPtr(new EdgeLoop);
string firstVert;
vector<cfi::Oriented<cfi::TopoEntity *>> *vertList =
edgeList->at(done).entity->getChildList();
if (edgeList->at(done).orientation == cfi::ORIENT_POSITIVE)
fullEdgeList.at(done).entity->getChildList();
if (fullEdgeList.at(done).orientation == cfi::ORIENT_POSITIVE)
{
firstVert = vertList->at(0).entity->getName();
edgeloop->edgeo.push_back(CADOrientation::eForwards);
......@@ -331,13 +385,13 @@ void CADSystemCFI::AddSurf(int i, cfi::Face *in)
}
edgeloop->edges.push_back(
m_curves[nameToCurveId[edgeList->at(done).entity->getName()]]);
m_curves[nameToCurveId[fullEdgeList.at(done).entity->getName()]]);
for (done++; done < edgeList->size(); done++)
for (done++; done < fullEdgeList.size(); done++)
{
bool end = false;
vertList = edgeList->at(done).entity->getChildList();
if (edgeList->at(done).orientation == cfi::ORIENT_POSITIVE)
vertList = fullEdgeList.at(done).entity->getChildList();
if (fullEdgeList.at(done).orientation == cfi::ORIENT_POSITIVE)
{
if (vertList->at(1).entity->getName() == firstVert)
{
......@@ -355,7 +409,7 @@ void CADSystemCFI::AddSurf(int i, cfi::Face *in)
}
edgeloop->edges.push_back(
m_curves[nameToCurveId[edgeList->at(done).entity->getName()]]);
m_curves[nameToCurveId[fullEdgeList.at(done).entity->getName()]]);
if (end)
{
......
......@@ -859,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++)
{
......
......@@ -155,17 +155,20 @@ void OutputGmsh::Process()
}
// Create ordered set of nodes - not required but looks nicer.
std::set<NodeSharedPtr> tmp(m_mesh->m_vertexSet.begin(),
m_mesh->m_vertexSet.end());
map<int, NodeSharedPtr> tmp;
for (const auto &it : m_mesh->m_vertexSet)
{
tmp[it->GetID() + 1] = it;
}
// Write out nodes section.
m_mshFile << "$Nodes" << endl << m_mesh->m_vertexSet.size() << endl;
for (auto &it : tmp)
{
m_mshFile << it->m_id+1 << " " << scientific << setprecision(10)
<< it->m_x << " " << it->m_y << " " << it->m_z
<< endl;
m_mshFile << it.first << " " << scientific << setprecision(10)
<< it.second->m_x << " " << it.second->m_y << " "
<< it.second->m_z << endl;
}
m_mshFile << "$EndNodes" << endl;
......
......@@ -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