Commit 53ca2126 authored by Julian Marcon's avatar Julian Marcon

Made adjust options accessible to the user.

parent e1c76f08
......@@ -56,6 +56,10 @@ Generator2D::Generator2D(MeshSharedPtr m) : ProcessModule(m)
ConfigOption(false, "0", "Generate parallelograms on these curves");
m_config["blthick"] =
ConfigOption(false, "0.0", "Parallelogram layer thickness");
m_config["bltadjust"] =
ConfigOption(false, "2.0", "Boundary layer thickness adjustment");
m_config["adjustblteverywhere"] =
ConfigOption(true, "0", "Adjust thickness everywhere");
}
Generator2D::~Generator2D()
......@@ -252,6 +256,10 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoopSharedPtr> e)
}
}
bool adjust = m_config["bltadjust"].beenSet;
NekDouble divider = m_config["bltadjust"].as<NekDouble>();
bool adjustEverywhere = m_config["adjustblteverywhere"].beenSet;
map<NodeSharedPtr, NodeSharedPtr> nodeNormals;
map<NodeSharedPtr, vector<EdgeSharedPtr> >::iterator it;
for (it = m_nodesToEdge.begin(); it != m_nodesToEdge.end(); it++)
......@@ -271,17 +279,15 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoopSharedPtr> e)
NekDouble t = m_thickness.Evaluate(m_thickness_ID, it->first->m_x,
it->first->m_y, 0.0, 0.0);
bool adjustVertTOnly = false;
// Adjust thickness according to anlge between normals
if (!adjustVertTOnly || it->first->GetNumCadCurve() > 1)
// Adjust thickness according to angle between normals
if (adjust)
{
NekDouble angle = acos(n1[0] * n2[0] + n1[1] * n2[1]);
angle = (angle > M_PI) ? 2 * M_PI - angle : angle;
NekDouble divider =
2.0; // Exact solution with 2.0; Higher values will
// smooth the thickness at sharp angles.
t /= cos(angle / divider);
if (adjustEverywhere || it->first->GetNumCadCurve() > 1)
{
NekDouble angle = acos(n1[0] * n2[0] + n1[1] * n2[1]);
angle = (angle > M_PI) ? 2 * M_PI - angle : angle;
t /= cos(angle / divider);
}
}
n[0] = n[0] * t + it->first->m_x;
......
......@@ -206,6 +206,17 @@ void InputMCF::ParseFile(string nm)
it = parameters.find("BndLayerProgression");
m_blprog = it != parameters.end() ? it->second : "2.0";
}
it = parameters.find("BndLayerAdjustment");
if (it != parameters.end())
{
m_adjust = true;
m_adjustment = it->second;
}
else
{
m_adjust = false;
}
}
m_naca = false;
......@@ -234,12 +245,14 @@ void InputMCF::ParseFile(string nm)
}
set<string>::iterator sit;
sit = boolparameters.find("SurfaceOptimiser");
m_surfopti = sit != boolparameters.end();
sit = boolparameters.find("WriteOctree");
m_woct = sit != boolparameters.end();
sit = boolparameters.find("VariationalOptimiser");
m_varopti = sit != boolparameters.end();
sit = boolparameters.find("SurfaceOptimiser");
m_surfopti = sit != boolparameters.end();
sit = boolparameters.find("WriteOctree");
m_woct = sit != boolparameters.end();
sit = boolparameters.find("VariationalOptimiser");
m_varopti = sit != boolparameters.end();
sit = boolparameters.find("BndLayerAdjustEverywhere");
m_adjustall = sit != boolparameters.end();
m_refine = refinement.size() > 0;
if(m_refine)
......@@ -304,6 +317,16 @@ void InputMCF::Process()
{
mods.back()->RegisterConfig("blcurves", m_blsurfs);
mods.back()->RegisterConfig("blthick", m_blthick);
if (m_adjust)
{
mods.back()->RegisterConfig("bltadjust", m_adjustment);
if (m_adjustall)
{
mods.back()->RegisterConfig("adjustblteverywhere", "");
}
}
}
}
else
......
......@@ -63,9 +63,9 @@ public:
private:
std::string m_minDelta, m_maxDelta, m_eps, m_cadfile, m_order,
m_blsurfs, m_blthick, m_blprog, m_bllayers, m_refinement,
m_nacadomain;
m_nacadomain, m_adjustment;
bool m_makeBL, m_surfopti, m_varopti, m_refine, m_woct, m_2D, m_splitBL,
m_naca;
m_naca, m_adjust, m_adjustall;
};
}
......
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