Commit 81a84a8a authored by Julian Marcon's avatar Julian Marcon

Comments

parent 88a5e66c
......@@ -83,6 +83,7 @@ void Generator2D::Process()
ParseUtils::GenerateSeqVector(m_config["blcurves"].as<string>().c_str(),
m_blCurves);
// find the ends of the BL curves
if (m_config["blcurves"].beenSet)
{
FindBLEnds();
......@@ -103,6 +104,9 @@ void Generator2D::Process()
m_curvemeshes[i] =
MemoryManager<CurveMesh>::AllocateSharedPtr(i, m_mesh);
// Fheck if this curve is at an end of the BL
// If so, define an offset for the second node, corresponding to the
// BL thickness
if (m_blends.count(i))
{
vector<CADVertSharedPtr> vertices =
......@@ -110,6 +114,7 @@ void Generator2D::Process()
Array<OneD, NekDouble> loc;
NekDouble t;
// offset needed at first node (or both)
if (m_blends[i] == 0 || m_blends[i] == 2)
{
loc = vertices[0]->GetLoc();
......@@ -117,6 +122,7 @@ void Generator2D::Process()
loc[2], 0.0);
m_curvemeshes[i]->SetOffset(0, t);
}
// offset needed at second node (or both)
if (m_blends[i] == 1 || m_blends[i] == 2)
{
loc = vertices[1]->GetLoc();
......@@ -154,6 +160,8 @@ void Generator2D::Process()
MakeBL(i);
}
// If the BL doesn't form closed loops, we need to remove the outside
// nodes from the curve meshes
for (map<unsigned, unsigned>::iterator ic = m_blends.begin();
ic != m_blends.end(); ++ic)
{
......@@ -169,6 +177,8 @@ void Generator2D::Process()
nodes.erase(nodes.end() - 1);
}
// Rebuild the curvemesh without the first node, the last node or
// both
m_curvemeshes[ic->first] =
MemoryManager<CurveMesh>::AllocateSharedPtr(ic->first, m_mesh,
nodes);
......@@ -225,6 +235,11 @@ void Generator2D::Process()
void Generator2D::FindBLEnds()
{
// Set of CAD vertices
// Vertices of each curve are added to the set if not found and removed from
// the set if found
// This leaves us with a set of vertices that are at the end of BL open
// loops
set<CADVertSharedPtr> cadverts;
for (int it = 0; it < m_blCurves.size(); ++it)
......@@ -247,6 +262,9 @@ void Generator2D::FindBLEnds()
}
}
// Build m_blends based on the previously constructed set of vertices
// m_blends is a map of curve number (the curves right outside the BL open
// loops) to the offset node number: 0, 1 or 2 (for both)
for (int i = 1; i <= m_mesh->m_cad->GetNumCurve(); ++i)
{
if (find(m_blCurves.begin(), m_blCurves.end(), i) != m_blCurves.end())
......@@ -359,6 +377,8 @@ void Generator2D::MakeBL(int faceid)
ASSERTL0(it->second.size() == 1 || it->second.size() == 2,
"weirdness, most likely bl_surfs are incorrect");
// If node at the end of the BL open loop, the "normal node" isn't
// constructed by computing a normal but found on the adjacent curve
if (it->second.size() == 1)
{
vector<pair<int, CADCurveSharedPtr> > curves =
......
......@@ -52,6 +52,7 @@ void CurveMesh::Mesh()
int(m_curvelength / m_mesh->m_octree->GetMinDelta()) + 10;
ds = m_curvelength / (m_numSamplePoints - 1);
// compute the offset due to adjacent BLs
NekDouble totalOffset = 0.0;
for (map<unsigned, NekDouble>::iterator ie = m_endoffset.begin();
ie != m_endoffset.end(); ++ie)
......@@ -98,6 +99,8 @@ void CurveMesh::Mesh()
meshsvalue[0] = 0.0;
meshsvalue[Ne] = m_curvelength;
// force the second and/or the second to last point(s) if an offset is
// defined
if (m_endoffset.count(0))
{
meshsvalue[1] = m_endoffset[0];
......@@ -341,6 +344,7 @@ void CurveMesh::GetSampleFunction()
bool found = false;
// if inside the BL, dsti[0] set to the BL thickness, i.e. the offset
if (m_endoffset.count(0))
{
if (dsti[1] < m_endoffset[0])
......@@ -357,6 +361,7 @@ void CurveMesh::GetSampleFunction()
found = true;
}
}
// else, dsti[0] is found from the octree
if (!found)
{
dsti[0] = m_mesh->m_octree->Query(loc);
......
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