Commit e259ce3c authored by Chris Cantwell's avatar Chris Cantwell

Merge branch 'fix/star2gmsh' of /opt/gitlab/repositories/nektar

parents 0c528101 b30fad4b
......@@ -319,109 +319,110 @@ namespace Nektar
*/
std::map<unsigned int, ElmtConfig> InputGmsh::GenElmMap()
{
using namespace LibUtilities;
std::map<unsigned int, ElmtConfig> tmp;
// Elmt type, order, face, volume
tmp[ 1] = ElmtConfig(LibUtilities::eSegment, 1, true, true);
tmp[ 2] = ElmtConfig(LibUtilities::eTriangle, 1, true, true);
tmp[ 3] = ElmtConfig(LibUtilities::eQuadrilateral, 1, true, true);
tmp[ 4] = ElmtConfig(LibUtilities::eTetrahedron, 1, true, true);
tmp[ 5] = ElmtConfig(LibUtilities::eHexahedron, 1, true, true);
tmp[ 6] = ElmtConfig(LibUtilities::ePrism, 1, true, true);
tmp[ 7] = ElmtConfig(LibUtilities::ePyramid, 1, true, true);
tmp[ 8] = ElmtConfig(LibUtilities::eSegment, 2, true, true);
tmp[ 9] = ElmtConfig(LibUtilities::eTriangle, 2, true, true);
tmp[ 10] = ElmtConfig(LibUtilities::eQuadrilateral, 2, true, true);
tmp[ 11] = ElmtConfig(LibUtilities::eTetrahedron, 2, true, true);
tmp[ 12] = ElmtConfig(LibUtilities::eHexahedron, 2, true, true);
tmp[ 13] = ElmtConfig(LibUtilities::ePrism, 2, true, true);
tmp[ 15] = ElmtConfig(LibUtilities::ePoint, 1, true, false);
tmp[ 16] = ElmtConfig(LibUtilities::eQuadrilateral, 2, false, false);
tmp[ 17] = ElmtConfig(LibUtilities::eHexahedron, 2, false, false);
tmp[ 18] = ElmtConfig(LibUtilities::ePrism, 2, false, false);
tmp[ 20] = ElmtConfig(LibUtilities::eTriangle, 3, false, false);
tmp[ 21] = ElmtConfig(LibUtilities::eTriangle, 3, true, false);
tmp[ 22] = ElmtConfig(LibUtilities::eTriangle, 4, false, false);
tmp[ 23] = ElmtConfig(LibUtilities::eTriangle, 4, true, false);
tmp[ 24] = ElmtConfig(LibUtilities::eTriangle, 5, false, false);
tmp[ 25] = ElmtConfig(LibUtilities::eTriangle, 5, true, false);
tmp[ 26] = ElmtConfig(LibUtilities::eSegment, 3, true, false);
tmp[ 27] = ElmtConfig(LibUtilities::eSegment, 4, true, false);
tmp[ 28] = ElmtConfig(LibUtilities::eSegment, 5, true, false);
tmp[ 29] = ElmtConfig(LibUtilities::eTetrahedron, 3, true, true);
tmp[ 30] = ElmtConfig(LibUtilities::eTetrahedron, 4, true, true);
tmp[ 31] = ElmtConfig(LibUtilities::eTetrahedron, 5, true, true);
tmp[ 32] = ElmtConfig(LibUtilities::eTetrahedron, 4, true, false);
tmp[ 33] = ElmtConfig(LibUtilities::eTetrahedron, 5, true, false);
tmp[ 36] = ElmtConfig(LibUtilities::eQuadrilateral, 3, true, false);
tmp[ 37] = ElmtConfig(LibUtilities::eQuadrilateral, 4, true, false);
tmp[ 38] = ElmtConfig(LibUtilities::eQuadrilateral, 5, true, false);
tmp[ 39] = ElmtConfig(LibUtilities::eQuadrilateral, 3, false, false);
tmp[ 40] = ElmtConfig(LibUtilities::eQuadrilateral, 4, false, false);
tmp[ 41] = ElmtConfig(LibUtilities::eQuadrilateral, 5, false, false);
tmp[ 42] = ElmtConfig(LibUtilities::eTriangle, 6, true, false);
tmp[ 43] = ElmtConfig(LibUtilities::eTriangle, 7, true, false);
tmp[ 44] = ElmtConfig(LibUtilities::eTriangle, 8, true, false);
tmp[ 45] = ElmtConfig(LibUtilities::eTriangle, 9, true, false);
tmp[ 46] = ElmtConfig(LibUtilities::eTriangle, 10, true, false);
tmp[ 47] = ElmtConfig(LibUtilities::eQuadrilateral, 6, true, false);
tmp[ 48] = ElmtConfig(LibUtilities::eQuadrilateral, 7, true, false);
tmp[ 49] = ElmtConfig(LibUtilities::eQuadrilateral, 8, true, false);
tmp[ 50] = ElmtConfig(LibUtilities::eQuadrilateral, 9, true, false);
tmp[ 51] = ElmtConfig(LibUtilities::eQuadrilateral, 10, true, false);
tmp[ 52] = ElmtConfig(LibUtilities::eTriangle, 6, false, false);
tmp[ 53] = ElmtConfig(LibUtilities::eTriangle, 7, false, false);
tmp[ 54] = ElmtConfig(LibUtilities::eTriangle, 8, false, false);
tmp[ 55] = ElmtConfig(LibUtilities::eTriangle, 9, false, false);
tmp[ 56] = ElmtConfig(LibUtilities::eTriangle, 10, false, false);
tmp[ 57] = ElmtConfig(LibUtilities::eQuadrilateral, 6, false, false);
tmp[ 58] = ElmtConfig(LibUtilities::eQuadrilateral, 7, false, false);
tmp[ 59] = ElmtConfig(LibUtilities::eQuadrilateral, 8, false, false);
tmp[ 60] = ElmtConfig(LibUtilities::eQuadrilateral, 9, false, false);
tmp[ 61] = ElmtConfig(LibUtilities::eQuadrilateral, 10, false, false);
tmp[ 62] = ElmtConfig(LibUtilities::eSegment, 6, true, false);
tmp[ 63] = ElmtConfig(LibUtilities::eSegment, 7, true, false);
tmp[ 64] = ElmtConfig(LibUtilities::eSegment, 8, true, false);
tmp[ 65] = ElmtConfig(LibUtilities::eSegment, 9, true, false);
tmp[ 66] = ElmtConfig(LibUtilities::eSegment, 10, true, false);
tmp[ 71] = ElmtConfig(LibUtilities::eTetrahedron, 6, true, true);
tmp[ 72] = ElmtConfig(LibUtilities::eTetrahedron, 7, true, true);
tmp[ 73] = ElmtConfig(LibUtilities::eTetrahedron, 8, true, true);
tmp[ 74] = ElmtConfig(LibUtilities::eTetrahedron, 9, true, true);
tmp[ 75] = ElmtConfig(LibUtilities::eTetrahedron, 10, true, true);
tmp[ 79] = ElmtConfig(LibUtilities::eTetrahedron, 6, true, false);
tmp[ 80] = ElmtConfig(LibUtilities::eTetrahedron, 7, true, false);
tmp[ 81] = ElmtConfig(LibUtilities::eTetrahedron, 8, true, false);
tmp[ 82] = ElmtConfig(LibUtilities::eTetrahedron, 9, true, false);
tmp[ 83] = ElmtConfig(LibUtilities::eTetrahedron, 10, true, false);
tmp[ 90] = ElmtConfig(LibUtilities::ePrism, 3, true, true);
tmp[ 91] = ElmtConfig(LibUtilities::ePrism, 4, true, true);
tmp[ 92] = ElmtConfig(LibUtilities::eHexahedron, 3, true, true);
tmp[ 93] = ElmtConfig(LibUtilities::eHexahedron, 4, true, true);
tmp[ 94] = ElmtConfig(LibUtilities::eHexahedron, 5, true, true);
tmp[ 95] = ElmtConfig(LibUtilities::eHexahedron, 6, true, true);
tmp[ 96] = ElmtConfig(LibUtilities::eHexahedron, 7, true, true);
tmp[ 97] = ElmtConfig(LibUtilities::eHexahedron, 8, true, true);
tmp[ 98] = ElmtConfig(LibUtilities::eHexahedron, 9, true, true);
tmp[ 99] = ElmtConfig(LibUtilities::eHexahedron, 3, true, false);
tmp[100] = ElmtConfig(LibUtilities::eHexahedron, 4, true, false);
tmp[101] = ElmtConfig(LibUtilities::eHexahedron, 5, true, false);
tmp[102] = ElmtConfig(LibUtilities::eHexahedron, 6, true, false);
tmp[103] = ElmtConfig(LibUtilities::eHexahedron, 7, true, false);
tmp[104] = ElmtConfig(LibUtilities::eHexahedron, 8, true, false);
tmp[105] = ElmtConfig(LibUtilities::eHexahedron, 9, true, false);
tmp[106] = ElmtConfig(LibUtilities::ePrism, 5, true, true);
tmp[107] = ElmtConfig(LibUtilities::ePrism, 6, true, true);
tmp[108] = ElmtConfig(LibUtilities::ePrism, 7, true, true);
tmp[109] = ElmtConfig(LibUtilities::ePrism, 8, true, true);
tmp[110] = ElmtConfig(LibUtilities::ePrism, 9, true, true);
tmp[111] = ElmtConfig(LibUtilities::ePrism, 3, true, false);
tmp[112] = ElmtConfig(LibUtilities::ePrism, 4, true, false);
tmp[113] = ElmtConfig(LibUtilities::ePrism, 5, true, false);
tmp[114] = ElmtConfig(LibUtilities::ePrism, 6, true, false);
tmp[115] = ElmtConfig(LibUtilities::ePrism, 7, true, false);
tmp[116] = ElmtConfig(LibUtilities::ePrism, 8, true, false);
tmp[117] = ElmtConfig(LibUtilities::ePrism, 9, true, false);
tmp[ 1] = ElmtConfig(eSegment, 1, true, true);
tmp[ 2] = ElmtConfig(eTriangle, 1, true, true);
tmp[ 3] = ElmtConfig(eQuadrilateral, 1, true, true);
tmp[ 4] = ElmtConfig(eTetrahedron, 1, true, true);
tmp[ 5] = ElmtConfig(eHexahedron, 1, true, true);
tmp[ 6] = ElmtConfig(ePrism, 1, true, true);
tmp[ 7] = ElmtConfig(ePyramid, 1, true, true);
tmp[ 8] = ElmtConfig(eSegment, 2, true, true);
tmp[ 9] = ElmtConfig(eTriangle, 2, true, true);
tmp[ 10] = ElmtConfig(eQuadrilateral, 2, true, true);
tmp[ 11] = ElmtConfig(eTetrahedron, 2, true, true);
tmp[ 12] = ElmtConfig(eHexahedron, 2, true, true);
tmp[ 13] = ElmtConfig(ePrism, 2, true, true);
tmp[ 15] = ElmtConfig(ePoint, 1, true, false);
tmp[ 16] = ElmtConfig(eQuadrilateral, 2, false, false);
tmp[ 17] = ElmtConfig(eHexahedron, 2, false, false);
tmp[ 18] = ElmtConfig(ePrism, 2, false, false);
tmp[ 20] = ElmtConfig(eTriangle, 3, false, false);
tmp[ 21] = ElmtConfig(eTriangle, 3, true, false);
tmp[ 22] = ElmtConfig(eTriangle, 4, false, false);
tmp[ 23] = ElmtConfig(eTriangle, 4, true, false);
tmp[ 24] = ElmtConfig(eTriangle, 5, false, false);
tmp[ 25] = ElmtConfig(eTriangle, 5, true, false);
tmp[ 26] = ElmtConfig(eSegment, 3, true, false);
tmp[ 27] = ElmtConfig(eSegment, 4, true, false);
tmp[ 28] = ElmtConfig(eSegment, 5, true, false);
tmp[ 29] = ElmtConfig(eTetrahedron, 3, true, true);
tmp[ 30] = ElmtConfig(eTetrahedron, 4, true, true);
tmp[ 31] = ElmtConfig(eTetrahedron, 5, true, true);
tmp[ 32] = ElmtConfig(eTetrahedron, 4, true, false);
tmp[ 33] = ElmtConfig(eTetrahedron, 5, true, false);
tmp[ 36] = ElmtConfig(eQuadrilateral, 3, true, false);
tmp[ 37] = ElmtConfig(eQuadrilateral, 4, true, false);
tmp[ 38] = ElmtConfig(eQuadrilateral, 5, true, false);
tmp[ 39] = ElmtConfig(eQuadrilateral, 3, false, false);
tmp[ 40] = ElmtConfig(eQuadrilateral, 4, false, false);
tmp[ 41] = ElmtConfig(eQuadrilateral, 5, false, false);
tmp[ 42] = ElmtConfig(eTriangle, 6, true, false);
tmp[ 43] = ElmtConfig(eTriangle, 7, true, false);
tmp[ 44] = ElmtConfig(eTriangle, 8, true, false);
tmp[ 45] = ElmtConfig(eTriangle, 9, true, false);
tmp[ 46] = ElmtConfig(eTriangle, 10, true, false);
tmp[ 47] = ElmtConfig(eQuadrilateral, 6, true, false);
tmp[ 48] = ElmtConfig(eQuadrilateral, 7, true, false);
tmp[ 49] = ElmtConfig(eQuadrilateral, 8, true, false);
tmp[ 50] = ElmtConfig(eQuadrilateral, 9, true, false);
tmp[ 51] = ElmtConfig(eQuadrilateral, 10, true, false);
tmp[ 52] = ElmtConfig(eTriangle, 6, false, false);
tmp[ 53] = ElmtConfig(eTriangle, 7, false, false);
tmp[ 54] = ElmtConfig(eTriangle, 8, false, false);
tmp[ 55] = ElmtConfig(eTriangle, 9, false, false);
tmp[ 56] = ElmtConfig(eTriangle, 10, false, false);
tmp[ 57] = ElmtConfig(eQuadrilateral, 6, false, false);
tmp[ 58] = ElmtConfig(eQuadrilateral, 7, false, false);
tmp[ 59] = ElmtConfig(eQuadrilateral, 8, false, false);
tmp[ 60] = ElmtConfig(eQuadrilateral, 9, false, false);
tmp[ 61] = ElmtConfig(eQuadrilateral, 10, false, false);
tmp[ 62] = ElmtConfig(eSegment, 6, true, false);
tmp[ 63] = ElmtConfig(eSegment, 7, true, false);
tmp[ 64] = ElmtConfig(eSegment, 8, true, false);
tmp[ 65] = ElmtConfig(eSegment, 9, true, false);
tmp[ 66] = ElmtConfig(eSegment, 10, true, false);
tmp[ 71] = ElmtConfig(eTetrahedron, 6, true, true);
tmp[ 72] = ElmtConfig(eTetrahedron, 7, true, true);
tmp[ 73] = ElmtConfig(eTetrahedron, 8, true, true);
tmp[ 74] = ElmtConfig(eTetrahedron, 9, true, true);
tmp[ 75] = ElmtConfig(eTetrahedron, 10, true, true);
tmp[ 79] = ElmtConfig(eTetrahedron, 6, true, false);
tmp[ 80] = ElmtConfig(eTetrahedron, 7, true, false);
tmp[ 81] = ElmtConfig(eTetrahedron, 8, true, false);
tmp[ 82] = ElmtConfig(eTetrahedron, 9, true, false);
tmp[ 83] = ElmtConfig(eTetrahedron, 10, true, false);
tmp[ 90] = ElmtConfig(ePrism, 3, true, true);
tmp[ 91] = ElmtConfig(ePrism, 4, true, true);
tmp[ 92] = ElmtConfig(eHexahedron, 3, true, true);
tmp[ 93] = ElmtConfig(eHexahedron, 4, true, true);
tmp[ 94] = ElmtConfig(eHexahedron, 5, true, true);
tmp[ 95] = ElmtConfig(eHexahedron, 6, true, true);
tmp[ 96] = ElmtConfig(eHexahedron, 7, true, true);
tmp[ 97] = ElmtConfig(eHexahedron, 8, true, true);
tmp[ 98] = ElmtConfig(eHexahedron, 9, true, true);
tmp[ 99] = ElmtConfig(eHexahedron, 3, true, false);
tmp[100] = ElmtConfig(eHexahedron, 4, true, false);
tmp[101] = ElmtConfig(eHexahedron, 5, true, false);
tmp[102] = ElmtConfig(eHexahedron, 6, true, false);
tmp[103] = ElmtConfig(eHexahedron, 7, true, false);
tmp[104] = ElmtConfig(eHexahedron, 8, true, false);
tmp[105] = ElmtConfig(eHexahedron, 9, true, false);
tmp[106] = ElmtConfig(ePrism, 5, true, true);
tmp[107] = ElmtConfig(ePrism, 6, true, true);
tmp[108] = ElmtConfig(ePrism, 7, true, true);
tmp[109] = ElmtConfig(ePrism, 8, true, true);
tmp[110] = ElmtConfig(ePrism, 9, true, true);
tmp[111] = ElmtConfig(ePrism, 3, true, false);
tmp[112] = ElmtConfig(ePrism, 4, true, false);
tmp[113] = ElmtConfig(ePrism, 5, true, false);
tmp[114] = ElmtConfig(ePrism, 6, true, false);
tmp[115] = ElmtConfig(ePrism, 7, true, false);
tmp[116] = ElmtConfig(ePrism, 8, true, false);
tmp[117] = ElmtConfig(ePrism, 9, true, false);
return tmp;
}
......
......@@ -707,7 +707,7 @@ namespace Nektar
}
// Create element
ElmtConfig conf(elType,1,false,false);
ElmtConfig conf(elType,1,true,true);
ElementSharedPtr E = GetElementFactory().CreateInstance(elType,conf,
nodeList,tags);
......@@ -763,7 +763,7 @@ namespace Nektar
// Create element
if(elType != LibUtilities::ePyramid)
{
ElmtConfig conf(elType,1,false,false,DoOrient);
ElmtConfig conf(elType,1,true,true,DoOrient);
ElementSharedPtr E = GetElementFactory().CreateInstance(elType,conf,
nodeList,tags);
......
......@@ -108,9 +108,8 @@ namespace Nektar
maxOrder = e->GetMaxOrder();
}
}
//maxOrder = 2;
for (int d = 1; d <= 3; ++d)
{
for (int i = 0; i < m_mesh->m_element[d].size(); ++i)
......@@ -127,7 +126,7 @@ namespace Nektar
m_mesh->m_element[d][i]->GetGeom(m_mesh->m_spaceDim);
}
}
// Complete these elements.
for (int i = 0; i < toComplete.size(); ++i)
{
......@@ -137,7 +136,6 @@ namespace Nektar
// Do second pass over elements to enumerate high-order vertices.
for (int d = 1; d <= 3; ++d)
{
//cout << "D = " << d << endl;
for (int i = 0; i < m_mesh->m_element[d].size(); ++i)
{
// Keep track of faces and edges to ensure that high-order
......@@ -145,9 +143,7 @@ namespace Nektar
boost::unordered_set<int> edgesDone;
boost::unordered_set<int> facesDone;
ElementSharedPtr e = m_mesh->m_element[d][i];
//cout << "Element " << i << ": ";
if (e->GetConf().m_order > 1)
{
vector<NodeSharedPtr> tmp;
......@@ -155,12 +151,6 @@ namespace Nektar
vector<FaceSharedPtr> faceList = e->GetFaceList();
vector<NodeSharedPtr> volList = e->GetVolumeNodes();
/*
cout << " edge = " << edgeList.size() << " "
<< " face = " << faceList.size() << " "
<< " vol = " << volList.size() << endl;
*/
for (int j = 0; j < edgeList.size(); ++j)
{
boost::unordered_set<int>::iterator it =
......@@ -211,21 +201,22 @@ namespace Nektar
}
}
}
// Create ordered set of nodes - not required but looks nicer.
std::set<NodeSharedPtr>::iterator it;
std::set<NodeSharedPtr> tmp(m_mesh->m_vertexSet.begin(), m_mesh->m_vertexSet.end());
std::set<NodeSharedPtr> tmp(m_mesh->m_vertexSet.begin(),
m_mesh->m_vertexSet.end());
// Write out nodes section.
m_mshFile << "$Nodes" << endl
<< m_mesh->m_vertexSet.size() << endl;
m_mshFile << "$Nodes" << endl
<< m_mesh->m_vertexSet.size() << endl;
for (it = tmp.begin(); it != tmp.end(); ++it)
{
m_mshFile << (*it)->m_id << " " << scientific << setprecision(10)
<< (*it)->m_x << " "
<< (*it)->m_y << " " << (*it)->m_z
<< endl;
<< (*it)->m_x << " "
<< (*it)->m_y << " " << (*it)->m_z
<< endl;
}
m_mshFile << "$EndNodes" << endl;
......@@ -245,7 +236,7 @@ namespace Nektar
// First output element ID and type.
m_mshFile << id << " "
<< elmMap[e->GetConf()] << " ";
<< elmMap[e->GetConf()] << " ";
// Write out number of element tags and then the tags
// themselves.
......
......@@ -59,7 +59,7 @@ namespace Nektar
bool operator==(ElmtConfig const &p1, ElmtConfig const &p2)
{
return p1.m_e == p2.m_e &&
return p1.m_e == p2.m_e &&
p1.m_faceNodes == p2.m_faceNodes &&
p1.m_volumeNodes == p2.m_volumeNodes &&
p1.m_order == p2.m_order;
......
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