Commit 6cba4e73 authored by 's avatar
Browse files

add new constructor to curvemesh for bl targeting in 2D

parent a8fbc4da
......@@ -71,6 +71,13 @@ void Generator2D::Process()
m_mesh->m_numNodes = m_mesh->m_cad->GetNumVerts();
if(m_config["blcurves"].beenSet)
{
ParseUtils::GenerateSeqVector(m_config["blcurves"].as<string>().c_str(),
m_blCurves);
m_thickness = m_config["blthick"].as<NekDouble>();
}
// linear mesh all curves
for (int i = 1; i <= m_mesh->m_cad->GetNumCurve(); i++)
{
......@@ -80,8 +87,19 @@ void Generator2D::Process()
"Curve progress");
}
m_curvemeshes[i] =
MemoryManager<CurveMesh>::AllocateSharedPtr(i, m_mesh);
vector<unsigned int>::iterator f = find(m_blCurves.begin(),
m_blCurves.end(), i);
if(f == m_blCurves.end())
{
m_curvemeshes[i] =
MemoryManager<CurveMesh>::AllocateSharedPtr(i, m_mesh);
}
else
{
m_curvemeshes[i] =
MemoryManager<CurveMesh>::AllocateSharedPtr(i, m_mesh, m_thickness);
}
m_curvemeshes[i]->Mesh();
}
......@@ -166,11 +184,6 @@ void Generator2D::MakeBLPrep()
cout << endl << "\tBoundary layer meshing:" << endl << endl;
}
// identify the nodes which will become the boundary layer.
ParseUtils::GenerateSeqVector(m_config["blcurves"].as<string>().c_str(),
m_blCurves);
m_thickness = m_config["blthick"].as<NekDouble>();
for (vector<unsigned>::iterator it = m_blCurves.begin();
it != m_blCurves.end(); ++it)
{
......
......@@ -309,7 +309,15 @@ void CurveMesh::GetSampleFunction()
loc = m_cadcurve->P(t);
dsti[0] = m_mesh->m_octree->Query(loc);
if(m_bl > 0.0)
{
dsti[0] = m_mesh->m_octree->QueryR(loc);
}
else
{
dsti[0] = m_mesh->m_octree->Query(loc);
}
dsti[2] = t;
m_dst[i] = dsti;
......
......@@ -64,6 +64,7 @@ public:
CurveMesh(int id, MeshSharedPtr m)
: m_id(id), m_mesh(m)
{
m_bl = 0.0;
m_cadcurve = m_mesh->m_cad->GetCurve(m_id);
}
......@@ -72,6 +73,16 @@ public:
*/
CurveMesh(int id, MeshSharedPtr m, std::vector<NodeSharedPtr> n)
: m_id(id), m_mesh(m), m_meshpoints(n)
{
m_bl = 0.0;
m_cadcurve = m_mesh->m_cad->GetCurve(m_id);
}
/**
* @brief alternative constructor which use the octree in a different way
*/
CurveMesh(int id, MeshSharedPtr m, NekDouble n)
: m_id(id), m_mesh(m), m_bl(n)
{
m_cadcurve = m_mesh->m_cad->GetCurve(m_id);
}
......@@ -176,6 +187,7 @@ private:
MeshSharedPtr m_mesh;
/// ids of the mesh nodes
std::vector<NodeSharedPtr> m_meshpoints;
NekDouble m_bl;
};
typedef boost::shared_ptr<CurveMesh> CurveMeshSharedPtr;
......
......@@ -775,7 +775,7 @@ void BLMesh::BuildElements()
}
vector<int> tags;
tags.push_back(m_mesh->m_cad->GetNumSurf() < 100 ? 101 : 1001);
tags.push_back(m_mesh->m_cad->GetNumSurf() < 100 ? 101 : 1001);
ElementSharedPtr E = GetElementFactory().
CreateInstance(LibUtilities::ePrism, pconf, pn, tags);
E->SetId(i);
......
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