Commit 573d8a3a authored by Michael Turner's avatar Michael Turner

Merge branch 'feature/2-point-loops' into 'master'

feature/2-point-loops

See merge request !875
parents 6132bf3e 0b310f11
......@@ -48,6 +48,7 @@ v5.0.0
- Additional curve types in GEO reader: BSpline, Circle, Ellipse (!800)
- Fix default command line argument value (!823)
- Add projection meshing module which can curve linear meshes with CAD (!826)
- Force 3-node loops to avoid degenerate 1-triangle faces (!875)
- Revert triangle code to ThirdParty library (!883)
- Fix coinciding nodes issue with very fine meshes (!883)
......
......@@ -42,7 +42,22 @@ namespace Nektar
namespace NekMeshUtils
{
void CurveMesh::Mesh()
void CurveMesh::ReMesh()
{
m_meshpoints.clear();
m_dst.clear();
m_ps.clear();
meshsvalue.clear();
for(int i = 0; i < m_meshedges.size(); i++)
{
m_mesh->m_edgeSet.erase(m_meshedges[i]);
}
m_meshedges.clear();
Mesh(true);
}
void CurveMesh::Mesh(bool forceThree)
{
// this algorithm is mostly based on the work in chapter 19
......@@ -90,6 +105,14 @@ void CurveMesh::Mesh()
meshsvalue[Ne - 1] = m_curvelength - m_endoffset[1];
}
}
else if(Ne + 1 == 2 && forceThree)
{
Ne++;
meshsvalue.resize(Ne + 1);
meshsvalue[0] = 0.0;
meshsvalue[1] = m_curvelength/ 2.0;
meshsvalue[2] = m_curvelength;
}
else
{
......@@ -247,7 +270,7 @@ NekDouble CurveMesh::EvaluateDS(NekDouble s)
int a = 0;
int b = 0;
ASSERTL1(!(s < 0) && !(s > m_curvelength), "s out of bounds");
ASSERTL1(!(s < 0)&& !(s > m_curvelength), "s out of bounds");
if (s == 0)
{
......
......@@ -80,7 +80,12 @@ public:
/**
* @brief execute meshing
*/
void Mesh();
void Mesh(bool forceThree = false);
/**
* @brief Delete old mesh and mesh with forceThree on
*/
void ReMesh();
/**
* @brief get id of first node
......
......@@ -124,6 +124,25 @@ bool FaceMesh::ValidateCurves()
return error;
}
void FaceMesh::ValidateLoops()
{
OrientateCurves();
for (int i = 0; i < orderedLoops.size(); i++)
{
int numPoints = orderedLoops[i].size();
if(numPoints == 2)
{
//force a remesh of the curves
for(int j = 0; j < m_edgeloops[i]->edges.size(); j++)
{
int cid = m_edgeloops[i]->edges[j]->GetId();
m_curvemeshes[cid]->ReMesh();
}
}
}
}
void FaceMesh::Mesh()
{
Stretching();
......@@ -151,7 +170,7 @@ void FaceMesh::Mesh()
}
}
ASSERTL0(numPoints > 2, ss.str());
ASSERTL0(numPoints > 2, "number of verts in face is less than 3");
// create interface to triangle thirdparty library
TriangleInterfaceSharedPtr pplanemesh =
......
......@@ -78,6 +78,11 @@ public:
*/
bool ValidateCurves();
/**
* @brief validate the curve meshes considering the loops
*/
void ValidateLoops();
private:
/**
......
......@@ -95,27 +95,30 @@ void SurfaceMesh::Process()
LibUtilities::PrintProgressbar(
i, m_mesh->m_cad->GetNumSurf(), "Validating curve meshes");
}
m_facemeshes[i] =
FaceMeshSharedPtr face =
MemoryManager<FaceMesh>::AllocateSharedPtr(i,m_mesh,
m_curvemeshes, i);
validError = validError ? true : m_facemeshes[i]->ValidateCurves();
validError = validError ? true : face->ValidateCurves();
face->ValidateLoops();
}
ASSERTL0(!validError,"valdity error in curve meshes");
// linear mesh all surfaces
map<int,FaceMeshSharedPtr>::iterator fit;
int i = 1;
for(fit = m_facemeshes.begin(); fit != m_facemeshes.end(); fit++)
for (int i = 1; i <= m_mesh->m_cad->GetNumSurf(); i++)
{
if (m_mesh->m_verbose)
{
LibUtilities::PrintProgressbar(
i, m_mesh->m_cad->GetNumSurf(), "Face progress");
}
fit->second->Mesh();
i++;
m_facemeshes[i] =
MemoryManager<FaceMesh>::AllocateSharedPtr(i,m_mesh,
m_curvemeshes, i);
m_facemeshes[i]->Mesh();
}
ProcessVertices();
......
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