Commit e11d974b authored by Dave Moxey's avatar Dave Moxey

Merge branch 'fix/mc-face-curve' into 'master'

fix/mc-face-curvature

The face curvature of elements was not being considered by meshconvert in relation to the spatialdomains element type. Therefore when considering the validity of elements in terms of positive jacobian, meshconvert was identifying large numbers of element which were invalid as valid. This has now been fixed.

I have tested this against other parts of nektar (fieldconvert/solvers) and everything now agrees on which elements are invalid or not.

Also a small amount of tab clear up.

See merge request !511
parents 5177e572 1263f47a
......@@ -76,7 +76,8 @@ IF (NEKTAR_USE_VTK)
ENDIF ()
ENDIF (NEKTAR_USE_VTK)
# Nektar++
ADD_NEKTAR_TEST (Nektar++/InvalidTetFace)
# Gmsh tests
ADD_NEKTAR_TEST (Gmsh/CubeAllElements)
ADD_NEKTAR_TEST (Gmsh/CubeHex)
......
......@@ -513,10 +513,113 @@ namespace Nektar
for (int i = 0; i < nEdge; ++i)
{
edgeo[i] = SpatialDomains::SegGeom::GetEdgeOrientation(
*edges[i], *edges[(i+1) % nEdge]);
edgeo[i] = m_edgeList[i]->m_n1 == m_vertexList[i] ?
StdRegions::eForwards : StdRegions::eBackwards;
}
if(m_faceNodes.size() > 0)
{
if (nEdge == 3)
{
SpatialDomains::CurveSharedPtr c =
MemoryManager<SpatialDomains::Curve>::
AllocateSharedPtr(m_id, m_curveType);
for(int j = 0; j < m_vertexList.size(); j++)
{
c->m_points.push_back(m_vertexList[j]->GetGeom(coordDim));
}
for(int j = 0; j < nEdge; j++)
{
vector<NodeSharedPtr> ed = m_edgeList[j]->m_edgeNodes;
if(edgeo[j] == StdRegions::eBackwards)
{
for(int k = ed.size()-1; k >=0; k--)
{
c->m_points.push_back(ed[k]->GetGeom(coordDim));
}
}
else
{
for(int k = 0; k < ed.size(); k++)
{
c->m_points.push_back(ed[k]->GetGeom(coordDim));
}
}
}
for(int j = 0; j < m_faceNodes.size(); j++)
{
c->m_points.push_back(m_faceNodes[j]->GetGeom(coordDim));
}
ret = MemoryManager<SpatialDomains::TriGeom>::
AllocateSharedPtr(m_id, edges, edgeo, c);
}
else
{
SpatialDomains::CurveSharedPtr c =
MemoryManager<SpatialDomains::Curve>::
AllocateSharedPtr(m_id, m_curveType);
ASSERTL0(m_vertexList.size() == 4,
"Face nodes of tensor product only supported "
"for quadrilaterals.");
int n = (int)sqrt((NekDouble)GetNodeCount());
vector<NodeSharedPtr> tmp(n*n);
ASSERTL0(n*n == GetNodeCount(), "Wrong number of modes?");
// Write vertices
tmp[0] = m_vertexList[0];
tmp[n-1] = m_vertexList[1];
tmp[n*n-1] = m_vertexList[2];
tmp[n*(n-1)] = m_vertexList[3];
// Write edge-interior
int skips[4][2] = {{0,1}, {n-1,n}, {n*n-1,-1}, {n*(n-1),-n}};
for (int i = 0; i < 4; ++i)
{
bool reverseEdge = edgeo[i] == StdRegions::eBackwards;
if (reverseEdge)
{
for (int j = 1; j < n-1; ++j)
{
tmp[skips[i][0] + j*skips[i][1]] =
m_edgeList[i]->m_edgeNodes[n-2-j];
}
}
else
{
for (int j = 1; j < n-1; ++j)
{
tmp[skips[i][0] + j*skips[i][1]] =
m_edgeList[i]->m_edgeNodes[j-1];
}
}
}
// Write interior
for (int i = 1; i < n-1; ++i)
{
for (int j = 1; j < n-1; ++j)
{
tmp[i*n+j] = m_faceNodes[(i-1)*(n-2)+(j-1)];
}
}
for (int k = 0; k < tmp.size(); ++k)
{
c->m_points.push_back(tmp[k]->GetGeom(coordDim));
}
ret = MemoryManager<SpatialDomains::QuadGeom>::
AllocateSharedPtr(m_id, edges, edgeo, c);
}
}
else
{
if (nEdge == 3)
{
ret = MemoryManager<SpatialDomains::TriGeom>::
......@@ -527,6 +630,7 @@ namespace Nektar
ret = MemoryManager<SpatialDomains::QuadGeom>::
AllocateSharedPtr(m_id, edges, edgeo);
}
}
return ret;
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="utf-8" ?>
<test>
<description>Tet with an invalid face curvature</description>
<executable>MeshConvert</executable>
<parameters>-m jac:list InvalidTetFace.xml InvalidTetFace.xml:xml:test</parameters>
<files>
<file description="Input File">InvalidTetFace.xml</file>
</files>
<metrics>
<metric type="regex" id="1">
<regex>^Total negative Jacobians: (\d+)</regex>
<matches>
<match>
<field id="0">1</field>
</match>
</matches>
</metric>
</metrics>
</test>
<?xml version="1.0" encoding="utf-8" ?>
<NEKTAR>
<GEOMETRY DIM="3" SPACE="3">
<VERTEX>
<V ID="0">1.37039906e+00 1.92768858e-01 8.41250000e-01</V>
<V ID="1">1.36784609e+00 1.93717758e-01 8.42869300e-01</V>
<V ID="2">1.36867278e+00 1.90614879e-01 8.42890755e-01</V>
<V ID="3">1.37047732e+00 1.93212726e-01 8.42337069e-01</V>
</VERTEX>
<EDGE>
<E ID="0"> 0 3 </E>
<E ID="1"> 1 3 </E>
<E ID="2"> 0 1 </E>
<E ID="3"> 2 0 </E>
<E ID="4"> 3 2 </E>
<E ID="5"> 2 1 </E>
</EDGE>
<FACE>
<T ID="0"> 0 1 2</T>
<T ID="1"> 0 4 3</T>
<T ID="2"> 1 4 5</T>
<T ID="3"> 2 5 3</T>
</FACE>
<ELEMENT>
<A ID="0"> 0 1 2 3 </A>
</ELEMENT>
<CURVED>
<E ID="0" EDGEID="2" NUMPOINTS="5" TYPE="GaussLobattoLegendre"> 1.37039906e+00 1.92768858e-01 8.41250000e-01 1.36993656e+00 1.92807505e-01 8.41534151e-01 1.36908823e+00 1.93043322e-01 8.42126719e-01 1.36826609e+00 1.93434833e-01 8.42626462e-01 1.36784609e+00 1.93717758e-01 8.42869300e-01</E>
<E ID="1" EDGEID="1" NUMPOINTS="5" TYPE="GaussLobattoLegendre"> 1.36784609e+00 1.93717758e-01 8.42869300e-01 1.36829789e+00 1.93616208e-01 8.42773631e-01 1.36915735e+00 1.93440664e-01 8.42595788e-01 1.37002054e+00 1.93286210e-01 8.42424318e-01 1.37047732e+00 1.93212726e-01 8.42337069e-01</E>
<E ID="2" EDGEID="0" NUMPOINTS="5" TYPE="GaussLobattoLegendre"> 1.37039906e+00 1.92768858e-01 8.41250000e-01 1.37040151e+00 1.92782825e-01 8.41458633e-01 1.37041940e+00 1.92884284e-01 8.41838607e-01 1.37045344e+00 1.93077341e-01 8.42179771e-01 1.37047732e+00 1.93212726e-01 8.42337069e-01</E>
<F ID="0" FACEID="0" NUMPOINTS="15" TYPE="NodalTriFekete"> 1.37039906e+00 1.92768858e-01 8.41250000e-01 1.37047732e+00 1.93212726e-01 8.42337069e-01 1.36784609e+00 1.93717758e-01 8.42869300e-01 1.37040151e+00 1.92782825e-01 8.41458633e-01 1.37041940e+00 1.92884284e-01 8.41838607e-01 1.37045344e+00 1.93077341e-01 8.42179771e-01 1.37002054e+00 1.93286210e-01 8.42424318e-01 1.36915735e+00 1.93440664e-01 8.42595788e-01 1.36829789e+00 1.93616208e-01 8.42773631e-01 1.36826609e+00 1.93434833e-01 8.42626462e-01 1.36908823e+00 1.93043322e-01 8.42126719e-01 1.36993656e+00 1.92807505e-01 8.41534151e-01 1.36982751e+00 1.92868234e-01 8.41763504e-01 1.36986536e+00 1.93082925e-01 8.42191569e-01 1.36893406e+00 1.93206630e-01 8.42364838e-01 </F>
</CURVED>
<COMPOSITE>
<C ID="0"> A[0] </C>
</COMPOSITE>
<DOMAIN> C[0] </DOMAIN>
</GEOMETRY>
<EXPANSIONS>
<E COMPOSITE="C[0]" NUMMODES="5" TYPE="MODIFIED" FIELDS="u" />
</EXPANSIONS>
<CONDITIONS />
</NEKTAR>
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