Commit ce099d2a authored by Julian Marcon's avatar Julian Marcon
Browse files

Tidy.

parent ed68a10e
......@@ -110,7 +110,7 @@ void Generator2D::Process()
{
NekDouble L1 = m_mesh->m_cad->GetCurve(it->first)->GetTotLength();
NekDouble L2 = m_mesh->m_cad->GetCurve(it->second)->GetTotLength();
ASSERTL0(abs((L1 - L2) / L1) < 1.0e-3,
"periodic curves of different length");
}
......@@ -153,7 +153,7 @@ void Generator2D::Process()
T1[0] = B1[0] - A1[0];
T1[1] = B1[1] - A1[1];
T2[0] = B2[0] - A2[0];
T2[1] = B2[1] - A2[1];
......@@ -171,7 +171,7 @@ void Generator2D::Process()
T1[0] = B1[0] - A2[0];
T1[1] = B1[1] - A2[1];
T2[0] = B2[0] - A1[0];
T2[1] = B2[1] - A1[1];
......@@ -247,7 +247,7 @@ void Generator2D::Process()
MemoryManager<CurveMesh>::AllocateSharedPtr(ip->second, m_mesh,
nnodes);
}
if (m_mesh->m_verbose)
{
cout << "\t\tPeriodic boundary conditions" << endl;
......@@ -303,7 +303,7 @@ void Generator2D::Process()
}
}
//m_mesh->m_element[1].clear();
// m_mesh->m_element[1].clear();
if (m_mesh->m_verbose)
{
......@@ -374,7 +374,7 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoop> e)
int eid = 0;
for (vector<unsigned>::iterator it = m_blCurves.begin();
it != m_blCurves.end(); ++it)
it != m_blCurves.end(); ++it)
{
int edgeo = edgeToOrient[*it];
......@@ -382,17 +382,17 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoop> e)
// on each !!!EDGE!!! calculate a normal
// always to the left unless edgeo is 1
for(int j = 0; j < es.size(); j++)
for (int j = 0; j < es.size(); j++)
{
es[j]->m_id = eid++;
Array<OneD, NekDouble> p1 = (edgeo == 0) ? es[j]->m_n1->GetLoc()
: es[j]->m_n2->GetLoc();
Array<OneD, NekDouble> p2 = (edgeo == 0) ? es[j]->m_n2->GetLoc()
: es[j]->m_n1->GetLoc();
Array<OneD, NekDouble> p1 =
(edgeo == 0) ? es[j]->m_n1->GetLoc() : es[j]->m_n2->GetLoc();
Array<OneD, NekDouble> p2 =
(edgeo == 0) ? es[j]->m_n2->GetLoc() : es[j]->m_n1->GetLoc();
Array<OneD, NekDouble> n(2);
n[0] = p1[1] - p2[1];
n[1] = p2[0] - p1[0];
NekDouble mag = sqrt(n[0]*n[0]+n[1]*n[1]);
n[0] = p1[1] - p2[1];
n[1] = p2[0] - p1[0];
NekDouble mag = sqrt(n[0] * n[0] + n[1] * n[1]);
n[0] /= mag;
n[1] /= mag;
edgeNormals[es[j]->m_id] = n;
......@@ -401,7 +401,7 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoop> e)
map<NodeSharedPtr, NodeSharedPtr> nodeNormals;
map<NodeSharedPtr, vector<EdgeSharedPtr> >::iterator it;
for(it = m_nodesToEdge.begin(); it != m_nodesToEdge.end(); it++)
for (it = m_nodesToEdge.begin(); it != m_nodesToEdge.end(); it++)
{
Array<OneD, NekDouble> n(3);
ASSERTL0(it->second.size() == 2,
......@@ -409,9 +409,9 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoop> e)
Array<OneD, NekDouble> n1 = edgeNormals[it->second[0]->m_id];
Array<OneD, NekDouble> n2 = edgeNormals[it->second[1]->m_id];
n[0] = (n1[0] + n2[0]) / 2.0;
n[1] = (n1[1] + n2[1]) / 2.0;
NekDouble mag = sqrt(n[0]*n[0]+n[1]*n[1]);
n[0] = (n1[0] + n2[0]) / 2.0;
n[1] = (n1[1] + n2[1]) / 2.0;
NekDouble mag = sqrt(n[0] * n[0] + n[1] * n[1]);
n[0] /= mag;
n[1] /= mag;
......@@ -423,25 +423,25 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoop> e)
new Node(m_mesh->m_numNodes++, n[0], n[1], 0.0));
CADSurfSharedPtr s = m_mesh->m_cad->GetSurf(faceid);
Array<OneD, NekDouble> uv = s->locuv(n);
nn->SetCADSurf(faceid,s,uv);
nn->SetCADSurf(faceid, s, uv);
nodeNormals[it->first] = nn;
}
for (vector<unsigned>::iterator it = m_blCurves.begin();
it != m_blCurves.end(); ++it)
it != m_blCurves.end(); ++it)
{
int edgeo = edgeToOrient[*it];
vector<NodeSharedPtr> ns = m_curvemeshes[*it]->GetMeshPoints();
vector<NodeSharedPtr> newNs;
for(int i = 0; i < ns.size(); i++)
for (int i = 0; i < ns.size(); i++)
{
newNs.push_back(nodeNormals[ns[i]]);
}
m_curvemeshes[*it] = MemoryManager<CurveMesh>::AllocateSharedPtr(
*it, m_mesh, newNs);
m_curvemeshes[*it] =
MemoryManager<CurveMesh>::AllocateSharedPtr(*it, m_mesh, newNs);
if(edgeo == 1)
if (edgeo == 1)
{
reverse(ns.begin(), ns.end());
}
......@@ -450,8 +450,8 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoop> e)
vector<NodeSharedPtr> qns;
qns.push_back(ns[i]);
qns.push_back(ns[i+1]);
qns.push_back(nodeNormals[ns[i+1]]);
qns.push_back(ns[i + 1]);
qns.push_back(nodeNormals[ns[i + 1]]);
qns.push_back(nodeNormals[ns[i]]);
ElmtConfig conf(LibUtilities::eQuadrilateral, 1, false, false);
......@@ -466,7 +466,7 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoop> e)
for (int j = 0; j < E->GetEdgeCount(); ++j)
{
pair<EdgeSet::iterator,bool> testIns;
pair<EdgeSet::iterator, bool> testIns;
EdgeSharedPtr ed = E->GetEdge(j);
// look for edge in m_mesh edgeset from curves
EdgeSet::iterator s = m_mesh->m_edgeSet.find(ed);
......
......@@ -59,12 +59,12 @@ public:
static ModuleKey className;
Generator2D(MeshSharedPtr m);
virtual ~Generator2D();
virtual void Process();
private:
void MakeBLPrep();
void MakeBL(int faceid, std::vector<EdgeLoop> e);
......
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