Skip to content
Snippets Groups Projects
Commit 276f930b authored by Dave Moxey's avatar Dave Moxey
Browse files

Merge remote-tracking branch 'upstream/master' into fix/xml-output

parents 85d4ded6 9825170f
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ v4.4.1
- Fix issue with FieldConvert when range flag used (!761)
**NekMesh**:
- Fix memory consumption issue with Gmsh output (!747)
- Fix memory consumption issue with Gmsh output (!747, !762)
- Rework meshing control so that if possible viewable meshes will be dumped
when some part of the system fails (!756)
- Add manifold meshing option (!756)
......
......@@ -73,8 +73,9 @@ public:
/// Copies an existing edge.
NEKMESHUTILS_EXPORT Edge(const Edge &pSrc)
: m_n1(pSrc.m_n1), m_n2(pSrc.m_n2), m_edgeNodes(pSrc.m_edgeNodes),
m_curveType(pSrc.m_curveType), m_geom(pSrc.m_geom)
: m_id(pSrc.m_id), m_n1(pSrc.m_n1), m_n2(pSrc.m_n2),
m_edgeNodes(pSrc.m_edgeNodes), m_curveType(pSrc.m_curveType),
m_elLink(pSrc.m_elLink), m_parentCAD(pSrc.m_parentCAD)
{
}
......
......@@ -67,13 +67,18 @@ public:
std::vector<EdgeSharedPtr> pEdgeList,
LibUtilities::PointsType pCurveType)
: m_vertexList(pVertexList), m_edgeList(pEdgeList),
m_faceNodes(pFaceNodes), m_curveType(pCurveType), m_geom(){}
m_faceNodes(pFaceNodes), m_curveType(pCurveType), m_geom()
{
}
/// Copy an existing face.
NEKMESHUTILS_EXPORT Face(const Face &pSrc)
: m_vertexList(pSrc.m_vertexList), m_edgeList(pSrc.m_edgeList),
m_faceNodes(pSrc.m_faceNodes), m_curveType(pSrc.m_curveType),
m_geom(pSrc.m_geom){}
: m_id(pSrc.m_id), m_vertexList(pSrc.m_vertexList),
m_edgeList(pSrc.m_edgeList), m_faceNodes(pSrc.m_faceNodes),
m_curveType(pSrc.m_curveType), m_geom(pSrc.m_geom),
m_parentCAD(pSrc.m_parentCAD)
{
}
NEKMESHUTILS_EXPORT ~Face()
{
......
......@@ -98,12 +98,10 @@ unsigned int Mesh::GetNumEntities()
*/
void Mesh::MakeOrder(int order, LibUtilities::PointsType distType)
{
// going to make a copy of the curavture information
// cheaper that geom objects
// currently the geometry objects which make up a 3D element
// dont use the volume nodes, they are just stored,
// so we can get away without copying them
// Going to make a copy of the curavture information, since this is cheaper
// than using Nektar's Geometry objects. Currently, the geometry objects
// which make up a 3D element dont use the volume nodes, they are just
// stored, so we can get away without copying them.
int id = m_vertexSet.size();
......@@ -141,19 +139,47 @@ void Mesh::MakeOrder(int order, LibUtilities::PointsType distType)
ASSERTL1(false, "Mesh::MakeOrder does not support this points type.");
}
// Begin by coping mesh objects for edges, faces
// so that we don't affect any neighbouring elements in the mesh as
// we process each element.
// at the same time we delete the curvature from the original edge
// Begin by copying mesh objects for edges and faces so that we don't affect
// any neighbouring elements in the mesh as we process each element. At the
// same time we delete the curvature from the original edge and face, which
// will be re-added with the MakeOrder routine.
// First, we fill in the volume-interior nodes. This preserves the original
// curvature of the mesh.
const int nElmt = m_element[m_expDim].size();
int tmpId = 0;
for (int i = 0; i < nElmt; ++i)
{
if (m_verbose)
{
LibUtilities::PrintProgressbar(i, nElmt, "MakeOrder: Elements: ");
}
ElementSharedPtr el = m_element[m_expDim][i];
SpatialDomains::GeometrySharedPtr geom = el->GetGeom(m_spaceDim);
geom->FillGeom();
el->MakeOrder(order, geom, pTypes[el->GetConf().m_e], m_spaceDim, tmpId);
}
// Now make copies of each of the edges.
for (eit = m_edgeSet.begin(); eit != m_edgeSet.end(); eit++)
{
edgeCopies[(*eit)->m_id] = EdgeSharedPtr(new Edge(*(*eit)));
(*eit)->m_edgeNodes.clear();
}
// Now copy faces. Make sure that this is a "deep copy", so that the face's
// edge list corresponds to the copied edges, otherwise we end up in a
// non-consistent state.
for (fit = m_faceSet.begin(); fit != m_faceSet.end(); fit++)
{
faceCopies[(*fit)->m_id] = FaceSharedPtr(new Face(*(*fit)));
FaceSharedPtr tmpFace = FaceSharedPtr(new Face(*(*fit)));
for (int i = 0; i < tmpFace->m_edgeList.size(); ++i)
{
tmpFace->m_edgeList[i] = edgeCopies[tmpFace->m_edgeList[i]->m_id];
}
faceCopies[(*fit)->m_id] = tmpFace;
(*fit)->m_faceNodes.clear();
}
......@@ -249,18 +275,13 @@ void Mesh::MakeOrder(int order, LibUtilities::PointsType distType)
el->SetVolumeNodes(face->m_faceNodes);
}
// Finally, fill in volumes.
const int nElmt = m_element[m_expDim].size();
for (int i = 0; i < nElmt; ++i)
{
if (m_verbose)
vector<NodeSharedPtr> tmp = m_element[m_expDim][i]->GetVolumeNodes();
for (int j = 0; j < tmp.size(); ++j)
{
LibUtilities::PrintProgressbar(i, nElmt, "MakeOrder: Elements: ");
tmp[j]->m_id = id++;
}
ElementSharedPtr el = m_element[m_expDim][i];
SpatialDomains::GeometrySharedPtr geom = el->GetGeom(m_spaceDim);
geom->FillGeom();
el->MakeOrder(order, geom, pTypes[el->GetConf().m_e], m_spaceDim, id);
}
if (m_verbose)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment